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

Require help mapping using TurtleBot 2 and an RP-LiDAR A2

asked 2018-02-20 14:20:56 -0600

QuentinOschatz gravatar image


I am currently working on my first project with ROS. I have a TurtleBot 2 as well as an RP-LiDAR A2, and would like to start mapping with the LiDAR using gmapping (though I plan to switch to Google Cartographer later on). However, I am having some trouble accomplishing that.

The RP-LiDAR and the ROS driver ( seem to be working and posting sensor data to the "/scan" topic. When I attempt to start mapping, however, rviz shows the error (Fixed Frame [laser] does not exist). I read that I have to modify the robots urdf-file, however I have no idea how to even begin to attempt this, even after reading the ROS tutorial on URDF files and how to add a Hokuyo laser to the TurtleBot, but neither have really helped me understand what I need to do enough to allow me to fix this problem on my on.

I am quite new to ROS, and am in dire need of any hints/tips that might help me.

I am using ROS Kinetic on Ubuntu 16.04 LTS. If you require any additional information, please comment below and I will try my best to add it.

Thank you,
-Quentin Oschatz

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-15 04:36:43 -0600

updated 2018-03-15 05:10:08 -0600

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"/>

<link name="laser">

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 inertial tags and support for Gazebo integration. See for example these xacro macros for a Hokuyo LIDAR:

edit flag offensive delete link more


Thank you for the quick yet simple and effective solution! -Quentin Oschatz

QuentinOschatz gravatar image QuentinOschatz  ( 2018-03-15 05:09:03 -0600 )edit

Question Tools


Asked: 2018-02-20 14:20:56 -0600

Seen: 1,476 times

Last updated: Mar 15 '18