View Single Post
  #2   Spotlight this post!  
Unread 11-02-2012, 17:22
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Benefits of "Periodic Tasks VI"?

TeleOp is called every 20ms in response to a message from the DS. Your code will not process messages from the driver station and field management system until the code returns. So, if you want to start a motor, wait while it cranks for 250ms, and then release a solenoid, that means it will stall out the normal execution of the code that allows the driver to control the robot. It will execute with the last motor command, and then if the watchdog or safety mechanisms are enabled, the motor will probably shut down because your code is not sending updates.

By comparison, Periodic tasks run in parallel. The loops initially share data with TeleOp via globals, but are not otherwise intertwined. The do not hold up teleop, and they do not wait for a message to arrive. They are a great place to have code that waits for sensors or timers and triggers because of a driver action or environmental action.

Does that help?

Greg McKaskle