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

Bug? Rosbag filter and /tf_static

asked 2017-05-05 20:12:51 -0600

ibd gravatar image

updated 2017-05-08 15:02:14 -0600

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:

The launch file to launch RTAB-Map can be found here:

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
edit retag flag offensive close merge delete


Do you have a small rosbag to share?

matlabbe gravatar image matlabbe  ( 2017-05-08 08:30:16 -0600 )edit

Updated the original post with a bag file and the launch file I use to launch RTAB-map.

ibd gravatar image ibd  ( 2017-05-08 15:03:03 -0600 )edit
ahendrix gravatar image ahendrix  ( 2017-05-08 15:05:56 -0600 )edit

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...

ibd gravatar image ibd  ( 2017-05-08 15:18:16 -0600 )edit

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.

matlabbe gravatar image matlabbe  ( 2017-05-09 09:59:36 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-09 10:26:45 -0600

matlabbe gravatar image

Static transforms are not latched anymore after filtering, see issue referred by@ahendrix in comments above:

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?



edit flag offensive delete link more


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.

ibd gravatar image ibd  ( 2017-05-09 12:53:38 -0600 )edit

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!

ibd gravatar image ibd  ( 2017-05-09 13:13:54 -0600 )edit

Question Tools



Asked: 2017-05-05 20:12:51 -0600

Seen: 2,271 times

Last updated: May 09 '17