YDLIDAR X2 Lidar User Manual V1.3 (240124)
YDLIDAR X2 Lidar User Manual V1.3 (240124)
000202
YDLIDAR X2
USER MANUAL
www.ydlidar.com
Note: USB Adapter board has two USB TYPE C interface:USB_DATA, USB_PWR.
USB_DATA: Data powered 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.
Connect the adapter board with X2 first, then connect the USB cable to the USB port of the
adapter board and the PC. Note that the Type-C interface of the USB cable is connected to the
USB_DATA of the USB adapter board, and the X2 enters the idle mode after being powered on. The
motor does not rotate.
The drive current of USB interface of some development platforms or PC is not sufficient. X2
need to be connected to the auxiliary power supply of +5V, otherwise the lidar will be abnormal.
Development
Platform
5V Power
Supply
https://www.ydlidar.com/dowfile.html?id=97
http://cn.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
After unzip 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.
Double-click the exe file and follow the prompts to install it.
After the installation is complete, 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].
Copyright 2017 EAI All Rights Reserved 3 / 13
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 X2 and PC interconnection).
Before using the YDLIDAR software, make sure that the X2 USB adapter board serial port
driver is installed successfully, and interconnect the X2 with the USB port of the PC. Run the
evaluation software: LidarViewer.exe, select the corresponding serial port number and model
number. Meanwhile, users could choose language on the top right corner.
Choose one according to needs, move the mouse to the test position, right-click the pop-up
menu, and select [Lock Mouse Tracking].
To record lidar data, click to start recording, and click to stop recording.
2.3.5 Debug
Click [Tools] in the main menu, and then select [DebugON] to output the raw lidar data to the
"viewer_log.txt" and "viewer_log_err.txt" files.
Note: For more functions of LidarViewer, please click [Help], select [More Information], and learn more about
how to use it.
https://github.com/YDLIDAR/YDLidar-SDK
https://github.com/YDLIDAR/ydlidar_ros_driver
$ cd YDLidar-SDK/build
$ cmake ..
$ make
$ catkin_make
3) Package environment Settings:
$ source ./devel/setup.sh
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:
$ source ~/.bashrc
4) Verify that the package path is set, echo the ROS_PACKAGE_PATH variable.
$ echo $ROS_PACKAGE_PATH
It can see something like this: /home/tony/ydlidar_ws/src:/opt/ros/melodic/share Create
5) Serial Port Alias [Optional]
$ chmod 0777 src/ydlidar_ros_driver/startup/*
$ sudo sh src/ydlidar_ros_driver/startup/initenv.sh
Note: After completing the previous operation, re-insert the LIDAR again.
Note: Take G4 as an example by default, if use other types of lidar, need to change lidar.launch in
lidar_view.launch file to the corresponding **.launch file. (If X2 lidar is used, it needs to be changed to
X2.launch)
1) Switch to the directory where the corresponding [launch file] is located, edit the file, and its
content is as shown in the figure:
$ vim X2.launch
Note: For more information about the file contents, please refer to
https://github.com/YDLIDAR/ydlidar_ros_driver#configure-ydlidar_ros_driver-internal-parameter
2) The X2 lidar 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 endangle. The
specific scope needs to be modified according to actual use.
If you need to use it outdoors, please avoid the X2's vision system directly facing the sun, which
may cause permanent damage to the vision system's photosensitive chip, which will invalidate the
range finding.
The X2 standard version will cause interference in the distance measurement under the conditions
of strong sunlight reflection outdoors, please pay attention to it.