Ask Your Question

Revision history [back]

Recording tf_static from rosbag api.

I am recording data about my robot's motion and trying to play it back offline. When I call rosbag record [topics] from the terminal with the topics of interest specified, all data is collected and playback with rosbag play [bag file] --clock works fine. However, when I move the recording to a node using the api it always seems to forget one topic... 'tf_static'. I am using the joint_state_publisher and robot_state_publisher to broadcast the transforms of my robot's joints. I am able to playback bag files collected via the terminal, but since I am missing tf_static from the bag files recorded with the node, playback does not work.

How do I force tf_static to republish when opening a new bag file for recording?

Rosbag Info from Terminal (tf_static present)

        path:        2018-05-24-14-30-38.bag
        version:     2.0
        duration:    7.3s
        start:       May 24 2018 14:30:39.43 (1527186639.43)
        end:         May 24 2018 14:30:46.69 (1527186646.69)
        size:        34.1 MB
        messages:    1494
        compression: none [38/38 chunks]
        types:       bond/Status                [eacc84bf5d65b6777d4c50f463dfb9c8]
                     crawler_msgs/CrawlerStatus [9bab7663a76ff2ea474c48d7a7d54e83]
                     rosgraph_msgs/Log          [acffd30cd6b6de30f120938c17c593fb]
                     sensor_msgs/CameraInfo     [c9a58c1b0b154e0e6da7578cb991d214]
                     sensor_msgs/Image          [060021388200f6f0f447d0fcd9c64743]
                     sensor_msgs/JointState     [3066dcd76a6cfaef579bd0f34173e9fd]
                     tf/tfMessage               [94810edda583a504dfda3829e70d7eec]
                     tf2_msgs/TFMessage         [94810edda583a504dfda3829e70d7eec]
        topics:      /camera1/depth/camera_info                24 msgs    : sensor_msgs/CameraInfo    
                     /camera1/depth_registered/image_rect_raw  24 msgs    : sensor_msgs/Image         
                     /camera1/rgb/camera_info                  24 msgs    : sensor_msgs/CameraInfo    
                     /camera1/rgb/image_rect_color             24 msgs    : sensor_msgs/Image         
                     /camera2/depth/camera_info                24 msgs    : sensor_msgs/CameraInfo    
                     /camera2/depth_registered/image_rect_raw  22 msgs    : sensor_msgs/Image         
                     /camera2/rgb/camera_info                  23 msgs    : sensor_msgs/CameraInfo    
                     /camera2/rgb/image_rect_color             21 msgs    : sensor_msgs/Image         
                     /camera3/depth/camera_info                23 msgs    : sensor_msgs/CameraInfo    
                     /camera3/depth_registered/image_rect_raw  21 msgs    : sensor_msgs/Image         
                     /camera3/rgb/camera_info                  25 msgs    : sensor_msgs/CameraInfo    
                     /camera3/rgb/image_rect_color             22 msgs    : sensor_msgs/Image         
                     /camera4/depth/camera_info                22 msgs    : sensor_msgs/CameraInfo    
                     /camera4/depth_registered/image_rect_raw  24 msgs    : sensor_msgs/Image         
                     /camera4/rgb/camera_info                  21 msgs    : sensor_msgs/CameraInfo    
                     /camera4/rgb/image_rect_color             23 msgs    : sensor_msgs/Image         
                     /camera_nodelet_manager/bond             813 msgs    : bond/Status
                     /joint_states                             79 msgs    : sensor_msgs/JointState    
                     /mobile_base/status                        9 msgs    : crawler_msgs/CrawlerStatus
                     /rosout                                   76 msgs    : rosgraph_msgs/Log
                     /rosout_agg                                1 msg     : rosgraph_msgs/Log         
                     /tf                                      148 msgs    : tf2_msgs/TFMessage
                     /tf_static                                 1 msg     : tf2_msgs/TFMessage

Rosbag Info from Node (tf_static missing)

        path:        2018-7-19-13-24-54.bag
        version:     2.0
        duration:    6.2s
        start:       Jul 19 2018 12:24:53.84 (1532017493.84)
        end:         Jul 19 2018 12:25:00.05 (1532017500.05)
        size:        26.8 MB
        messages:    1252
        compression: none [31/31 chunks]
        types:       bond/Status                [eacc84bf5d65b6777d4c50f463dfb9c8]
                     crawler_msgs/CrawlerStatus [9bab7663a76ff2ea474c48d7a7d54e83]
                     rosgraph_msgs/Log          [acffd30cd6b6de30f120938c17c593fb]
                     sensor_msgs/CameraInfo     [c9a58c1b0b154e0e6da7578cb991d214]
                     sensor_msgs/Image          [060021388200f6f0f447d0fcd9c64743]
                     sensor_msgs/JointState     [3066dcd76a6cfaef579bd0f34173e9fd]
                     tf/tfMessage               [94810edda583a504dfda3829e70d7eec]
        topics:      /camera1/depth/camera_info                  18 msgs    : sensor_msgs/CameraInfo    
                     /camera1/depth_registered/image_rect_raw    18 msgs    : sensor_msgs/Image         
                     /camera1/rgb/camera_info                    18 msgs    : sensor_msgs/CameraInfo    
                     /camera1/rgb/image_rect_color               18 msgs    : sensor_msgs/Image         
                     /camera2/depth/camera_info                  18 msgs    : sensor_msgs/CameraInfo    
                     /camera2/depth_registered/image_rect_raw    18 msgs    : sensor_msgs/Image         
                     /camera2/rgb/camera_info                    18 msgs    : sensor_msgs/CameraInfo    
                     /camera2/rgb/image_rect_color               18 msgs    : sensor_msgs/Image         
                     /camera3/depth/camera_info                  18 msgs    : sensor_msgs/CameraInfo    
                     /camera3/depth_registered/image_rect_raw    18 msgs    : sensor_msgs/Image         
                     /camera3/rgb/camera_info                    17 msgs    : sensor_msgs/CameraInfo    
                     /camera3/rgb/image_rect_color               17 msgs    : sensor_msgs/Image         
                     /camera4/depth/camera_info                  18 msgs    : sensor_msgs/CameraInfo    
                     /camera4/depth_registered/image_rect_raw    18 msgs    : sensor_msgs/Image         
                     /camera4/rgb/camera_info                    18 msgs    : sensor_msgs/CameraInfo    
                     /camera4/rgb/image_rect_color               18 msgs    : sensor_msgs/Image         
                     /camera_nodelet_manager/bond               667 msgs    : bond/Status               
                     /joint_states                               59 msgs    : sensor_msgs/JointState    
                     /mobile_base/status                          6 msgs    : crawler_msgs/CrawlerStatus
                     /rosout                                      1 msg     : rosgraph_msgs/Log         
                     /rosout_agg                                  1 msg     : rosgraph_msgs/Log         
                     /tf                                        232 msgs    : tf/tfMessage