Introduction
I have developed a method to use the Unitree L1 LiDAR without relying on rviz.(on ROS)
Repository
For detailed usage instructions, please refer to the README file in the repository published on GitHub.
Issue
When attempting to display LiDAR data without using rviz, executing run_without_rviz.launch
does not yield the same display as when using rviz. The following image is an example of this issue.
Modification
To solve this problem, I added unitree_lidar_ros_without_rviz.h
, which improved the display as shown in the image below.
In rviz, point clouds are visualized by retaining them for a certain period. In our improvement, multiple point clouds are retained at the stage of publishing, and then published together.
To increase the number of point clouds, modify the numbers on lines 192 and 193 of unitree_lidar_ros_without_rviz.h
. The relevant code is as follows:
if(cloudQueue_.size() > 10) {
while(cloudQueue_.size() > 10) {
cloudQueue_.pop_front();
}
}
Run
The Build process remains the same as before.
For Run, follow these steps:
- If using rviz:
source devel/setup.bash
roslaunch unitree_lidar_ros run.launch
- If not using rviz:
source devel/setup.bash
roslaunch unitree_lidar_ros run_without_rviz.launch.launch
Conclusion
This improvement is compatible with ROS but not with ROS2 or unitree_lidar_sdk. Please refer to the provided code for reference and make appropriate modifications.
You can view the code here: