SLAMTEC - RPlidar Series
The RPlidar series from SLAMTEC is a compact distance measurement device using ToF (Time of Flight) technology. The devices are mainly used for long-range analyzes and allow the collection of information in a 360° horizontal plane. Thanks to their compactness, precision and low price, devices from this series can often be found in many robotics projects.
Getting started
To run the device, you must meet certain requirements listed below:
Software
Hardware
- Connectivity: Serial Port/USB 2.0/Ethernet *
Demo
In this demo, we'll walk you through using the RPlidar devices with ROS 2 via a Docker image. You'll also learn how to visualize data, including laser scan, using RViz. Demo based on rplidar_ros repository.
ROSbot 2R / ROSbot 2 PRO and the RPlidar A2M12 lidar.
Start guide
1. Plugin the device
For optimal performance, please connect the device using the appropriate communication medium based on the lidar model.
2. Clone repository
git clone --branch ros2 https://github.com/husarion/rplidar-docker
cd rplidar-docker/demo
3. Select the appropriate baudrate
export RPLIDAR_BAUDRATE=<baudrate>
Replace <baudrate>
with appropriate baudrate for your LiDAR from below table.
Product Name | Baudrate |
---|---|
RPlidar A2M8 | 115200 |
RPlidar A2M12 | 256000 |
RPlidar A3 | 256000 |
RPlidar S1 | 256000 |
RPlidar S2 | 1000000 |
RPlidar S3 | 1000000 |
4. Run compose.yaml
docker compose -f compose.rplidar.yaml up
xhost local:root
docker compose -f compose.rviz.yaml up
Result
The Laser Scan topic should appear in the RViz2 tool.
ROS API
The full API of the robot can be found in the official documentation of the device.
Summary
RPlidar is a relatively small and cheap device that allows you to collect information about objects around you, which makes it an extremely useful device when mapping and navigating a robot. After completing this tutorial, you can easily integrate the LiDAR with your robot using Docker.
Do you need any support with completing this project or have any difficulties with software or hardware? Feel free to describe your thoughts on our community forum: https://community.husarion.com/ or to contact with our support: support@husarion.com