View Single Post
  #14   Spotlight this post!  
Unread 12-02-2012, 19:49
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"?

I'm pretty sure the Periodic tasks have been there since the beginning. The Vision task is basically the same thing, but specialized to be throttled by camera images showing up.

Joystick values show up when new control packets arrive. So the teleop is designed to be a great place to catch the latest joystick "events" and respond to them with the least latency. For some operations, where the joystick is the most important trigger and the response is quick, teleop is a great place to put the code.

If the code is also triggered by time, takes more than 20ms to complete the operation, or includes sensor measurement to complete a control loop, Periodic may be a better place. As ratdude said, using teleop joystick data to update set points and time to run the control algorithm is a pretty common situation. That naturally minimizes the latency of both inputs. Note that it is pretty easy to read the joystick wherever you like, so this can often simplify some of the communication between Periodic and teleop and not require using a global just to hold the joystick state.

Greg McKaskle