EAI YDLIDAR X2 User manual

www.ydlidar.com Copyright 2015-2020 YDLIDAR
2/11
CONTENTS
DEVELOPMENT KIT........................................................................................................................... 3
YDLIDAR X2/X4............................................................................................................................ 3
YDLIDAR G2/G4/G6..................................................................................................................... 3
WINDOWS USAGE GUIDE....................................................................................................................4
Device connection....................................................................................................................... 4
Driver Installation........................................................................................................................ 5
LINUX ROS OPERATION....................................................................................................................... 7
Device connection....................................................................................................................... 7
YDLidar-SDK Installation..............................................................................................................7
ROS Driver Installation................................................................................................................ 8
RVIZ installation...........................................................................................................................8
Run ROS Package......................................................................................................................... 9
RVIZ results.................................................................................................................................. 9
Modify Angle Problem................................................................................................................ 9
USE CAUTION.....................................................................................................................................11
Temperature.............................................................................................................................. 11
Ambient lighting........................................................................................................................ 11
Power demand.......................................................................................................................... 11

www.ydlidar.com Copyright 2015-2020 YDLIDAR
3/11
DEVELOPMENT KIT
The development kit of YDLIDAR is an accessory tool provided for performance evaluation and
early development of the sensors.
YDLIDAR X2/X4
YDLIDAR X2/X4
USB Micro cable
USB Adapter
board
PH2.0-8P
YDLIDAR G2/G4/G6
G2/G4/G6 Lidar
USB Type-C cable
USB Adapter board

www.ydlidar.com Copyright 2015-2020 YDLIDAR
4/11
CHART 1 YDLIDAR DEVELOPMENT KIT DESCRIPTION
Nobmxvm
WINDOWS USAGE GUIDE
Device connection
When evaluating and developing Lidar under windows, you need to interconnect Lidar and PC.
The specific process is as follows:
FIG 1 YDLIDAR X2/X4
Item
Qty
Description
Lidar
1
Standard version
USB cable
1
Use with USB adapter board to connect Lidar and PC.
It is both a power supply line and a data line.
USB adapter board
1
This component is used for USB to UART functions.
Also supports the serial port DTR signal to the Lidar motor stop control.
PWR is provided for auxiliary power supply.
PH2.0-8P cable
1
This component meets the user's development needs in a multi-platform
environment.
Note: USB adapter board has two USB Type-C interfaces: USB_DATA, USB_PWR.
USB_DATA: Data-powered multiplex interface. In most cases, this interface can be used to meet power and
communication requirements.
USB_PWR: Auxiliary power supply interface. The USB interface of some development platforms has weak
current drive capability. At this time, auxiliary power supply can be used.

www.ydlidar.com Copyright 2015-2020 YDLIDAR
5/11
FIG 2 YDLIDAR G2/G4/G6
Connect the adapter board and Lidar first, and then connect the USB cable to the USB port on the
adapter board and the PC. Note that the USB cable is connected to the USB adapter's USB_DATA.
After the Lidar is powered on, it is in idle mode and the motor does not rotate.
The drive current of the USB interface of some development platforms or PCs is weak, and the
Lidar needs to access the +5V auxiliary power supply, otherwise it will work abnormally.
FIG 3 AUXILIARY POWER SUPPLY
Driver Installation
To evaluate and develop the YDLIDAR under Windows, you need to install the serial port driver of
the USB adapter board. The USB adapter board of this kit adopts CP2102 chip to realize serial
port (UART) to USB signal conversion. Its driver can be downloaded from our official website or
downloaded from the official website of Silicon Labs:
http://ydlidar.com/
http://cn.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

www.ydlidar.com Copyright 2015-2020 YDLIDAR
6/11
After extracting the driver package, run the CP2102's Windows driver installation file (exe file
under CP210x_VCP_Windows). Please select the 32-bit version (x86) or 64-bit version (x64)
installation program according to the version of the windows operating system.
FIG 4 YDLIDAR DRIVER VERSION SELECTION
Double-click the exe file and follow the prompts to install it:
FIG 5 YDLIDAR DRIVER INSTALLATION I
After the installation is complete, you can right-click on My Computer and select Properties. On
the Open System screen, select Device Manager from the left menu to access the Device
Manager.
Expand [Port] to see the serial port name corresponding to the identified USB adapter, that is, the
driver installation is successful. The following figure shows COM3. (Note that the port must be
checked in case of Lidar and PC interconnection).
FIG 6 YDLIDAR DRIVER INSTALLATION II

www.ydlidar.com Copyright 2015-2020 YDLIDAR
7/11
LINUX ROS OPERATION
This article only uses Ubuntu 16.04, Kinetic version ROS as an example.
SDK driver address:
https://github.com/YDLIDAR/YDLidar-SDK;
ROS driver address:
https://github.com/YDLIDAR/ydlidar_ros_driver;
ydlidar_ros_driver depends on YDLidar-SDK library, If you have never installed YDLidar-SDK or it is
out of date, you must first install YDLidar-SDK.
Device connection
Under Linux, Lidar and PC interconnect processes are consistent with those under Windows. See
Device Connection under Window.
YDLidar-SDK Installation
Before doing the following, make sure that the git and cmake is installed correctly.
1.Download or Clone the YDLIdar-SDK repository on GitHub.
2.Compile and Install the YDLidar-SDK.
Note
:
Users can also choose Type-C on G2/G4/G6 to get started quickly. Connect the PC and G2/G4/G6
directly with Type-C data cable and download the vcp serial port driver of G6 on the www.ydlidar.com.
After that, start the PCV to scan the map and observe the data.
$git clone https://github.com/YDLIDAR/YDLidar-SDK
$ cd YDLidar-SDK/build
$ cmake ..
$ make
$ sudo make install

www.ydlidar.com Copyright 2015-2020 YDLIDAR
8/11
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_ros_driver in the YDLIDAR package to the ydlidar_ws/src directory. Switch to the
ydlidar_ws workspace and compile again.
2. After the compilation is complete, add the ydlidar_ws environment variable to the ~/.bashrc
file and make it effective.
3. Add a device alias /dev/ydlidar to the YDLIDAR serial port.
RVIZ installation
1. Online installation
2. If something went wrong, update the source cache and re-install it.
$ mkdir -p ~/ydlidar_ws/src
$ cd ~/ydlidar_ws
$ catkin_make
$ echo "source ~/ydlidar_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
$ cd ~/ydlidar_ws/src/ydlidar_ros_driver/startup
$ sudo chmod +x initenv.sh
$ sudo sh initenv.sh
$ sudo apt-get install python-serial ros-kinetic-serial g++ vim \
ros-kinetic-turtlebot-rviz-launchers
$ sudo apt-get update

www.ydlidar.com Copyright 2015-2020 YDLIDAR
9/11
Run ROS Package
Run the corresponding launch file according to the lidar model, The command format is:
Examples of use are as follows:
a) X2 Lidar
b) X4 Lidar
c) G2 Lidar
d) G4/G5 Lidar
RVIZ results
After running the launch file, open rviz to view the YDLIDAR scan results, as shown in the
following figure:
FIG 8 YDLIDAR RVIZ
Modify Angle Problem
The scanning data seen by running the launch file is displayed by default with 360- degree data.
$ roslaunch ydlidar_ros_driver X2.launch
$roslaunch ydlidar_ros_driver [launch file]
$ roslaunch ydlidar_ros_driver lidar.launch
$ roslaunch ydlidar_ros_driver G2.launch
$ roslaunch ydlidar_ros_driver X4.launch

www.ydlidar.com Copyright 2015-2020 YDLIDAR
10/11
To modify the display range, you need to modify the configuration parameters in the launch file.
The specific operation is as follows:
1. Go to launch directory and use vim to edit launch file of the corresponding Lidar model(take
X4 as an example). The contents are as shown in the figure:
FIG 9 YDLIDAR.LAUNCH FILE
2. YDLIDAR coordinates follow the right-hand rule within ROS, with an angle range of [-180, 180].
"angle_min" is the start angle, and "angle_max" is the end angle.
The specific scope needs to be modified according to actual use.
FIG 10 YDLIDAR COORDINATES DEFINITION
$ roscd ydlidar_ros_driver/launch
$ vim X4.launch

www.ydlidar.com Copyright 2015-2020 YDLIDAR
11/11
USE CAUTION
Temperature
When the working environment temperature of YDLIDAR is too high or too low, it will affect the
accuracy of the distance measuring system. It may also damage the structure of the scanning
system and reduce the life of the YD lidar. Avoid use in high temperature (>40 degrees Celsius)
and low temperature (<0 degrees Celsius) conditions.
Ambient lighting
The ideal working environment for the Lidar is indoor, indoor lighting (including no light) will not
affect it work. Don’t using a strong light source (such as a high-power laser) to directly illuminate
the lidar's vision system.
If you need to use it outdoors, please avoid that the its vision system is directly facing the sun.
This may cause permanent damage to the vision system's sensor chip, thus invalidating the
distance measurement.
Please note that the Lidar standard version is subject to interference in outdoor strong sunlight
reflection environments.
Power demand
During the development process, since the drive current of the USB interface of each platform or
the USB interface of the computer may be too low to drive the YDLIDAR, the external power
supply of the +5V to the YDLIDAR needs to be provided through the USB_PWR interface of the
USB interface board. It is not recommended to use a mobile phone power bank because the
voltage ripple of some brands of power banks is too large.
This manual suits for next models
4
Table of contents
Popular Microcontroller manuals by other brands

NXP Semiconductors
NXP Semiconductors UM11733 user manual

Atmel
Atmel SAM HA1G16A Xplained Pro user guide

Roobo
Roobo DDKC7Q1 user guide

Hitachi
Hitachi H8S/2633 F-ZTAT Hardware manual

onsemi
onsemi RSL10 Series Getting started guide

NXP Semiconductors
NXP Semiconductors S12 MagniV MC9S12ZVML128 quick start guide