This year our team is trying to use vision tracking to determine our original location on the field. our idea is to use the 3 backboards to somewhat triangulate where EXACTLY (down to maybe an inch) we are on the field so that we could use that information to then shoot baskets autonomously. Does have an ideas as to how to use vision tracking in java. what steps we would have to take as far as writing the code. How to use vision tracking in general, and how vision tracking might relate to what we ar trying to do (a.k.a. what will the code look like as far as classes, subsystems, projects, etc.)
for starters there is a very nice sample code that you can upload if you download the newest FRC plugins on netbeans. We used it with great success and our robot tracks squares very nicely. As for finding your position we are calculation the distance by using the camera and trig functions as well as several encoders/gyros to help us find the appropriate angle to shoot. Hope this helps!
The problem with a method like this is as far as I know and as far as we’ve talked on our team, the only way to really effectively do this would be with reverse skew matrices.
Basically, in graphics, when you’re generating an object, say, a square, you want to know how that object will look as the camera moves around it. To calculate this you use something called a “skew matrix” that’s basically a mathematical explanation of how the object will distort as you move around it.
Unfortunately, as far as we’ve found, doing this backwards (what you’d need to determine position given skew of the targets) is far from easy. Hopefully someone has found a better way to do it and will let us all know here.
Interesting. I haven’t done this (robot not yet built. we only have one), but I’ve been thinking about ways to do this.
If you know the side and top length of the vision tracking box, you can use the known ratio of the side/top to determine the angle at which you are to the baskets. Then, using the side length, you can determine the distance you are to the baskets. Using this information, you pretty much have all you need.
Of course, if your camera height is significantly different from the target height, you’d have to account for that too (the side length will seem slightly less than it actually is)