You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there are only wall_time based timers. It would be very useful for bag playback or any other instance that use_sim_time is enabled to have some kind of timer that can use ROS time as a backing. This would allow for pausing the system or slowing it down to match the playback of the bag file.
This would likely require having a thread running in the background monitoring these timers or utilizing Clock::create_jump_callback() to check the timers to see if they need to be executed in any instance rostime jumps. If any are ready you can then somehow mark those timers as ready to be ran by the executor and wake up the spinning thread by issuing a rcl_trigger_guard_condition(); on the node's notify_guard_condition.
I believe this was solved by ros2/rcl#286 which implements something very similar to what you described but in rcl. ROS time timers subscribe to clock jump callbacks and trigger a guard condition that wakes the wait set. Closing.
Currently there are only wall_time based timers. It would be very useful for bag playback or any other instance that
use_sim_time
is enabled to have some kind of timer that can use ROS time as a backing. This would allow for pausing the system or slowing it down to match the playback of the bag file.This would likely require having a thread running in the background monitoring these timers or utilizing
Clock::create_jump_callback()
to check the timers to see if they need to be executed in any instance rostime jumps. If any are ready you can then somehow mark those timers as ready to be ran by the executor and wake up the spinning thread by issuing arcl_trigger_guard_condition();
on the node's notify_guard_condition.This is how I hacked it in externally:
https://github.com/matt-attack/marti_common/blob/2ca02138b2ca25d32a8a5d32737d5a7759b69166/swri_roscpp/include/swri_roscpp/node.h#L86
https://github.com/matt-attack/marti_common/blob/2ca02138b2ca25d32a8a5d32737d5a7759b69166/swri_roscpp/src/node.cpp#L194
The text was updated successfully, but these errors were encountered: