RPLidar
These instructions are for an SLAMTEC RPLIDAR A1M8. This unit is used on the TurtleBot4 and can be added to the Unitree Go2.Architecture
The collision avoidance and path checking code pre-computes 9 different paths, 4 to the left, one straight ahead, 4 to the right, and one to the back. For each of the 9 possible paths, the code checks whether the path approaches any detected object to withinhalf_width_robot
. If not, the path is considered to be a valid choice and the motion system can execute that path.
Assumptions
The code assumes that any unpredictable barriers (e.g. humans crossing the path of the robot) will be avoided using separate code within theaction
driver, such as by issuing a “STOP” command when an object is detected in front of the robot.
Setup
Runrptest.py
(located in system_hw_test
) to determine the sensor_mounting_angle
and the angles_blanked
. These values depend on how you mounted the sensor and the radial position of any fixed obstructions, such as mounting brackets.
How to determine the sensor_mounting_angle and the angles_blanked
sensor_mounting_angle
: Thesensor_mounting_angle
refers to the angle between the LIDAR sensor’s scanning plane and the horizontal plane of your robot or platform. Thesensor_mounting_angle
can be read physically from the LIDAR. Refer to the following image for guidance:

angles_blanked
: Theangles_blanked
array can be used to prevent fixed obstructions in the field of view of the LIDAR from producing erroneous object avoidance messages.
Unitree RPLidar
Determine the serial port the sensor is using:TurtleBot4
By default, the TurtleBot4 is configured to use the RPLidar A1M8. You can verify this by running:OM742d35Cc6634
) and run:
Using the RPLidar A1M8 in OM1
Configure the.json5
as needed: