Rosanswers logo

Hi all

I am using a .bag file with RTAB-map ROS. It uses some static transforms between different camera frames to do the mapping.

Edit: An example bag file that shows the buggy behavior can be downloaded here: https://www.dropbox.com/s/6ox0xq6ctg2b9jl/small_test.bag.tar.gz?dl=0

The launch file to launch RTAB-Map can be found here: https://pastebin.com/ZhXb5r5U

When I feed "data.bag" into RTAB-map, it works fine. Now, I create a dummy filtered rosbag, using:

rosbag filter data.bag data_filtered.bag "topic != '/thistopicdoesntexist'"

As this topic doesn't exist, it should create an identical .bag file. However, when I try to feed "data_filtered.bag" into RTAB-map, I get many errors like:

[ WARN] [1494031985.023853640, 1493939596.985478852]: Could not get transform from camera_depth to camera_color after 0.100000 seconds (for stamp=1493939594.615704)! Error=". canTransform returned after 0.10093 timeout was 0.1.".
  1. It seems that the filtered bag somehow is missing data from the static TF transforms. When I "rostopic echo -b data_filtered.bag", however, it shows that the static transforms are there.
  2. It seems that the dummy filtering actually alters the .bag. Both MD5 hash and file size are changed between "data.bag" and "data_filtered.bag"! No compression is used. Why is that?

Maybe the problem is related to the time stamp? In any case, I am using use_sim_time=true, and I am also using --clock when playing back the .bag files.

Any help would be appreciated.


  • ibd

Originally posted by ibd on ROS Answers with karma: 3 on 2017-05-05

Post score: 0

Original comments

Comment by matlabbe on 2017-05-08:
Do you have a small rosbag to share?

Comment by ibd on 2017-05-08:
Updated the original post with a bag file and the launch file I use to launch RTAB-map.

Comment by ahendrix on 2017-05-08:
This looks similar to https://github.com/ros/ros_comm/issues/685

Comment by ibd on 2017-05-08:
ahendrix, it seems related indeed. Is there a clean fix for the .bag files I already have? Maybe changing the timestamp of the tf_static topic messages? Another idea I have is to setup a bunch of static_transform publishers. But, it would be a bit tedious for my workflow...

Comment by matlabbe on 2017-05-09:
I tested the small bag and I can reproduce the problem in RVIZ too: when selecting Fixed Frame option, the static transforms won't show up in the pop-up menu with the "filtered" bag. Like ahendrix pointed out, it is like the static transforms are not latched anymore after filtering.


1 Answer 1


Rosanswers logo

Static transforms are not latched anymore after filtering, see issue referred by@ahendrix in comments above: https://github.com/ros/ros_comm/issues/685

Workaround: create again the static transforms (from $ rostopic echo /tf_static of the original bag):

   <node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 0.0797399667325 0.0797399667325 -0.702596283584 0.702596283584 device imu 100" />
   <node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0.0614856 0.00362063075446 -0.00414834496616 -0.990888233858 -0.00632257304794 0.00756104017168 0.134325588569 device camera_depth 100" />
   <node pkg="tf" type="static_transform_publisher" name="link3_broadcaster" args="0.0107366 0.00259880751323 -0.00281526009239 -0.990532183761 -0.00782511402323 0.00422548927873 0.136992356591 device camera_fisheye 100" />
   <node pkg="tf" type="static_transform_publisher" name="link4_broadcaster" args="0.0614856 0.00362063075446 -0.00414834496616 -0.990888233858 -0.00632257304794 0.00756104017168 0.134325588569 device camera_color 100" />

Also don't forget to use <param name="use_sim_time" value="true"/> with rosbag play --clock when replaying the bags.

I also noticed that the clock published by the bag is not synchronized with stamps in topics: it starts at time ~1494273103.819191 while topics start at time ~1494273096.775229216. Topics are ~7 seconds in the past. Is the clock of the computer recording the bag synchronized with tango clock?



Originally posted by matlabbe with karma: 6409 on 2017-05-09

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by ibd on 2017-05-09:
Thank you for the workaround. At least these transforms are constant across all rosbags. I try to synchronize the time between the Tango device and the computer by connecting both to the internet and updating from a time server. However, I find that the tango clock will drift substantially.

Comment by ibd on 2017-05-09:
I just did some tests, and it seems that the tango tablet clock will drift as much as 1 second in 30 minutes when not connected to the internet!


Your Answer

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