User Manual
www.ydlidar.com Copyright 2015-2018 YDLIDAR Team
12 / 14
Device connection
Under Linux, the F4PRO and PC interconnection process is consistent with that under Windows. See
Device Connection under Window.
ROS Driver Installation
Before doing the following, make sure that the Kinetic version ROS environment is installed
correctly.
(1) Use the command to create the ydlidar_ws workspace and copy the ROS driver package
ydlidar in the F4PRO package to the ydlidar_ws/src directory, switch to the ydlidar_ws
workspace and recompile.
$ mkdir -p ~/ydlidar_ws/src
$ cd ~/ydlidar_ws
$ catkin_make
(2) After the compilation is complete, add the ydlidar environment variable to the ~/.bashrc file
and make it effective.
$ echo "source ~/ydlidar_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
(3) Add a device alias /dev/ydlidar to F4PRO's serial port.
$ cd ~/ydlidar_ws/src/ydlidar/startup
$ sudo chmod +x initenv.sh
$ sudo sh initenv.sh
RVIZ Installation
(1) Networking installation dependencies.
$ sudo apt-get install python-serial ros-kinetic-serial g++ vim \
ros-kinetic-turtlebot-rviz-launchers
(2) If there is a problem with the installation, update the source cache first and then reinstall it.
$ sudo apt-get update
RVIZCheck the scan results
Run the launch file and open rviz to see the F4PRO scan results, as shown in the following figure:
$ roslaunch ydlidar lidar_view.launch