This repository includes the ROS Driver for Pandar128 LiDAR sensor manufactured by Hesai Technology.Support UDP protocol version number is 1.3.
$ sudo apt-get update
$ sudo apt install libpcl-dev libpcap-dev libyaml-cpp-dev python-catkin-tools
http://wiki.ros.org/ROS/Installation
- Create ROS Workspace. i.e.
rosworkspace
. Please note that "Workspace" is defined by your own, but subfolder "src" is required and cannot be renamed
$ mkdir -p rosworkspace/src
$ cd rosworkspace/src
- Clone recursively this repository in the current path
- Install required dependencies with the help of
rosdep
$ cd ..
$ rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
- Compile
$ catkin_make -DCMAKE_BUILD_TYPE=Release
$ cd src/ROS_P128/pandar_pointcloud/launch
open Pandar128_points.launch to set configuration parameters
Reciving data from connected LiDAR: config LiDAR IP address & UDP port, and leave the pcap_file empty
Parameter | Default Value |
---|---|
device_ip | 192.168.1.201 |
port | 2368 |
pcap_file |
Data source will be read from connected LiDAR when "pcap_file" is set to empty
Parameter | Value |
---|---|
pcap | pcap file path |
Data source will be read from pcap file instead of LiDAR once "pcap_file" not empty
Set UDP buffer default size
$sudo sysctl -w net.core.rmem_default=26214400
Enter super user mode
$sudo -s
- While in the
rosworkspace
directory.
$ source devel/setup.bash
$ roslaunch pandar_pointcloud Pandar128_points.launch
- The driver will publish a PointCloud2 message in the topic.
/pandar_points
-
Open Rviz and add display by topic.
-
Change fixed frame to "Pandar128" to view published point clouds.
- While in the
rosworkspace
directory.
$ source devel/setup.bash
$ roslaunch pandar_pointcloud Pandar128_points.launch
- The driver will publish a raw data packet message in the topic.
/pandar_packets
- record raw data rosbag
$rosbag record -b 4096 /pandar_packets
-
stop roslaunch and rosbag record by "Ctrl + C"
-
play raw data rosbag
$rosbag play <rosbagfiel>
- launch transform_nodelet.launch
$ roslaunch pandar_pointcloud transform_nodelet.launch data_type:=rosbag
- Open Rviz and add display by topic.
- Change fixed frame to "Pandar128" to view published point clouds.