Just wondering what other teams are using/have used to get the distance to the goal. If I have the distance to the goal I can throw the distance into my equation for our shooter and spit out the angle I need the shooter at to make the shot. Really, my quesetion is what is the most efficient manner when using vision processing to get the distance to the 3 ptn frisbee goal? I’m using java right now (doing a build on labview and java)
We’ve used a sonic rangefinder which came with fewer headaches but less sophistication and detail than vision processing. This might get the job done for what you need. Mount it centered on the front of the bot and the distance to the wall can be used for calculating shooter speed/shot distance. A voucher from MaxBotix was included in KOP and might be a sensible solution.
Well, we used one of those last year, but if anything gets in the way, a frisbee or a bot or even the pyramid, it will return a false distance. So I was thinking of going with the photon cannon idea and using the distance between the top and bottom retroreflective tape to give me my distance using some basic trig functions. I was just seeing if there were any very efficient algorithms on doing this. I don’t want it to take up a ton of processing obviously.
What the you have to do is determine the width of the target in pixels, given a constant value w/ the target centered, and find the hypotenuse, which is your distance
EDIT: Use the height for distance, not the width.The width can vary with angle to the target.
Example:
Note, these are necessary constants
public static final int IMAGE_WIDTH = 320;
public static final int IMAGE_HEIGHT = 240;
public static final double TARGET_WIDTH = 2.0;
public static final double TARGET_HEIGHT = 1.5;
public static final double RECTANGLE_QUALITY_THRESHOLD = 95.0;
public static final double PARTICLE_TO_IMAGE_THRESHOLD = 0.05;
public static final double PARTICLE_AREA_THRESHOLD = 250.0;
protected double fieldOfViewWidth = 0.0;
/**
* Return distance to target in inches
*
* @param targetHeightInPixels
* @return
*/
public double GetDistanceToTarget(int targetHeightInPixels)
{
double fieldOfViewHeight = TARGET_HEIGHT / targetHeightInPixels * IMAGE_HEIGHT;
distance = (fieldOfViewHeight / 2.0) /
/*
* tan 23.5 degrees
*/
0.4348123749;
return distance * 12.0 * 1.4;
}
I am assuming you can figure out how to filter for targets.
Has anyone tested my class I made? I’d like to know any results you have from it. I haven’t had a chance to try it yet, other things have out weighed it.
I wouldn’t recommend this. We used one last year. We had issues with teams on our alliance driving in front by accident, throwing our shooting off. Near the end of the second regional, we started to clue in that we should probably tell our alliance partners about it. Turns out this was a bad idea. Teams we played with in one match, and against in later matches (including eliminations) only had to SIT infront of us to throw our shooting off.
We had to fall back on our preset shooter values, which weren’t nearly as accurate or tuned in as our values from our ultrasonic. We spent all of lunch after alliance selections at our second regional tuning our presets, which we almost entirely used in our elimination matches.
you see, this is what our team did last year, we built a very complex robot (one that had the shooter able to turn, change the angle, had a range finder, camera, etc.) and we ended up not doing too well at competition because the programming was too complex for the programmers, all i’m saying is, if it doesn’t work out, shoot from the front or back of the pyramid and have a set angle and speed, that is what we are doing, good luck!
I agree with this. Having a shooter that can target from anywhere means layers of complexity in additional motors, moving parts that can fail, and programming. While there are certainly some teams that can pull this off, most of us will do better with a simple and reliable design.
A flashlight isn’t the best option for illuminating the targets. To make effective use of the retroreflector tape, what you want is a very wide angle light source. In any case, requiring the driver to split his attention between the field and the video display might not be a good choice.
If you simply want to “paint” a bright spot on the goals, a flashlight is okay. Just keep in mind that the retroreflective border isn’t going to do a good job of bouncing that light anywhere except directly back at the flashlight.