Operate RPLidar A3 using ROS
RPLidar A3 is an omni-directional laser range scanner having a range of 25m radius developed by SLAMTEC. RPLidar has two modes of operation : Outdoor (20m range) and Enhanced mode (25 m range).
Luckily for Robot enthusiasts, SLAMTAC has provided an open-source ROS package that can be installed easily:
Clone this package to ROS catkin workspace src folder. For example, if your workspace name is catkin_ws then enter:
cd catkin_ws/src
git clone https://github.com/Slamtec/rplidar_ros
cd ..
Now source your workspace setup.bash file and build the packages:
source ~/catkin_ws/devel/setup.bash
catkin_make
Now connect the RPLIDAR A3 to your computer using USB connection.
Also, make sure that the proper baud rate is selected.
Confirm connectivity, the output must show the highlighted device.
Now, run the view_rplidar_a3.launch file using following command:
roslaunch rplidar_ros view_rplidar_a3.launch
As soon as you run this command, logs will show up on your terminal and the lidar will start spinning.
An RViz panel will also launch showing the output of the Lidar. The output below shows the red colored boundary of the indoor environment with obstacles as well.
You can also see the raw lidar data by echoing the /scan topic by running:
rostopic echo /scan
RPLidar A3 can be used for gmapping and SLAM applications, all we need to do is provide the /scan topic that is published using this package and subscribe it to the mapping package file.
Bibliography: