View Single Post
  #5   Spotlight this post!  
Unread 09-01-2012, 11:58
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Help with C robot example

In my experience using the C++ library (C without the wrappers), all outputs completely stop once you're outside the code blocks. The methods are called once in simple robot when it detects it's changed to autonomous or operator control, and control of the robot is enabled during your code blocks.

I'll have to double check this, but either the robot drives forward for 5 seconds, then stops at the end because the autonomous program has ended, or.... if it still detects autonomous, it'll just keep on driving past the end of the block, until it detects a disable command or switching to operator control, at which point you could send new commands to the jaguars. I'll have to recheck this today. The reason they've stopped before is probably a combination of below and the fact that I stop it only by disable commands.

Usually, in order to provide immediate control and switching, I simply enclose everything within the method in a while(IsAutonomous()) or while(IsOperatorControl()) loop with a Wait(.005) at the end, making sure the code runs fast and it'll check every 5 ms to end everything.
__________________
Attending: MN Duluth Regional

Last edited by theprgramerdude : 09-01-2012 at 12:00.