Skip to content

Commit

Permalink
Merge pull request #15042 from Lslidar/apollo_lslidar_230714
Browse files Browse the repository at this point in the history
Add lslidar driver for Apollo platform,230714
  • Loading branch information
hearto1314 authored Jul 14, 2023
2 parents d5f88cb + cf81fa2 commit a3c851f
Show file tree
Hide file tree
Showing 114 changed files with 10,420 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/drivers/lidar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ install(
"//modules/drivers/lidar/hesai:install",
"//modules/drivers/lidar/robosense:install",
"//modules/drivers/lidar/velodyne:install",
"//modules/drivers/lidar/lslidar:install",
]
)

Expand Down
27 changes: 27 additions & 0 deletions modules/drivers/lidar/lslidar/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("//tools/install:install.bzl", "install")

package(default_visibility = ["//visibility:public"])

install(
name = "install",
data_dest = "drivers/addition_data/lidar/lslidar",
library_dest = "drivers/lib/lidar/lslidar",
data = [
":runtime_data",
],
targets = [
"//modules/drivers/lidar/lslidar/driver:liblslidar_driver_component.so",
"//modules/drivers/lidar/lslidar/parser:liblslidar_convert_component.so",
],
)

filegroup(
name = "runtime_data",
srcs = glob([
"conf/*.txt",
"conf/*.conf",
"dag/*.dag",
"launch/*.launch",
"params/*.yaml",
]),
)
140 changes: 140 additions & 0 deletions modules/drivers/lidar/lslidar/README_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# **Lslidar LiDAR Driver**



## 1、 工程简介

**lslidar** 为镭神在Apollo 8.0平台的雷达驱动集成包。 目前支持*C16,C32,CH16,CH32,CH64,CH64w,CH120,CH128,CH128X1*等型号的雷达。



## 2、 驱动运行示例

#### 2.1 C16

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidar16.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidar16.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidar16/PointCloud2
- Scan--/apollo/sensor/lslidar16/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidar16/compensator/PointCloud2


#### 2.2 C32

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidar32.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidar32.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidar32/PointCloud2
- Scan--/apollo/sensor/lslidar32/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidar32/compensator/PointCloud2


#### 2.3 N401(删除)

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidar401.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidar401.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidar401/PointCloud2
- Scan--/apollo/sensor/lslidar401/Scan

#### 2.4 CH16

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH16.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH16.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidarCH16/PointCloud2
- Scan--/apollo/sensor/lslidarCH16/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidarCH16/compensator/PointCloud2

#### 2.5 CH32

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH32.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH32.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidarCH32/PointCloud2
- Scan--/apollo/sensor/lslidarCH32/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidarCH32/compensator/PointCloud2

#### 2.6 CH64

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH64.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH64.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidarCH64/PointCloud2
- Scan--/apollo/sensor/lslidarCH64/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidarCH64/compensator/PointCloud2

#### 2.7 CH64w

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH64w.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH64w.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidarCH64w/PointCloud2
- Scan--/apollo/sensor/lslidarCH64w/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidarCH64w/compensator/PointCloud2

#### 2.8 CH120

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH120.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH120.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidarCH120/PointCloud2
- Scan--/apollo/sensor/lslidarCH120/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidarCH120/compensator/PointCloud2

#### 2.9 CH128

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH128.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH128.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidarCH128/PointCloud2
- Scan--/apollo/sensor/lslidarCH128/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidarCH128/compensator/PointCloud2

#### 2.10 CH128X1

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH128X1.launch
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH128X1.dag

默认话题名:

- 原始点云 -- /apollo/sensor/lslidarCH128X1/PointCloud2
- Scan--/apollo/sensor/lslidarCH128X1/Scan
- 运动补偿后点云 -- /apollo/sensor/lslidarCH128X1/compensator/PointCloud2



### 常见问题

- 打印“[lslidar]lslidar poll() timeout, port: 2368‘’ 表示计算平台与雷达网络不通。

可用wireshark查看是否有雷达数据;以及雷达ip和端口号参数设置是否正确。
142 changes: 142 additions & 0 deletions modules/drivers/lidar/lslidar/README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# **Lslidar LiDAR Driver**



## 1. Overview

**lslidar** is a lidar driver integration package from LenShen Intelligent System Co. Ltd. for the Apollo 8.0 platform. Currently the *C16, C32, CH16, CH32, CH64, CH64w, CH120, CH128,CH128X1* lidar models are supported.



## 2. Example of driver running

#### 2.1 C16

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidar16.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidar16.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidar16/PointCloud2
- Scan--/apollo/sensor/lslidar16/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidar16/compensator/PointCloud2


#### 2.2 C32

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidar32.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidar32.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidar32/PointCloud2
- Scan--/apollo/sensor/lslidar32/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidar32/compensator/PointCloud2


#### 2.3 N401(delete)

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidar401.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidar401.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidar401/PointCloud2
- Scan--/apollo/sensor/lslidar401/Scan

