Quote:
|
Originally Posted by chakorules
I think I read somewhere that it takes 3 seconds for the CMUcam to either initialize or send packets. Does anyone know for sure which one is taking the 3 seconds?
I guess it would help to know where the 3 second delay is happening. In the initialize function? In the start function? In the capture data function?
Maybe we are too paranoid... ;-)
|
You are not paranoid to want to know what's happening inside your robot!
When the robot starts (power on -when you first turn it on) a clock starts running. The camera won't start initializing until after 2 seconds and the gyros won't initialize until after 1 second. The reason is to make sure that the robot has settled down and the camera has completed its initialization. In competition this should not be a problem since you put the robot on the field, turn it on, and usually several minutes pass before the match starts.
So the thing to do is initialize the camera and gyros in the Initialize() function, then start them either in Initialize() or Autonomous() or OperatorControl(). Our robot has both, and they are started during the Initialize() function just to be sure they're running. That way if the robot is restarted for some reason in the middle of the operator control period, the devices are guaranteed to be initialized - since autonomous will be skipped in this case.