Log in

View Full Version : Camera Tracking Problem


cprogrammer
18-02-2005, 14:19
Our camera won't track with the FRC code. We have the TTL adapter on the FRC controller and we have the power, TTL port, and the servo cables plugged into the camera. When we load the code the camera won't track the color we have selected. If we could get some help that would be great. :confused:

Mike
18-02-2005, 15:00
Could you post your current code? I think you're aware that in user_routines_fast.c there's a function called User_Autonomous_Code (Pretty sure, don't quote me on it.) well in that code you want to track your color.

Everytime you call camera_track_color it will set the camera back to its home position, defeating the point of tracking. So you want to only call it once. Here's how you would do it:

int Find_Color_Flag = 0; // Initialize a flag variable

if(Find_Color_Flag == 0) // If it hasn't been called yet
{
camera_find_color(GREEN); // Find the color
Find_Color_Flag = 1; // Set the flag to true
}

camera_track_update(); // Track the color

That should make it track the color green.

Make sure that your camera is calibrated, and that you replaced the 3 values for the camera initialization code in the initialization function.