-
Notifications
You must be signed in to change notification settings - Fork 13
Real time thread
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:
- Read the encoder values from the USB and store it in the state
- Update the state machine
- Check if the command has been updated
- If the command has been updated, copy it into the state
- Execute the controller
- Check for overcurrent conditions
- Write the DAC commands out to the USB
- Publish the state to ROS