Two color vision tracking code was released for both C++ and LabVIEW (links at http://usfirst.org/frccontrolsystem).
We used the example code inside the Basic LabVIEW framework and created an autonomous program to follow the goal, maintaining a distance away from it. The only sensor used was the camera, and the robot uses a 2 motor tank style drivetrain.
I'd recommend using the official example first, to make sure all the color tracking is correct (and it has more controls for adjusting other things). The attached code also includes the portion of code from the official example that we used.
PID constants in the Autonomous Independent will probably need to be tweaked for your robot. Our robot was geared to about 7 feet per second, but we've only run at about 1/3 speed so far. We've only used proportional control so far. The robot will search for the target by turning slowly towards the direction it last saw a target.
See the following video which shows the robot following the target around, and discriminating friendly targets from the opponents targets, and choosing the largest target if two opponents targets are visible. http://www.youtube.com/watch?v=15nqy7hKixA


Reply With Quote
