Should I manually pass use_sim_time to all nodes in a ROS 2 launchfile ?
Should I always manually transmit the use_sim_time
manually to all my nodes in a launchfile in ROS 2, if I want to be able to slow down or accelerate the simulation time or be able to run it on rosbags ?
The only official example I have is from the robot state publisher tutorial, where it is transmitted manually.
But I would expect a way to setting it globally, since it is the entierity of a ROS 2 system that should affected by time when you slow down or accelerate a simulation, or replay a rosbag. And because it is repetitive and add length to the code.
Is there such a way instead ?
Hi! Did you since find a way to set use_sim_time globally (besides setting it in the launchfile)?
It would be convenient to have a global use_sim_time. However its up to each node to implement so i am not sure this is even possible or desirable.
however ever robot i have seen is has to pass it throughout the launch ecosystem because to your point it really does effect everything. I alsot breaks if every node is not on the same use_sim_time param. So de facto there is a global use_sim_time concept.
Therefore i think this is a good feature request and would require updated to rclcpp and rclpy i think. somewhat related and definitly good place for more info on the client library implementations of ros time: https://github.com/ros2/rclcpp/issues...