Good way to find distance

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…

This may be helpful to you.
http://firstforge.wpi.edu/sf/docman/do/downloadDocument/projects.wpilib/docman.root/doc1302/1

[/quote]

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.

  1. “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.

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

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.