"Because the official driver shouldn't crash just because you pulled the plug."
This is a heavily refactored, fault-tolerant ROS 2 driver for Slamtec RPLIDAR. Designed with a Lifecycle State Machine and Thread-Safe Architecture, ensuring your robot keeps running even under hardware disconnection or permission failures.
| Feature | Official Slamtec ROS 2 | This Driver (frozenreboot) |
|---|---|---|
| Hot-plug Recovery | ❌ Crash / Hang | ✅ Auto-reconnect via FSM |
| Permission Denied | ❌ Silent Fail / Garbage Data | ✅ Explicit Diagnostics |
| Dynamic Reconfigure | ❌ Restart Required | ✅ Runtime RPM/Mode Update |
| Zero-Copy Optimization | ❌ N/A | ✅ Smart Pointer & Move Semantics |
| Architecture | ❌ Tight SDK Coupling | ✅ Interface-based Abstraction |
I need your help to validate this driver on various robots! If you use this driver, please stress-test it (e.g., unplug USB while scanning, change RPM dynamically) and share your results.
Please open an issue with the title [Experiment] Your_Robot_Name and include:
- Lidar Model: (e.g., A1, A2, S1...)
- Recovery Log: (Copy paste the terminal output when you unplug/replug)
- Screenshot:
rqt_graphorrviz2
👉 Submit your Experiment Report Here
cd ~/ros2_ws/src
git clone https://github.com/frozenreboot/rplidar_ros2_driver.git
cd ..
# Install dependencies
sudo apt update
rosdep update
rosdep install --from-paths src --ignore-src -r -y
# Build the workspace
colcon build --symlink-installros2 launch rplidar_ros2_driver rplidar.launch.py serial_port:=/dev/ttyUSB0You can change the motor speed without killing the node:
ros2 param set /rplidar_node rpm 1000
ros2 param set /rplidar_node scan_mode DenseBoostThis driver uses a 3-Layer Design to decouple ROS 2 logic from the vendor SDK.
-
Node Layer: Handles Lifecycle & Parameters.
-
Wrapper Layer: Handles Threading & Mutex.
-
SDK Layer: Raw data fetching.
-
frozenreboot - Initial Refactoring & Architecture Design
-
Blog: Tech Log
Based on the original work by RoboPeak & Slamtec.
In compliance with the OSRF Policy on the Use of Generative AI in Contributions (Effective May 2025), I explicitly disclose the use of Generative AI tools in the development of this driver.
- Tools Used:
- Google Gemini / ChatGPT (LLMs): Used for generating boilerplate code, formatting documentation, and initial refactoring suggestions.
- Verification:
- All AI-generated content has been manually reviewed, tested, and verified by the maintainer.
- The logic, memory safety (C++17 standards), and ROS 2 lifecycle state transitions have been rigorously checked to ensure system stability.
- Note:
- Future contributions will strictly follow the
Generated-by:tag convention in commit messages as per the OSRF guidelines.
- Future contributions will strictly follow the
