Ask Your Question
0

How to set use_sim_time

asked 2019-06-13 08:15:50 -0500

GabrielBagon44 gravatar image

Hi, I am wondering how you can set use_sim_time to true, or enable it for my nodes. Do I have to do it within my nodes? or in my launch file? Also, is this something you must do for all your nodes and/or launch files? Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2019-06-13 09:20:04 -0500

ChuiV gravatar image

If you need to set use_sim_time from the commandline, then rosparamis 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.

edit flag offensive delete link more

Comments

Thanks for the informative response!

GabrielBagon44 gravatar imageGabrielBagon44 ( 2019-06-13 12:04:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-06-13 08:15:50 -0500

Seen: 274 times

Last updated: Jun 13