Slamtec / rplidar_ros

BSD 2-Clause "Simplified" License
485 stars 527 forks source link

How to configure RPLidar S3 to publish measurements at 20Hz? #150

Open wette opened 6 months ago

wette commented 6 months ago

I am on the ros2 branch, running the RPLidar S3 with rplidar_ros on ros2 iron.

Everything seems to be fine. However, LaserScan messages are only published at 10Hz. According to the data sheet, the S3 is capable of publishing at 20Hz.

How to configure rplidar_ros, to publish at 20Hz?

I already tried to pass the parameter 'scan_frequency': 20.0 and 'scan_mode': "Standard" to the rplidar_node in the launch file.

On stdout, the rod node actually tells to publish at 20Hz: [rplidar_node-1] [INFO] [1704789672.831671430] [rplidar_node]: current scan mode: Standard, sample rate: 16 Khz, max_distance: 16.0 m, scan frequency:20.0 Hz, however, the rod LaserScan messages only come at 10Hz:

# ros2 topic hz /scan
average rate: 10.015
    min: 0.099s max: 0.101s std dev: 0.00056s window: 12
average rate: 10.012
    min: 0.099s max: 0.101s std dev: 0.00051s window: 23
average rate: 10.013
    min: 0.099s max: 0.101s std dev: 0.00053s window: 34
average rate: 10.006
    min: 0.099s max: 0.101s std dev: 0.00053s window: 44
average rate: 10.008

How to increase to 20Hz?