Unitree LiDAR Setup Manual
Unitree LiDAR Setup Manual
Introduction
This guide provides step-by-step instructions to set up and use the Unitree LiDAR system on
Ubuntu 20.04 with ROS Noetic. It includes details on installation, configuration,
visualization using RViz, and troubleshooting. By the end, you’ll have a fully functioning
LiDAR system capable of capturing and analyzing point cloud data.
Prerequisites
Hardware Requirements
Software Requirements
• ROS Noetic.
• Basic understanding of Linux commands and ROS concepts.
Step-by-Step Instructions
1. Install ROS Noetic
ROS Noetic is essential for working with the Unitree LiDAR in Ubuntu 20.04. Follow these
steps to install it:
Initialize rosdep
Install useful tools for handling point clouds and other features:
cd ~/unitree_lidar_sdk/unitree_lidar_sdk
mkdir build
cd build
cmake ..
make -j$(nproc)
cd ~/unitree_lidar_sdk/unitree_lidar_ros
catkin_make
cd ~/unitree_lidar_sdk/unitree_lidar_ros/config
nano config.yaml
ls /dev/ttyUSB*
Add your user to the dialout group for serial port access:
Log out and log back in for the changes to take effect.
Open RViz
rviz
Set Up Visualization
Configure Displays
Use Tools
Save Configurations
1. Prerequisites
bash
Copy code
sudo apt-get install ros-noetic-pcl-ros pcl-tools
You can capture point cloud data using the rosbag tool or save it directly in .pcd format.
• Option 1: Using rosbag To record the point cloud data being published on the
/unilidar/cloud topic:
bash
Copy code
rosbag record /unilidar/cloud
This will create a .bag file in your working directory containing the recorded data.
• Option 2: Saving in PCD Format Use the pointcloud_to_pcd node to save the
point cloud data directly in .pcd format:
bash
Copy code
rosrun pcl_ros pointcloud_to_pcd input:=/unilidar/cloud
_prefix:=/home/$USER/pointcloud_
The .pcd files will be saved in /home/$USER/ with the prefix pointcloud_.
Once you have the .pcd files, you can convert them to .ply format using either a command-
line tool or a Python script.
bash
Copy code
pcl_pcd2ply input.pcd output.ply
bash
Copy code
pip install open3d
python
Copy code
import open3d as o3d
# Save as .ply
o3d.io.write_point_cloud("output.ply", pcd)
Replace "input.pcd" with the path to your .pcd file and "output.ply" with the
desired output file name.
python
Copy code
import rospy
from sensor_msgs.msg import PointCloud2
import open3d as o3d
import sensor_msgs.point_cloud2 as pc2
def callback(msg):
# Convert ROS PointCloud2 message to a numpy array
points = list(pc2.read_points(msg, field_names=("x", "y", "z"),
skip_nans=True))
rospy.init_node('ply_saver')
rospy.Subscriber('/unilidar/cloud', PointCloud2, callback)
rospy.spin()
Additional Notes
• .ply files are widely supported and can be opened in 3D visualization tools such as
MeshLab, Blender, or Open3D.
• Ensure to manage file sizes as .ply files can grow large depending on the density of
the point cloud.
This section should seamlessly integrate into your existing document. Let me know if you
need further modifications!
Troubleshooting
Permission Denied for Serial Port
• Error Message:
• Fix:
1. Ensure the correct port (/dev/ttyUSB0) is specified.
2. Add your user to the dialout group:
bash
Copy code
sudo chmod 666 /dev/ttyUSB0
No Data in /unilidar/cloud
• Fix:
1. Verify the topic is active:
rostopic list
2. Inspect the topic:
• Fix:
1. Check serial port permissions.
2. Ensure no other processes are using /dev/ttyUSB0:
Conclusion
This comprehensive manual ensures you can set up and use the Unitree LiDAR with ROS
Noetic, visualize data in RViz, and store it for later analysis. Enjoy exploring your
environment with the power of LiDAR!