ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hello,
If you just want ctrl_loop()
to be executed periodically, create a timer in your node with ctrl_loop()
as its callback function, see the publisher node tutorial as an example.
If you want ctrl_loop()
to be executed upon receiving new values (e.g. joint values or cartesian pose), create a publisher node that publishes the values periodically, and a listener node that processes the values in its subscription callback, see the listener node tutorial. The publisher node's frequency will be driving the periodicity of the processing node.
If you want to prioritize callbacks (e.g. higher priority control loop vs lower priority setpoint generator) you will want to look at callback groups. See also ROS 2 Executor: How to make it efficient, real-time and deterministic?