0
$\begingroup$

Rosanswers logo

I recorded a rosbag containing laser scans and while trying to play it back and visualize the output in rviz I get the following warning: Detected jump back in time of 1.0252e-05s. Clearing TF buffer.

The jump-back time just keeps increasing. I realize this problem has something to do with using the --clock option in rosbag play and using use_sim_time. Both of which are rightly done. I set at the very beginning of the launch file:

<param name="/use_sim_time" type="bool" value="true"/>

and pass the --clock option to rosbag play. I still get the warning.

The scans are being visualized in rviz, but every now and then there is a flicker in the screen and the scans go away and then come back. This is surely not how it's normally supposed to behave. (Additionally, when I feed the rosbag laser scans and other sensor data to a SLAM algorithm, it doesn't work. While in fact, the rosbag was recorded the first time with said algorithm, rtabmap).

Edit: Adding the launch file and a snippet of what the rosbag file contains:

<launch>   
    <param name="/use_sim_time" type="bool" value="true"/>
    <node pkg="rosbag" type="play" name="playback_vel_rtab"
          args="--clock $(find my_pkg)/datacapture/bagname.bag">
          <remap from="/scan"            to="/fake_scan"/>
    </node>
</launch>

And here is my bagfile:

path:        rtab_in_2023-01-27-10-05.bag
version:     2.0
duration:    2:22s (142s)
start:       Jan 01 1970 01:00:00.29 (0.29)
end:         Jan 01 1970 01:02:23.02 (143.02)
size:        6.2 GB
messages:    159462
compression: none [919/919 chunks]
types:       nav_msgs/Odometry      [cd5e73d190d741a2f92e81eda573aca7]
             rosgraph_msgs/Clock    [a9c97c1d230cfc112e270351a944ee47]
             sensor_msgs/CameraInfo [c9a58c1b0b154e0e6da7578cb991d214]
             sensor_msgs/Image      [060021388200f6f0f447d0fcd9c64743]
             sensor_msgs/LaserScan  [90c7ef2dc6895d81024acba2ac42f369]
             tf2_msgs/TFMessage     [94810edda583a504dfda3829e70d7eec]
topics:      /camera/depth/image_raw      459 msgs    : sensor_msgs/Image     
             /camera/rgb/camera_info      459 msgs    : sensor_msgs/CameraInfo
             /camera/rgb/image_raw        459 msgs    : sensor_msgs/Image     
             /clock                    141763 msgs    : rosgraph_msgs/Clock   
             /odom                       4274 msgs    : nav_msgs/Odometry     
             /scan                        712 msgs    : sensor_msgs/LaserScan 
             /tf                        11335 msgs    : tf2_msgs/TFMessage     (3 connections)
             /tf_static                     1 msg     : tf2_msgs/TFMessage

Originally posted by shrini96 on ROS Answers with karma: 13 on 2023-02-05

Post score: 1


Original comments

Comment by Mike Scheutzow on 2023-02-05:
Is it possible you have two sources publishing to /clock topic? It won't work if both gazebo and rosbag are publishing the ros time.

Comment by shrini96 on 2023-02-05:
No, it is only the rosbag that is publishing. Let me update the question with my launch file and a snippet of my rosbag file^^

Comment by Mike Scheutzow on 2023-02-05:
When the bag file was created, it recorded the /clock topic; this is a problem because I believe that the --clock option synthesizes (i.e. generates) a ros clock. So your play command is sending two different data streams to the /clock topic. I would try specifying the topics you want rosbag to play back, and make sure not to publish the /clock topic from the bag file.

Comment by shrini96 on 2023-02-07:
You are right. This works like a charm (with the exception of occasionally getting the TF_REPEATED_DATA warning, which i think is a different issue altogether).

Thanks a lot. You can write this as an answer and I will mark it as accepted.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

When the bag file was created, it recorded the /clock topic; this is a problem because I believe that the --clock option synthesizes (i.e. generates) a ros clock. So your play command is sending two different data streams to the /clock topic.

I would try specifying the topics you want rosbag to play back, and make sure not to publish the /clock topic from the bag file.


Originally posted by Mike Scheutzow with karma: 4903 on 2023-02-07

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.