#### 2.4 CH16

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH16.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH16.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidarCH16/PointCloud2
- Scan--/apollo/sensor/lslidarCH16/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidarCH16/compensator/PointCloud2

#### 2.5 CH32

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH32.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH32.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidarCH32/PointCloud2
- Scan--/apollo/sensor/lslidarCH32/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidarCH32/compensator/PointCloud2

#### 2.6 CH64

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH64.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH64.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidarCH64/PointCloud2
- Scan--/apollo/sensor/lslidarCH64/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidarCH64/compensator/PointCloud2

#### 2.7 CH64w

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH64w.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH64w.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidarCH64w/PointCloud2
- Scan--/apollo/sensor/lslidarCH64w/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidarCH64w/compensator/PointCloud2

#### 2.8 CH120

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH120.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH120.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidarCH120/PointCloud2
- Scan--/apollo/sensor/lslidarCH120/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidarCH120/compensator/PointCloud2

#### 2.9 CH128

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH128.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH128.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidarCH128/PointCloud2
- Scan--/apollo/sensor/lslidarCH128/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidarCH128/compensator/PointCloud2

#### 2.10 CH128X1

cyber_launch start /apollo/modules/drivers/lidar/lslidar/launch/lslidarCH128X1.launch
or
mainboard -d /apollo/modules/drivers/lidar/lslidar/dag/lslidarCH128X1.dag

Default topic name:

- Raw point cloud -- /apollo/sensor/lslidarCH128X1/PointCloud2
- Scan--/apollo/sensor/lslidarCH128X1/Scan
- Point cloud after motion compensation -- /apollo/sensor/lslidarCH128X1/compensator/PointCloud2



### Frequently asked questions

- The printout "[lslidar]lslidar poll() timeout, port: 2368" indicates that the computing platform is not connected to the lidar network.

You can use Wireshark to see if lidar data is available; and if the lidar IP and port number parameters are set correctly.


Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
world_frame_id: "world"
transform_query_timeout: 0.02
output_channel: "/apollo/sensor/lslidar16/compensator/PointCloud2"
30 changes: 30 additions & 0 deletions modules/drivers/lidar/lslidar/conf/lslidar16_conf.pb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
model: LSLIDAR16P
device_ip: "192.168.1.201"
msop_port: 2370
difop_port: 2371
return_mode: 1
degree_mode: 2 #2: 均匀2度校准两列 1://均匀1.33度校准两列
distance_unit: 0.25
packet_size: 1206
time_synchronization: false
add_multicast: false
group_ip: "224.1.1.2"
rpm: 600 #雷达转速 10hz:600rpm, 20hz:1200rpm, 5hz:300rpm
convert_channel_name: "/apollo/sensor/lslidar16/PointCloud2"
frame_id: "lslidar16"
scan_channel: "/apollo/sensor/lslidar16/Scan"
min_range: 0.15
max_range: 150.0
config_vert: true
scan_start_angle: 0.0
scan_end_angle: 36000.0
#要屏蔽的矩形区域参数
bottom_left_x: 0.0 #左下 x值
bottom_left_y: 0.0 #左下 y值
top_right_x: 0.0 #右上 x值
top_right_y: 0.0 #右上 y值

calibration: false
calibration_file: "/apollo/modules/drivers/lidar/lslidar/params/LS16_calibration.yaml"
pcap_path: "" #读取pcap包,测试时使用,连接雷达的时候,将此值设置为空

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
world_frame_id: "world"
transform_query_timeout: 0.02
output_channel: "/apollo/sensor/lslidar16v4/compensator/PointCloud2"
26 changes: 26 additions & 0 deletions modules/drivers/lidar/lslidar/conf/lslidar16v4_conf.pb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
model: LSLIDAR_C16_V4
device_ip: "192.168.1.200"
msop_port: 2368
difop_port: 2369
return_mode: 1
degree_mode: 2 #2: 均匀1度校准两列 1://均匀0.33度校准两列
distance_unit: 0.4
packet_size: 1212
time_synchronization: false
add_multicast: false
group_ip: "224.1.1.2"
rpm: 600
convert_channel_name: "/apollo/sensor/lslidar16v4/PointCloud2"
frame_id: "lslidar16v4"
scan_channel: "/apollo/sensor/lslidar16v4/Scan"
min_range: 0.15
max_range: 150.0
config_vert: true
scan_start_angle: 0.0
scan_end_angle: 36000.0
#要屏蔽的矩形区域参数
bottom_left_x: 0.0 #左下 x值
bottom_left_y: 0.0 #左下 y值
top_right_x: 0.0 #右上 x值
top_right_y: 0.0 #右上 y值
pcap_path: "" #读取pcap包,测试时使用,连接雷达的时候,将此值设置为空
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
world_frame_id: "world"
transform_query_timeout: 0.02
output_channel: "/apollo/sensor/lslidar1v4/compensator/PointCloud2"
Loading

0 comments on commit a3c851f

Please sign in to comment.