Why is robot_state_publisher not publishing correct tf transforms?
I am trying to use the robot_state_publisher to publish transforms between my links.
My launch file is:
<?xml version="1.0"?>
<launch>
<arg name="model" />
<arg name="gui" default="False" />
<param name="use_gui" value="$(arg gui)" />
<param name="robot_description" textfile="$(find robot_description)/urdf/ROSYZ01SS.urdf" />
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" >
<param name="publish_frequency" type="double" value="20" />
<param name="use_tf_static" type="bool" value="false" />
</node>
</launch>
And my URDF file has multiple links, similar to this:
<?xml version="1.0"?>
<robot name="smartcar">
<link name="base_link">
<!--link name="base_footprint"-->
<visual>
<geometry>
<cylinder length="0.35" radius="0.17"/>
</geometry>
<origin xyz="0 0 .21" rpy="0 0 0" />
<material name="blue">
<color rgba="0 1 .8 0.5"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.35" radius="0.17"/>
</geometry>
<origin xyz="0 0 .21" rpy="0 0 0" />
</collision>
</link>
<link name="laser">
<visual>
<geometry>
<cylinder length="0.04" radius="0.035"/>
</geometry>
<material name="white">
<color rgba="1 .5 .5 1"/>
</material>
<origin xyz="0 0 0.22" rpy="0 0 0" />
</visual>
<collision>
<geometry>
<cylinder length="0.04" radius="0.035"/>
</geometry>
<origin xyz="0 0 0.22" rpy="0 0 0" />
</collision>
</link>
<joint name="bb" type="fixed">
<parent link="base_link"/>
<child link="laser"/>
</joint>
</robot>
My tf tree looks OK, but the published transforms themselves are not. All of the transforms look like this:
header:
seq: 0
stamp:
secs: 1616605801
nsecs: 778988702
frame_id: "base_link"
child_frame_id: "laser"
transform:
translation:
x: 0.0
y: 0.0
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
Is there something I am doing wrong? Why are the transforms publishing, but appear to be incorrect?
Your URDF shows two links connected by a joint with no transform, so the output looks correct. What were you expecting?