User Manual

www.ydlidar.com Copyright 2015-2020 YDLIDAR
9
/ 11
Document Description
Download the latest ROS driver package for YDLIDAR TG on GitHub.
https://github.com/YDLIDAR/ydlidar_ros/tree/TG
Device Connection
Under Linux, the TG and PC interconnect processes are consistent with those 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 catkin_ws workspace and copy the ROS
driver package ydlidar_ros to the catkin_ws/src directory. Switch to the
catkin_ws workspace and compile again.
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace
$ cd ~/catkin_ws
$ catkin_make
(2) After the compilation is complete, add the catkin environment variable to the
~/.bashrc file and make it effective.
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
(3) Add a device alias /dev/ydlidar to the TG serial port.
$ cd ~/catkin_ws/src/ydlidar_ros/startup
$ sudo chmod +x initenv.sh
$ sudo sh initenv.sh
RVIZ Installation
1 Online installation.
$ 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 and reinstall it.
$ sudo apt-get update