Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If you need to set use_sim_time from the commandline, then rosparam is your friend. Please read https://wiki.ros.org/rosparam

If you need to set it from a launch file, you can use either the <rosparam> tag to read a yaml file of parameters (https://wiki.ros.org/roslaunch/XML/rosparam) or you can use the <param> tag to set a particular parameter, like use_sim_time (https://wiki.ros.org/roslaunch/XML/param). For example, add <param name="/use_sim_time" value="true">

Reading the documentation helps alot.

Also helpful is the documentation regarding the ros clock: https://wiki.ros.org/roslaunch/XML/rosparam

You only need to set the /use_sim_time (note that it is in the root namespace) parameter once, and all your nodes will start using simulation time.