So I feel like our teams teleop code is in a pretty good place as of last night, and we're getting started with autonomous (and the kinect
). But I'm also a bit curious if I should consider shuffling some routines into tasks.
Here's my current teleop code:
// increment the number of teleop periodic loops completed
anglesComputed = false;
testCount = 0;
AxisCamera &camera = AxisCamera::GetInstance("10.24.74.11");
ColorImage *colorImage = new ColorImage(IMAQ_IMAGE_HSL);
if (BUTTON_CAMERA_ALIGN_SHOT_BUTTON() && (anglesComputed == false))
if ((BUTTON_CAMERA_ALIGN_SHOT_BUTTON()) &&
(anglesComputed == true))
My other question is do any of the WPILib constructs, like Jaguar, Joystick, Gyro, etc play nice when shared between tasks, or do I need to set things up with semaphores and protect them (semaphoreDriverStick.get) OR will the inards of the WPILib choke if I try to use these attributes outside of the main task (implying that I will need to get values and put them into a seperate variable so I can protect them)?
Unrelated question: How often is periodic? Is it called at a set rate, or is it only when control packets are recieved from the DS (which would really be semi-periodic)?