SLAM Lidar ROS2

Note: This section supports the following lidar models: A1/A2/A3/S1/S2; The baud rates are different between A1/A2<115200>, A3/S1<256000> and S2<1000000>

ROS 2 official website:https://docs.ros.org/

Lidar ROS2:https://www.slamtec.com/cn/Support#rplidar-a-series

Lidar official website:http://www.slamtec.com/cn/Support

Device : PC;A1M8

Environment :Ubuntu18.04;ROS2(eloquent)

New Workspace

When the lidar is used, it is necessary to enter the workspace each time the command is executed

Decompress the [silanlidar_ros2.zip] function package and put it in the src folder of your workspace. Open the terminal in the workspace

Note: Every time a new terminal is opened, it needs to [update the environment]. Every time the code in the function pack is changed, it needs to [re-compile] and then update the environment.

1、Remap the USB serial port

To perform this step, run the installation USB port remapping command in the scripts folder of the sllidar_ros2 function package

Use the following command to view the modified remapping

0001

2、Terminal test

Step one, activate the corresponding lidar

Second, start the test application

You should see the rPLidar scan results in the console

0002

3、rviz2 Visual test

You should see the lidar scan results in rviz2

0003

Note: the [Fixed Frame] coordinate system and [LaserScan] topics should be consistent with those published.

4、gmapping Build diagram test

Step one, activate the corresponding lidar

Second, start gmapping

You should see the result in rviz2

0004

Note: [Fixed Frame] coordinate system, [LaserScan] topic, [map] topic should be the same as published.