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

Is there a way to synchronize ROS time and the time originating from a rosbag?

asked 2022-02-24 07:53:43 -0500

florian gravatar image

Some details: I'd like to compare real world data with simulated data, for this reason I'd like to play a rosbag (containing the real world data) and apply the recorded commands to a Gazebo model of the robot. For this purpose I set /use_sim_time to true and call rosbag play with the option --clock. Unfortunately I observe jumps in /clock topic - as it seems to me both the simulated time (from Gazebo) and the time originating from the rosbag are published to /clock. This leads in the end to a defective result - in particular the odometry data provided by the robot_localization package comes along with huge variances (magnitude 1e+4). Is there a solution to this problem? I would appreciate your help.

BR, Florian

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-02-25 04:21:22 -0500

Tom Moore gravatar image

You likely recorded your bag with -a. You need to get the /clock topic out of it: rosbag filter your_bag.bag clock_removed.bag "topic != /clock"

edit flag offensive delete link more

Comments

Thank you Tom. This worked for me. =)

BR, Florian

florian gravatar image florian  ( 2022-02-25 08:18:40 -0500 )edit

@florian Please don't create "an answer" that is not actually an answer to the question. To thank someone who helped you, you should use the link "add a comment" under their response.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-02-25 09:56:22 -0500 )edit

I found small syntax error in Tom's rosbag command. the topic name should be in single quote (for example: "topic != '/clock' ") rosbag filter your_bag.bag clock_removed.bag "topic != '/clock' "

rcbot gravatar image rcbot  ( 2023-02-20 18:17:36 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-02-24 07:53:43 -0500

Seen: 293 times

Last updated: Feb 25 '22