How to NOT auto-start timer in ROS2?
In the ROS2 docs for create_timer(), I don't see any arguments for NOT auto-starting the timer upon creation (unlike the createTimer()
function in ROS1)
Am I just not seeing the way to do this in ROS2? Are there any workarounds?
I have a workaround where I have a
std::shared_ptr
member variable for the timer and only callcreateTimer()
when I actually want to start the timer. And to stop the timer from hitting it's callbacks, I simply call.reset()
on thestd::shared_ptr
member variable