ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You error comes from your second launch file :
<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 0 0 0 0 base_link laser_1 100" />
<node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0 0 0 0 0 0 0 hokuyo_2 laser_2 100" />
Here you specify as arguments 7
zeros meaning you define the position and orientation using 3 postion coordiantes and a quaternion : {x; y; z; q_x; q_y; q_z; q_w}
. The problem is that a default quaternion is not 4 zeros but the field q_w
has to be set to 1
. (Here is an online visualizer for quaternions that I find really useful).
So you have two options :
Propperly initialize your two quaternions :
<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 0 0 0 1 base_link laser_1 100" />
<node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0 0 0 0 0 0 1 hokuyo_2 laser_2 100" />
Change the argument and use roll, pitch and yaw instead of a quaternion arguments are then {x; y; z; roll; pitch; yaw}
:
<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 0 0 0 base_link laser_1 100" />
<node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0 0 0 0 0 0 hokuyo_2 laser_2 100" />