Project for visualization of lidar data with a YDLIDAR X4 lidarsensor from YDLIDAR (www.ydlidar.com) and the pointcloudlibrary(https://pointclouds.org/) The X4 is a belt-driven 360° rangefinder. It has range frequency of 5K, and detection radius of 10m. The project is developed under Ubuntu 20.04.
Build Instruction:
Install:
The pcl lib is mandatory does not matter if you build YDLidar from source or use the prebuilt library. (If you are using a mac-computer keep in mind that there are some issues with pcl visualization on mac)
sudo apt install libpcl-dev
Option 1:
Build YDLidar from source
Get YLidar sdk frome them https://github.com/YDLIDAR/YDLidar-SDK
in YLidar folder:
mkdir build
cmake ..
make -j
sudo make install
In PCL_Lidarvisualization root CMakeLists.txt set(UseLidarInstall ON) In PCL_Lidarvisualization root folder:
mkdir build
cmake ..
make -j
Option 2: Use prebuilt static library (was built with Ubuntu 20.04) In PCL_Lidarvisualization CMakeLists.txt set "UseLidarInstall off"
mkdir build
cmake ..
make -j
sudo make install
Starting the Lidar Go to PCL_Lidarvisualization build folder and execute with root-privilegs (thats mandatory):
sudo ./LidarVisu
Baudrate: 128000
one-way communication: no
set scan frequency to 8 (others value in range are also working)
With PCLVISUALIZER:
With RANGE points which are nearer than others become more redish
With no visualization in main.cpp set visuMode_ to visualization::IVisualizationHandler::visuMode::NONE