The repository includes a GitHub Actions workflow that automatically deploys built Docker images to the husarion/rplidar-docker Docker Hub repositories. This process is based on a fork of the fork of Slamtec/sllidar_ros2repository.
- Plugin the Device
You can use lsusb
command to check if the device is visible.
-
Clone the Repository
git clone https://github.com/husarion/rplidar-docker.git cd rplidar-docker/demo
-
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 / A3 / S1 256000
RPlidar S2 / S3 1000000
-
Activate the Device
docker compose up rplidar
-
Launch Visualization
xhost local:root docker compose up rviz
Note
To use the latest version of the image, run the docker compose pull
command.
Inside the image there is a custom /husarion_utils/astra.launch.py
that is not the part of the ROS 2 package for Astra camera. It was added for easy integration with Husarion robots. This launch file contains following parameters:
Parameter | Description | Default Value |
---|---|---|
launch_file |
Name of launch file from repo sllidar_ros2 to run |
sllidar_launch.py |
serial_baudrate |
Baudrate of connected lidar (depend on your RPlidar model) | 115200 |
serial_port |
USB port of connected lidar | /dev/ttyUSB0 |
robot_namespace |
Namespace which will appear in front of all topics (including /tf and /tf_static ). |
env("ROBOT_NAMESPACE") ("" if not specified) |
device_namespace |
Sensor namespace that will appear before all non absolute topics and TF frames, used for distinguishing multiple cameras on the same robot. | "" |
Using both device_namespace
and robot_namespace
makes:
- Topic:
/<robot_namespace>/<device_namespace>/<default_topic>
- Topic TF:
/<robot_namesace>/tf
- URDF Link:
<device_namespace>_link
(default:laser
)
If any of the namespaces are missing, the field with /
is omitted for topics, or replaced with default ones for URDF link.