ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I think my answer on the mailing list you linked is the right one:
https://groups.google.com/d/msg/ros-sig-ng-ros/5ZwIWUct3o4/Rf_HKXDuAgAJ
You need to have something to wait on the timer (they do not create their own threads or anything) and so you need to add it to an executor. For that reason we create it through the node. It would be possible to have a timer which can be used with an executor and without a node, but that's not currently possible.
If you want a timer that automatically calls the callback without blocking (fire and forget), then you should consider using C++'s async and std::this_thread::sleep_for
: