View Full Version : Good way to find distance
eulerddx4
20-01-2012, 21:43
Does anyone have a recommended way to find distance from the hoop. It seems like range finders will have interference and cameras are hard to use...
Any suggestions?
Should we go with a camera?
If so is there a good program to use or do we have to do this ourselves...
BitTwiddler
20-01-2012, 22:21
This may be helpful to you.
http://firstforge.wpi.edu/sf/docman/do/downloadDocument/projects.wpilib/docman.root/doc1302/1
DonRotolo
20-01-2012, 22:42
[QUOTE=jpconnors9;1110151]It seems like range finders will have interference [QUOTE]Have you tried it, or relied on someone else's guesses?
I say you should try it yourself, because I don't think you'll see the kind of interference you think you will. Get 2 or 3 more and have them all running at the same time to see what happens.
Don't believe everything you read. Even this. Always try it yourself.
Don't believe everything you read. Even this. Always try it yourself.
Agreed! I think the statements regarding interference are highly overstated. Take a look at this statement form Maxibotix especially item number 2(https://www.facebook.com/note.php?note_id=277662868954588)
1. "I was wondering if you for see any potential problems with other robots using the same sensor at the same time during competition?"
Great question. It is possible the MB1010 sensor may detect other sensors in the same vicinity. but it becomes very improbable as targets are closer to the sensor. For example, if looking at a wall that is 3 feet away, the time of flight for the sonar travel will be 5.3mS (calculated using 148uS * 36in), and another sensor operating close by might get picked up about 11% of the time. (calculated using (148uS * 36in)/49000uS ) And as distances get longer, this can occur with a higher probability.
2. "How can we be sure that the signal we get back is from our sensor and not from another sensor on another robot on the field during competition."
Another great question. If you use the RX pin to command the sensor to range at something other than it's default read rate, or even at a random time (you would use a pin from your controller to do this), and then one checks that two readings in a row agree, it then becomes almost impossible for the two readings to agree unless it is from a valid target.
mikegrundvig
20-01-2012, 23:25
I won't speculate too much on how sonar sensors will perform in the competition but I will say this: I personally have had sonar sensors "ring" each other and it caused a lot of issues. We had 4 sensors on the edges of a box and sensors that were facing away from each other could pick up the return from their opposite. So we ended up having the north sensor pick up signals from the south sensor.
If you call the sensor company they will tell you about this. The solution is to fire the sensors so they are staggered. We ended up firing them in a loop that passed ensured they were never firing at the same time to clear up the problem.
I suspect if every robot was using multiple sonar sensors and hammering them as fast as possible something might happen but I have no idea what the interference will be in a real-world scenario.
-Mike
Metaphorical
21-01-2012, 13:25
If you want an interference-free way, do some math. Find the vertices of the target rectangle. If you're pointing at it with a camera of known elevation, the angle to the vertices is linked to the position of the vertices on the camera viewpicture. The height of each vertex is constant and fixed, so now you have an angle and its opposite side in a right triangle, and everything else can be found with a bit of trig.
Of course, no guarantees on accuracy - it'll all depend on your image processing capabilities.
You could use ultrasonic sensors. Our team has used them on numerous occasions during past games.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.