YDLidar_Apollo_Driver can convert YDLIDAR LiDAR's raw data to LidarScan and standard format of point cloud, and write to point cloud channels.
Each LiDAR corresponds to a lidar scan channel.
channel: /apollo/sensor/ydlidar/front/center/LidarScan
type: apollo::drivers::ydlidar::LidarScan
proto: [modules/drivers/ydlidar/proto/ydlidar.proto]https://github.com/YDLIDAR/ydlidar_apollo_driver/blob/master/modules/drivers/ydlidar/proto/ydlidar.proto
Each LiDAR corresponds to a point cloud channel.
channel: /apollo/sensor/ydlidar/front/center/PointCloud
type: apollo::drivers::PointCloud
proto: [modules/drivers/proto/pointcloud.proto]https://github.com/ApolloAuto/apollo/blob/master/modules/drivers/proto/pointcloud.proto
frame_id: "ydlidar_horizon_front_center"
scan_channel: "/apollo/sensor/ydlidar/front/center/LidarScan"
pc_channel: "/apollo/sensor/ydlidar/front/center/PointCloud"
port: "/dev/ydlidar"
ignore_array: ""
baudrate: 512000
lidar_type: 0
device_type: 0
sample_rate: 20
abnormal_check_count: 4
resolution_fixed: false
reversion: true
inverted: true
auto_reconnect: true
isSingleChannel: false
intensity: false
support_motor_dtr: false
max_angle: 180.0
min_angle: -180.0
max_range: 64.0
min_range: 0.01
frequency: 10.0
scan_channelrepresents LiDAR's lidar scan output channel.pc_channelrepresents LiDAR's point cloud output channel.portrepresents LiDAR's serial port or network ip address.ignore_arrayrepresents the culling angle range of lidar, separated by commas.baudraterepresents LiDAR's baudrate or network port.lidar_typerepresents LiDAR's Type, it can be configured to: (1) TYPE_TOF(0).(2) TYPE_TRIANGLE(1). (3) TYPE_TOF_NET(2).device_typerepresents LiDAR's Device type, it can be configured to: (1) YDLIDAR_TYPE_SERIAL(0). (2) YDLIDAR_TYPE_TCP(1).sample_raterepresents LiDAR's sample rateabnormal_check_countrepresents the maximum number of exception attempts when lidar is connected.resolution_fixedrepresents whether lidar is a fixed angle resolution output.reversionrepresents whether to rotate 180 degrees.invertedrepresents wether to switch to the counter clockwise direction.auto_reconnectrepresents wether to automatically reconnect.isSingleChannelrepresents wether it is a single channel lidar.intensityrepresents wether to support intensity.support_motor_dtrrepresents wether to support DTR.max_anglerepresents LiDAR's maximum effective angle.min_anglerepresents LiDAR's minimum effective angle.max_rangerepresents LiDAR's maximum effective range.min_rangerepresents LiDAR's minimum effective range.frequencyrepresents LiDAR's scan frequency
Notice
1. Please refer to lidar data sheet for specific lidar parameters.
2. The intensity information can only be set to true with the support of lidar.
YDLidar_Apollo_Driver has the same directory structure as Apollo5.0
- copy ydlidar_apollo_driver to the same folder of your apollo project:
cp -r ydlidar_apollo_driver/apollo/modules/drivers/ydlidar your_apollo_project/apollo/modules/drivers/
cp ydlidar_apollo_driver/apollo/docker/build/installers/install_ydlidar_sdk.sh your_apollo_project/apollo/docker/build/installers/- start and enter apollo docker:
bash /apollo/docker/scripts/dev_start.sh
bash /apollo/docker/scripts/dev_into.sh- install ydlidar_sdk dynamic link library:
sudo bash /apollo/docker/build/installers/install_ydlidar_sdk.sh- build project:
bash apollo.sh build#in docker
cd /apollo && cyber_launch start modules/drivers/ydlidar/launch/ydlidar.launch#in docker
cd /apollo && ./bazel-bin/modules/drivers/ydlidar/driver/driver_test