Video: Color Camera Tracking

Heres a quick video we took after we got the camera tracking working. As I’ve said in previous posts, we used our own fairly simple code with the color values from the Two Color Tracking Demo. The video is here:

and the snipet of code we use to move the servos is here:

Questions and comments are appreciated.

that looks great. that should greatly help your robot during autonomous mode or during teleop if its a shooter

wooooooow … realy good

nice job guys…

Question, i am testing now ours now… When you guys were testing, did your camera need to have that vision target? or could you just use the green and pink fabric held in ur hand?

Also once it finds the color, i am assuming the camera should theoretically lock on to the color and not move correct?

but the second it looses it, it will look around?

Also how jittery are your servos? Ours seem extra jittery… And like either direction, left or right it will almost liek step there… and not go in a smooth constant motion

I ordered 4 more servos to be safe and try them, just to see if thats the issue…

Thanks, Dani

If the servo is jerky because it only moves a few times a second, you should try to speed up the loop. If your image size is large or if you have lots of processing, your framerate will drop and it will start jerking.

Another possibility, but less common, is that your target is too close to the camera. If the full image is filled with the target, it is by definition in the center, and you move the target some and the scene is still full, no movement. Only when the edge of the target enters the image will the servo move.

Greg McKaskle

good job! can you post the portion of the code where you defined what the values of green and red are? Thanks.

ok we got it, the code is switched apparentlly…
When it says to do pink over green, we do green over pink and it works…

Dani, If you are using the same “find color” vi that we are, the reason its backwards is because you are specifying your teams colors.

Then you also have to either push the button to find your foes (the opposite color scheme) or not to find teammates.

Hope that explains it a little more for you.

i know in 2006 and 07 teams would need to calibrate the cameras on the actual field. I am not a programmer nor familiar with the new system, but do these new cameras need to do that as well?

cool! did you do something about the intrinsic lag problem? Our f.p.s. never passes 9 and there’s a delay in the response of something like 0,25~0,5s.

that would be because you are trying to get video feedback at the same time/ the code is still taking it but just not showing it.
Once i ripped out the code that retrieves the video, it worked perfect. No lag at all and was really really smooth!