Rosanswers logo

I have a Kobuki and installed Turtlebot software on my Turtlebot laptop and set everything up for Turtlebot, and I just got an RPLIDAR A2 yesterday and I couldn't figure out how to get it to work with Turtlebot Gmapping and AMCL, to navigate autonomously. On the remote computer the scan doesn't show up but the Kobuki's odometry shows up. I dont think there were any errors. In the launch file I deleted the line of code that starts the 3d camera, and I start the RPLIDAR node from another command line. But again, nothing! So please help me if you can. I am running Ubuntu 16.04 and ROS Kinetic on the Turtlebot Laptop and Ubuntu 14.04 ROS Indigo on the remote computer. Thanks!

Edit: I am now using hector_slam to do this. I have a pretty noisy map but I guess it could work, but now the question is how does the Turtlebot use the RPLIDAR A2 to navigate in the map generated by hector_slam? What parameters should I use in RVIZ? Is there a hector navigation file?

Edit 2: I could still use Gmapping, and obviously that would be SO much easier since I know how to do gmapping, but how do I implement it with an RPLIDAR A2? I will edit this again when I can get the error codes. Also, the errors happen when I run the rplidar node and then the turtlebot minimal node and then the gmapping node and I think it's because of a transform that I didn't put in the launch file.

Originally posted by RedstoneTaken on ROS Answers with karma: 3 on 2017-06-02

Post score: 0

Original comments

Comment by ufr3c_tjc on 2017-06-05:
Can you edit your question to include relevant code, as well as ROS version and OS info? When you say it "doesn't show up", what does this mean? Does the node not launch, or is there no messages being published?

Comment by aarontan on 2018-06-18:
have you figured this out?

Comment by lukewd on 2019-03-25:
Did y'all try the hokuyo tutorials, I think adding any lidar is similar process. I had luck doing an analogous ydlidar addition to my turtlebot.


1 Answer 1


Rosanswers logo

I was able to update my Turtlebot 2 (with Create 2 Base) to a 360 degree YDLidar to use for navigation.

I made a copy of the minimal.launch file in turtlebot launch folder, and renamed it. I added this to it:

<node name="ydlidar_node"  pkg="ydlidar"  type="ydlidar_node" output="screen">
<param name="port"         type="string" value="/dev/ydlidar"/>
<param name="baudrate"     type="int"    value="115200"/>
<param name="frame_id"     type="string" value="laser_frame"/>
<param name="angle_fixed"  type="bool"   value="true"/>
<param name="low_exposure"  type="bool"   value="false"/>
<param name="heartbeat"    type="bool"   value="false"/>
<param name="resolution_fixed"    type="bool"   value="true"/>
<param name="angle_min"    type="double" value="-180" />
<param name="angle_max"    type="double" value="180" />
<param name="range_min"    type="double" value="0.08" />
<param name="range_max"    type="double" value="16.0" />
<param name="ignore_array" type="string" value="" />
<param name="samp_rate"    type="int"    value="9"/>
<param name="frequency"    type="double" value="7"/>

<node pkg="tf" type="static_transform_publisher" name="base_link_to_laser4"
args="0.0 0.0 0.2 0.0 0.0 0.0 /base_footprint /laser_frame 40" />

I also added the ros-compatible ydlidar library to the src folder.

After a few tries I got it to work and could then map a room very quickly with 360 degree view instead of the limited range of the kinect.

If I recall, I used links like these to help me:

Originally posted by lukewd with karma: 116 on 2019-03-25

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.