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/ro...) 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/ro...
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.