Skip to content
benkehoe edited this page Feb 28, 2013 · 2 revisions

The real-time thread performs most of the major functions of the raven code.

The function that runs in the real-time thread is rt_process() in rt_process_preempt.cpp.

After initializing, the thread enters into its main loop, which runs at 1000 Hz as long as ROS has not signaled a shutdown. The loop contains the following steps:

  1. Read the encoder values from the USB and store it in the state
  2. Update the state machine
  3. Check if the command has been updated
  4. If the command has been updated, copy it into the state
  5. Execute the controller
  6. Check for overcurrent conditions
  7. Write the DAC commands out to the USB
  8. Publish the state to ROS
Clone this wiki locally