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

Clock - How to change it?

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

apalomer gravatar image

Hi,

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?

Thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

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

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.

D.

edit flag offensive delete link more

Comments

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 -0600 )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 -0600 )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 -0600 )edit
Done, i can simulate now!
apalomer gravatar image apalomer  ( 2011-12-19 19:16:49 -0600 )edit
2

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

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

2 followers

Stats

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

Seen: 4,683 times

Last updated: Dec 12 '11