View Single Post
  #7   Spotlight this post!  
Unread 15-09-2015, 15:06
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: Regarding Loop frequency

It is also worth considering having slower loops. The rate of a given loop should be appropriate for what the loop is measuring and what it is controlling. 50Hz was selected because the human with the joystick and buttons is giving input, and that is a reasonable speed for updating the robot from those inputs. Some control or state machine loops would benefit from running faster, others will work fine if run slower than 50Hz.

You also need to account for the amount of time that a loop takes to execute. Even though a camera can produce an image every 33ms, that doesn't mean that you can process the image in that amount of time or need to process every frame. So it may be useful to run an image processing loop at 10Hz -- be sure to process the most current image and not an old one.

If you want the equivalent of a thread in LV, simply make a parallel loop as shown in Periodic Tasks, or consider making it a Timed Loop if you want less jitter.

Greg McKaskle