View Single Post
  #8   Spotlight this post!  
Unread 28-01-2012, 03:44
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: A good time based way to program

Quote:
Originally Posted by neal View Post
Thanks all for your suggestions. I'm trying to just stick with SimpleRobot for this year since I don't think we have enough time now to write it for CommandBased one, and to test, troubleshoot it.

Brad, does timeouts also work with SimpleRobot, I checked the cookbook and it only shows examples for the command-based bot.
Unfortunately it doesn't. You're correct that if you do a Timer.delay() it will stop the thread, and the rest of the program. If you want overlapped stuff happening then, as you suggested, you can use timers. Then you'll need a loop that checks if the time is up on the drive system while continuing to service the other subsystems. For trying to do a lot of overlapping operations I'd prefer to use the IterativeRobot base class. Then the looping is built in.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote