ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Clock - How to change it?

asked 2011-12-11 21:40:06 -0500

apalomer gravatar image


I've been trying to work in simulation from massages that I have already recorded in a bag file, but I allways get warn messages saying that it is not possible to use the data because it is too old.

I've been reading about simulating a clock, but I can not figure it out how to use it. Could you help me please?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-12-11 22:59:46 -0500

dejanpan gravatar image

Hi! What I normally do is I set the use_sim_time parameter to true:

$ rosparam set use_sim_time true

and then play the bag as following:

$ rosbag play bag.bag --clock

That shall get over the old messages hump.


edit flag offensive delete link more


I'm doing exactly this: 1- run the roscore 2- run the nodes 3- rosbag play bag.bag --clock but I keep getting the same error and the time printed in the messages as roswarn or rosinfo is not the one in the massages i'm simulating.
apalomer gravatar image apalomer  ( 2011-12-12 00:12:47 -0500 )edit
I saw that at the very beginning of the launch file the parameter has been setting as false....
apalomer gravatar image apalomer  ( 2011-12-12 01:02:02 -0500 )edit
Then, you should change the parameter value of the use_sim_time as true in the launch file.
alfa_80 gravatar image alfa_80  ( 2011-12-13 22:30:38 -0500 )edit
Done, i can simulate now!
apalomer gravatar image apalomer  ( 2011-12-19 19:16:49 -0500 )edit

answered 2011-12-12 04:22:20 -0500

tfoote gravatar image

You need to set /use_sim_time to true before processes start. Otherwise they start operating on wall time. And then the simulated time is significantly behind wall time, and most code cannot handle backwards jumps in time.

edit flag offensive delete link more

Question Tools



Asked: 2011-12-11 21:40:06 -0500

Seen: 4,565 times

Last updated: Dec 12 '11