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

STAGE creates bag files with a wrong timestamp

asked 2012-12-24 04:59:05 -0500

ubisum gravatar image

updated 2012-12-24 05:00:23 -0500

hello everyone
in these days, i've tried to create bag files by recording messages generated by STAGE robot simulator.
The problem is that every bag file generated has a timestamp associated to the date of linux's birth (january 1st, 1970). I tried twice and I got same problem. This doesn't happen if i generate a custom topic, write on it by my code and store messages in a bag file. in this case, bag file has a correct timestamp.

could you tell me how to force system to write properly timestamps for bags generated by STAGE?
thanks for support.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-12-24 09:20:46 -0500

joq gravatar image

updated 2012-12-24 09:22:14 -0500

Stage generates simulated time, which begins at zero (Jan. 1, 1970).

I don't know how to change that.

If you run another node in the same ROS graph with /use_sim_time set, it should generate compatible timestamps with the messages stage publishes.

edit flag offensive delete link more


As Jack mentions the intended behavior is to have all nodes running with /use_sim_time. This allows everything to remain syncronized even if the sim runs faster or slower than real time.

tfoote gravatar image tfoote  ( 2012-12-25 14:41:12 -0500 )edit

thanks for your answer. i started roscore, then i wrote
rosparam set /use_sim_time true.
Then i wrote
rosbag play --clock bag1.bag bag2.bag
nothing happened. execution of first bag continues to last 40 years since his 1970 timestamp. maybe i mistooke somewhere. do u know where?

ubisum gravatar image ubisum  ( 2012-12-26 03:57:16 -0500 )edit

moreover: how to tell STAGE node to run with /use_sim_time?

ubisum gravatar image ubisum  ( 2012-12-26 04:03:44 -0500 )edit

Set the /use_sim_time parameter before running Stage. Running rosbag with the --clock option causes it to publish the /clock topic, not what you want when running Stage.

joq gravatar image joq  ( 2013-01-14 13:02:06 -0500 )edit

Question Tools


Asked: 2012-12-24 04:59:05 -0500

Seen: 474 times

Last updated: Dec 24 '12