User Manual
Copyright 2017 EAI All Rights Reserved 9 / 13
3.3 ROS Driver Installation
1) Cloning GitHub's YDlidar ROS Driver Package:
2) Build the Ydlidar_ROS_Driver software package:
3) Package environment Settings:
Note: Add permanent workspace environment variables. It will be very convenient if ROS
environment variables are automatically added to your bash session every time when start a new
shell:
4) Verify that the package path is set, echo the ROS_PACKAGE_PATH variable.
It can see something like this: /home/tony/ydlidar_ws/src:/opt/ros/melodic/share Create
5) Serial Port Alias [Optional]
Note: After completing the previous operation, re-insert the LIDAR again.
3.4 Run the ydlidar_ros_driver
Run ydlidar_ros_driver with startup file, as shown below:
$ git clone https://github.com/YDLIDAR/YDLidar-SDK.git
$ cd YDLidar-SDK/build
$ cmake ..
$ make
$ sudo make install
$ git clone https://github.com/YDLIDAR/ydlidar_ros_driver.git
ydlidar_ws/src/ydlidar_ros_driver
$ cd ydlidar_ws
$ catkin_make
$ source ./devel/setup.sh
$ echo "source ~/ydlidar_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
$ echo $ROS_PACKAGE_PATH
$ chmod 0777 src/ydlidar_ros_driver/startup/*
$ sudo sh src/ydlidar_ros_driver/startup/initenv.sh