View Full Version : EasyC for FRC: Drive and Auto Track Camera Code
Kingofl337
11-12-2006, 16:35
Autonomous - Robot rotates to the center of the green
target.
Operator Control - Drives in arcade mode as normal
and when the trigger is pulled on the drive joystick
the robot will disable arcade drive and rotate to
center itself.
This program has victor scaling in the drive function.
This makes the victors act in a more linear fashon.
Adam
When using EasyC for FRC, can one issue a Track_Color() command to the camera to change the tracking values without restarting the camera?
Jon
Kingofl337
28-12-2006, 13:28
The best way to change colors is to send:
StopCamera();
InitCamera(2);
StartCamera();
Where "2" would be the second table you define in the Camera Setup.
So this will be about a 2-second delay to switch colors?
Kingofl337
28-12-2006, 15:26
Roughly...Yes
But, the robot should keep driving during the switch.
BradAMiller
29-12-2006, 15:38
Roughly...Yes
But, the robot should keep driving during the switch.
Actually, this is close but not quite correct.
What happens is that the code waits for the robot to be on for 2 seconds before it will send any initialization data to the camera. This is to ensure that the camera has powered itself up. Your program can do other things during that 2 seconds, but the InitCamera function will wait (inside the function) until the camera is properly powered up.
Once that happens, the actual initialization takes about 50ms. So you can stop the camera, send it new initialization data, and restart in under 100ms for everything.
The 2 second delay only applies to the first time.
Brad
Brad
Thanks for the clarification
Have a great New Year!
Jon
Kingofl337
08-01-2007, 15:30
I will be combining this code and the 2007 kickoff code shortly.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.