The demo includes some instrumented code to show the statistics. This is not ideal now that ros2 tracing is available.
We have the executor period and the timers period. The timers are set at a frequency slightly faster than the executor loop frequency. This way, in every iteration we have one callback per timer pending to execute. An alternative approach would be better. See Execution workflow section.
Motivation
Follow-up from: https://github.com/ros-realtime/community/issues/21
The only real-time application in ros2 repositories is the pendulum_control demo.
This code is quite old now and it would be good if the demo is revisited and updated with the latest ROS 2 features.
Related resources:
Issues found
print('# of samples overrun:', len(indices[0]))
=> https://github.com/ros2/realtime_support/blob/rolling/rttest/scripts/analyze.py#L46**Possible improvements
Execution workflow
spin_once
implements a standard real-time loopDraft
Draft here: https://github.com/carlossvg/demos/tree/master/pendulum_control
Acceptance criteria