Home

Awesome

YDLIDAR

YDLIDAR ROS2 PACKAGE V1.4.5

ROS2 node and test application for YDLIDAR

Visit EAI Website for more details about YDLIDAR.

How to install ROS2

ubuntu

windows

How to Create a ROS2 workspace

Create a workspace

How to build YDLIDAR ros2 package

1) Clone this project to your ament's workspace src folder 
2) Running ament to build ydlidar_node and ydlidar_client
3) Create the name "/dev/ydlidar" for YDLIDAR
--$ cd workspace/ydlidar_ros2/startup
--$ sudo chmod 777 ./*
--$ sudo sh initenv.sh

Note: Download and Build details here

How to run YDLIDAR ros2 package

1. Run YDLIDAR node and view using test application

$ros2 run ydlidar ydlidar_node

$ros2 run ydlidar ydlidar_client

Note: You should see YDLIDAR's scan result in the console

2.Run YDLIDAR node and view using test application by launch

$launch $(ros2 pkg prefix ydlidar)/share/ydlidar/launch/ydlidar.py

$ros2 run ydldiar ydlidar_client or ros2 topic echo /scan

or

$ros2 launch ydlidar ydlidar_launch.py

Dataset

LIDARModelBaudrateSampleRate(K)Range(m)Frequency(HZ)Intenstiy(bit)SingleChannelvoltage(V)
F4111520040.12~125~12falsefalse4.8~5.2
S4411520040.10~8.05~12 (PWM)falsefalse4.8~5.2
S4B4/1115360040.10~8.05~12(PWM)true(8)false4.8~5.2
S24/1211520030.10~8.04~8(PWM)falsetrue4.8~5.2
G452304009/8/40.28/0.26/0.1~165~12falsefalse4.8~5.2
X4612800050.12~105~12(PWM)falsefalse4.8~5.2
X2/X2L611520030.10~8.04~8(PWM)falsetrue4.8~5.2
G4PRO72304009/8/40.28/0.26/0.1~165~12falsefalse4.8~5.2
F4PRO82304004/60.12~125~12falsefalse4.8~5.2
R2923040050.12~165~12falsefalse4.8~5.2
G61351200018/16/80.28/0.26/0.1~255~12falsefalse4.8~5.2
G2A1423040050.12~125~12falsefalse4.8~5.2
G21523040050.28~165~12true(8)false4.8~5.2
G2C1611520040.1~125~12falsefalse4.8~5.2
G4B17512000100.12~165~12true(10)false4.8~5.2
G4C1811520040.1~125~12falsefalse4.8~5.2
G11923040090.28~165~12falsefalse4.8~5.2
TX8  10011520040.1~84~8(PWM)falsetrue4.8~5.2
TX20  10011520040.1~204~8(PWM)falsetrue4.8~5.2
TG15  10051200020/18/100.05~153~16falsefalse4.8~5.2
TG30  10151200020/18/100.05~303~16falsefalse4.8~5.2
TG50  10251200020/18/100.05~503~16falsefalse4.8~5.2

Note: PWM option speed control requires external PWM wave.

Configuration

path: ydlidar.yaml

ros2-interfaces

<center>
TopicTypeDescription
scansensor_msgs/LaserScan2D laser scan of the 0-angle ring
ParameterTypeDescription
portStringport of lidar (ex. /dev/ttyUSB0)
baudrateintbaudrate of lidar (ex. 230400)
frame_idStringTF frame of sensor, default: laser_frame
singleChannelboolWhether LiDAR is a single-channel, default: false
resolution_fixedboolFixed angluar resolution, default: true
auto_reconnectboolAutomatically reconnect the LiDAR, default: true
reversionboolReversion LiDAR, default: true
isToFLidarboolWhether LiDAR is TOF Type, default: false
angle_minfloatMinimum Valid Angle, defalut: -180.0
angle_maxfloatMaximum Valid Angle, defalut: 180.0
range_minfloatMinimum Valid range, defalut: 0.01m
range_maxfloatMaximum Valid range, defalut: 64.0m
ignore_arrayStringLiDAR filtering angle area, default: ""
samp_rateintsampling rate of lidar, default: 9
frequencyfloatscan frequency of lidar,default: 10.0
</center>

Parameters

port (string, default: /dev/ydlidar)

serial port name used in your system. 

baudrate (int, default: 230400)

serial port baud rate. 
LiDARbaudrate
F4/S2/X2/X2L/S4/TX8/TX20/G4C115200
X4128000
S4B153600
G1/G2/R2/G4/G4PRO/F4PRO230400
G6/TG15/TG30/TG50512000

frame_id (string, default: laser_frame)

frame ID for the device. 

singleChannel (bool, default: false)

indicated whether the LIDAR is single communication(S2) lidar.
LiDARsingleChannel
G1/G2/G4/G6/F4/F4PRO/S4/S4B/X4/R2/G4Cfalse
S2/X2/X2Ltrue
TG15/TG30/TG50false
TX8/TX20true

resolution_fixed (bool, default: true)

indicated whether the LIDAR has a fixed angular resolution. 

auto_reconnect (bool, default: true)

indicated whether the LIDAR auto reconnection. 

reversion (bool, default: false)

indicated whether the LIDAR data rotation 180°. 
LiDARreversion
G1/G2/G4/G6/F4/F4PRO//R2/G4C/TG15/TG30/TG50true
S2/X2/X2L/S4/S4B/X4/TX8/TX20false

isToFLidar (bool, default: false)

indicated whether the LIDAR is TOF(TX8) lidar. 
LiDARisToFLidar
G1/G2/G4/G6/F4/F4PRO/S4/S4B/X4/R2/G4C/S2/X2/X2Lfalse
TG15/TG30/TG50/TX8/TX20true

angle_min (double, default: -180)

Min valid angle (°) for LIDAR data. 

angle_max (double, default: 180)

Max valid angle (°) for LIDAR data. 

range_min (double, default: 0.08)

Min valid range (m) for LIDAR data. 

range_max (double, default: 32.0)

Max valid range (m) for LIDAR data. 

ignore_array (string, default: "")

Set the current angle range value to zero.

Note: ignore 10 to 20 and 50 to 80, ex: "10, 20, 50, 80" 

samp_rate (int, default: 9)

the LIDAR sampling frequency.
LiDARsamp_rate
G4/F44,8,9
F4PRO4,6
G68,16,18
G1/G2/R2/X45
S4/S4B/G4C/TX8/TX204
S23
TG15/TG30/TG5010,18,20

frequency (double, default: 10)

the LIDAR scanning frequency.

Note: Specific LiDAR paramter configuration, refer to Dataset

Upgrade Log

2020-02-08 version:1.4.5

1.Update SDK to 1.4.5

2.fixed ROS2 Dashing and Eloquent.

2019-12-23 version:1.4.4

1.support all standards lidar

2018-07-16 version:1.3.6

1.Update SDK verison to 1.3.9

2.remove imu sync.

2018-07-16 version:1.3.5

1.Update SDK verison to 1.3.6

2.add imu sync.

2018-04-16 version:1.3.1

1.Update SDK verison to 1.3.1

2.Increase sampling frequency,scan frequency setting.

3.Unified coordinate system.

4.Repair X4,S4 LIDAR cannot be opened.

5.Increased G4 G4C F4Pro LIDAR power-off protection.

6.Increased S4B LIDAR low optical power setting.

7.Fix the wait time for closing ros node.

8.Compensate for each laser point timestamp.

9.Unified profile, automatic correction lidar model.

6 Support

You can get support from YDLidar with the following methods:

Contact EAI

Development Path

If you have any extra questions, please feel free to contact us