← Back to Docs

LiDAR Operations

Launch the RPLIDAR driver, verify scan data and perform diagnostics and calibration.
1

Launch the LiDAR node

Start the RPLIDAR driver and publish LaserScan data.

Follow these steps to start the RPLIDAR sensor, which publishes sensor_msgs/msg/LaserScan messages on the /scan topic.

bash
cd ~/repos/common_platform/common_platform_ws
source install/setup.bash
ros2 launch sensors rplidar.launch.py
2

Verify LiDAR topics

Check that the LiDAR node is publishing data on the expected topics.

After launching the LiDAR driver you should ensure that the expected topics are active and messages are flowing. The following commands display LaserScan messages and report message frequency.

bash
ros2 topic echo /${ROS_NAME}/scan
bash
ros2 topic hz /${ROS_NAME}/scan
bash
ros2 topic list
3

Diagnose and calibrate the LiDAR

Perform hardware checks, run the standalone node and control the motor.

If the LiDAR isn’t publishing data as expected, run these diagnostics. They help verify USB connectivity, access the device directly, and control the sensor’s motor via services.

bash
lsusb | grep -i lidar
bash
ls /dev/tty*

If the driver cannot connect via the rplidar.launch.py file, try running the node directly with an explicit serial port:

bash
ros2 run rplidar_ros rplidar_node --ros-args -p serial_port:=/dev/ttyUSB0
bash
ros2 service call /${ROS_NAME}/stop_motor std_srvs/srv/Empty "{}"
bash
ros2 service call /${ROS_NAME}/start_motor std_srvs/srv/Empty "{}"

To adjust scanning parameters like range_min, range_max or scan_time, edit the rplidar.launch.py or pass parameters via --ros-args -p. Refer to the driver documentation for recommended values.

Subscribe to our newsletter

The latest educational robotics news and articles, sent to your inbox weekly.