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

Revision history [back]

You need a connection of all involved frames. This can be achieved by properly adding the LIDAR to the URDF model. A very simple way of doing so would be adding this to your URDF:

<joint name="laser_joint" type="fixed">    
  <origin xyz="0.1 0 0.2" rpy="0 0 0" />     
  <parent link="base_link"/>
  <child link="laser"/>
</joint>

<link name="laser">
</link>

This adds a fixed joint to the laser link containing no visual, collision geometry or inertial information and should be all that is required to make things work for you. The robot_state_publisher reads the URDF on startup and then publishes the fixed joint tf transform automatically.

An alternative to editing the URDF is just running a static transform publisher:

rosrun tf static_transform_publisher 0.1 0.0 0.2 0.0 0.0 0.0 base_link laser 100

Note these two options are the quick and simple way, doing it "right" involved using xacro, proper geometry and intertial tags and support for Gazebo integration. See for example these xacro macros for a Hokuyo LIDAR:

You need a connection of all involved frames. This can be achieved by properly adding the LIDAR to the URDF model. A very simple way of doing so would be adding this to your URDF:

<joint name="laser_joint" type="fixed">    
  <origin xyz="0.1 0 0.2" rpy="0 0 0" />     
  <parent link="base_link"/>
  <child link="laser"/>
</joint>

<link name="laser">
</link>

This adds a fixed joint to the laser link containing no visual, collision geometry or inertial information and should be all that is required to make things work for you. The robot_state_publisher reads the URDF on startup and then publishes the fixed joint tf transform automatically.

An alternative to editing the URDF is just running a static transform publisher:

rosrun tf static_transform_publisher 0.1 0.0 0.2 0.0 0.0 0.0 base_link laser 100

Note these two options are the quick and simple way, doing it "right" involved using xacro, proper geometry and intertial inertial tags and support for Gazebo integration. See for example these xacro macros for a Hokuyo LIDAR: