rosbag play does not publish world TF if the replay does not start from the beginning

asked 2018-06-07 06:32:03 -0600

mfocchi gravatar image

Hi, I created a launch file to replay my bag files from experiments. The launch file accepts "rate" and "start" as input parameters as well as the bag file name Everything works if I set start:=0.0, however I have that some of the TF (e.g. the ones related to the world and the sensors attached to the trunk of my robot) are not published. An error message I see in the Grid plugin in rviz is: "For frame [world]: No transform to fixed frame [trunk]. TF error: [Could not find a connection between 'trunk' and 'world' because they are not part of the same tree.Tf has two or more unconnected trees."

It seems a synchronization issue. I set as suggested use_sim_time = true and rosbag play --clock.

Anybody as any idea?

My launch file is:

<arg name="bag_name" default="my_file.bag" />
<arg name="path" default="$(env PWD)/" />
<arg name="rate" default="1" />
<arg name="start" default="0.0" />

<param name="use_sim_time" value="true"/>
<!-- send myrobot urdf to param server and spawn it -->
<include file="$(find myrobot_description)/launch/upload.launch">

<!-- run rviz -->
<node name="rviz" pkg="rviz" type="rviz"/>
<!-- play -->
<node pkg="rosbag" type="play"  name="rosbag" required="true" args="--clock -r $(arg rate) -s $(arg start) $(arg path)$(arg bag_name)"/>
edit retag flag offensive close merge delete