YDLidar User Manual
1.Ydlidar-SDK Installation
Before starting the installation, you need to confirm that your machine has built the most basic ROS environment
YDLidar SDK requires CMake 2.8.2+ as dependencies,you can install these packages using apt::
> sudo apt install cmake pkg-config
Run the following commands to create YDLidar SDK directory and build the project:
git clone https://github.com/YDLIDAR/YDLidar-SDK.git
mkdir -p ~/YDLidar-SDK/build
cd YDLidar-SDK/build
cmake ..
make
sudo make install
Normally, your terminal will display the following message:
After compiling, you need to package the project:
cd ~/YDLidar-SDK/build
cpack # you may use sudo cpack for permission
Then, you can check whether the YDLidar-SDK is successfully installed by using the provided examples.
Running the tri_test
if connect with the LiDAR unit(s):
cd ~/YDLidar-SDK/build
./tri_test
If everything is working properly, your terminal will display the following message:
Once you have set the parameters, YDLidar will start working and will print out the following message via the terminal.
At this point, the YDLidar-SDK has been successfully installed.
2.YDLidar ROS Driver Package Installation
Before installing, please make sure you have ROS installed.
First, you need to create a workspace where the package will be stored :
mkdir -p ~/ydlidar_ws/src
cd ~/ydlidar_ws/src
catkin_init_workspace
Clone ydlidar_ros_driver package for github and build the package :
git clone https://github.com/YDLIDAR/ydlidar_ros_driver.git
cd ydlidar_ws
catkin_make
Package environment setup :
echo "source ~/ydlidar_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
Note: Add permanent workspace environment variables. It's convenientif the ROS environment variables are automatically added to your bash session every time a new shell is launched.
At this point, you have finished installing the YDLidar-SDK and the YDLidar-ROS driver package, and next we will describe how to use the ROS driver package.
Note: After completing the previous operation, replug the LiDAR again.
Connect the LiDAR uint(s).
roslaunch ydlidar_ros_driver lidar_view.launch
If everything is working properly, you should see ydlidar's scan result in the rviz.
If your rviz does not show normal results, you may have encountered an unknown error during the installation process and need to re-run the commands in the previous steps.