Skip to content

Commit

Permalink
feat: add vanjee lidar driver (#15475)
Browse files Browse the repository at this point in the history
* 1.add vanjee lidar driver

* 1.add vanjee lidar(vanjee_720_16/vanjee_720_32)

* 1.去除lpcap的链接指令

* 1.add lidar type(vanjee_720d_16);
2. update documents;

* 1.fix coding specification.

* 1.fix running errors with other lidar drivers.
  • Loading branch information
lvvmao authored Aug 19, 2024
1 parent ae95c40 commit 2bf92f3
Show file tree
Hide file tree
Showing 12 changed files with 555 additions and 0 deletions.
38 changes: 38 additions & 0 deletions modules/drivers/lidar/vanjeelidar/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
load("//tools:apollo_package.bzl", "apollo_package", "apollo_cc_library", "apollo_component")
load("//tools:cpplint.bzl", "cpplint")

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

VANJEE_COPTS = ['-DMODULE_NAME=\\"vanjeelidar\\"']

apollo_component(
name = "libvanjeelidar_component.so",
copts = VANJEE_COPTS,
srcs = [
"src/vanjeelidar_component.cpp",
],
hdrs = [
"src/vanjeelidar_component.h",
],
deps = [
"//modules/common_msgs/sensor_msgs:pointcloud_cc_proto",
"//modules/drivers/lidar/vanjeelidar/proto:vanjeelidar_config_proto",
"//modules/drivers/lidar/vanjeelidar/proto:vanjeelidar_proto",
"//modules/drivers/lidar/common:lidar_common",
],
linkopts = [
]
)

filegroup(
name = "runtime_data",
srcs = glob([
"conf/*.txt",
"conf/*.conf",
"dag/*.dag",
"launch/*.launch",
]),
)

apollo_package()
cpplint()
29 changes: 29 additions & 0 deletions modules/drivers/lidar/vanjeelidar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# **Vanjee LiDAR Driver**

## 1 Introduction

**vanjee** is the lidar driver kit under Apollo platform. Now support *vanjee_720_16","vanjee_720_32*.


## 2 Run

**All the drivers need to be excuted in Apollo docker environment.**

```sh
cyber_launch start /apollo/modules/drivers/lidar/vanjeelidar/launch/vanjeelidar.launch
```

or

```sh
mainboard -d /apollo/modules/drivers/lidar/vanjeelidar/dag/vanjeelidar.dag
```

default topic name:

- raw point cloud -- /apollo/sensor/vanjeelidar/up/PointCloud2"
- Scan--/apollo/sensor/vanjeelidar/up/Scan

## 3 Parameters Intro

[Intro to parameters](doc/parameter_intro.md)
28 changes: 28 additions & 0 deletions modules/drivers/lidar/vanjeelidar/README_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# **Vanjee LiDAR Driver**

## 1 工程简介

**vanjee** 为万集科技在阿波罗平台上的雷达驱动集成包。 目前支持*vanjee_720_16"、"vanjee_720_32*型号的雷达。

## 2 运行

**所有驱动均需要在Apollo Docker环境下运行**

```sh
cyber_launch start /apollo/modules/drivers/lidar/vanjeelidar/launch/vanjeelidar.launch
```


```sh
mainboard -d /apollo/modules/drivers/lidar/vanjeelidar/dag/vanjeelidar.dag
```

默认话题名:

- 原始点云 -- /apollo/sensor/vanjeelidar/up/PointCloud2"
- Scan--/apollo/sensor/vanjeelidar/up/Scan

## 3 参数介绍

[参数介绍](doc/parameter_intro.md)
26 changes: 26 additions & 0 deletions modules/drivers/lidar/vanjeelidar/conf/vanjeelidar.pb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
config_base {
scan_channel: "/apollo/sensor/vanjeelidar/up/Scan"
point_cloud_channel: "/apollo/sensor/vanjeelidar/up/PointCloud2"
frame_id: "vanjeelidar_up"

# sample ONLINE_LIDAR, RAW_PACKET
source_type: ONLINE_LIDAR
}

# sample: "vanjee_720_16,vanjee_720_32"
model: "vanjee_720_16"
connect_type: 1
host_msop_port: 3001
lidar_msop_port: 3333
host_address: "192.168.2.88"
lidar_address: "192.168.2.86"
publish_mode: 2
start_angle: 0
end_angle: 360
min_distance: 0.3
max_distance: 120
use_lidar_clock: false
dense_points: false
wait_for_difop: true
config_from_file: false
angle_path: "/usr/local/include/vanjee_driver/param/Vanjee_720_16.csv"
10 changes: 10 additions & 0 deletions modules/drivers/lidar/vanjeelidar/dag/vanjeelidar.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module_config {
module_library : "modules/drivers/lidar/vanjeelidar/libvanjeelidar_component.so"
components {
class_name : "VanjeelidarComponent"
config {
name : "VanjeeLiDAR_Driver"
config_file_path : "/apollo/modules/drivers/lidar/vanjeelidar/conf/vanjeelidar.pb.txt"
}
}
}
90 changes: 90 additions & 0 deletions modules/drivers/lidar/vanjeelidar/doc/parameter_intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Parameter Introduction

This document will give you a introduction to each parameter in the configuration file.

For convenient, we take vanjee_720_16 model as an example.

```yaml
model: "vanjee_720_16"
connect_type: 1
host_msop_port: 3001
lidar_msop_port: 3333
host_address: "192.168.2.88"
lidar_address: "192.168.2.86"
publish_mode: 2
start_angle: 0
end_angle: 360
min_distance: 0.2
max_distance: 120
use_lidar_clock: false
dense_points: false
wait_for_difop: true
config_from_file: false
angle_path: ""
```
**model**
This is the lidar model, since this configuration file is for vanjee_720_16, we set the model="vanjee_720_16".The parameter are as followed below:vanjee_720_16,vanjee_720_32.
**connect_type**
This is the net connection model,which is tcp or udp.Set the connect_type="1" if the net connection mode is udp,otherwise set it as "2".
**host_msop_port**
This is the port number of host. The default value is 3001.Lidar would send the raw packet to this port.
**lidar_msop_port**
This is the port number of lidar. The default value is 3333.Lidar would send the raw packet from this port.
**host_address**
This is the host ip address. The default value is "192.168.2.88".Lidar would send the raw packet to this ip address.
**lidar_address**
This is the lidar ip address. The default value is "192.168.2.86".Lidar would send the raw packet from this ip address.
**publish_mode**
This is the publish mode of lidar point cloud. "0": publish the 1st echo ,"1":publish the 2nd echo ,"2":publish both the 1st and 2nd echos.
**start_angle**
The start angle of point cloud,unit:degree.
**end_angle**
The end angle of point cloud,unit:degree.The point cloud published would only include the azimuth between start_angle and end_angle.
**min_distance**
The minimum distance of point cloud,unit:m.
**max_distance**
The maximum distance of point cloud,unit:m.The point cloud published would only include the distance between min_distance and max_distance.
**use_lidar_clock**
- true: The timestamp of lidar messages is the lidar clock.
- false: The timestamp of lidar messages is the PC system clock.
**dense_point**
The flag whether mark the invald point cloud as 'nan'. If you would not mark the invalid point as 'nan',set the dense_point=true,otherwise set it as false.
**wait_for_difop**
The flag whether need to request the angle information from the lidar firstly. Usually set wait_for_difop=true in ONLINE_LIDAR mode,otherwise set it as false.
**config_from_file**
The flag whether read the angle information from the configuration file .Usually set config_from_file=true in RAW_PACKET mode,otherwise set it as false.
**angle_path**
The path of angle configuration file.
7 changes: 7 additions & 0 deletions modules/drivers/lidar/vanjeelidar/launch/vanjeelidar.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<cyber>
<module>
<name>vanjeelidar</name>
<dag_conf>/apollo/modules/drivers/lidar/vanjeelidar/dag/vanjeelidar.dag</dag_conf>
<process_name>vanjeelidar</process_name>
</module>
</cyber>
23 changes: 23 additions & 0 deletions modules/drivers/lidar/vanjeelidar/proto/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Auto generated by `proto_build_generator.py`
load("//tools:apollo_package.bzl", "apollo_package")
load("//tools/proto:proto.bzl", "proto_library")

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

proto_library(
name = "vanjeelidar_config_proto",
srcs = ["vanjeelidar_config.proto"],
deps= [
"//modules/drivers/lidar/common/proto:lidar_config_base_proto",
]
)

proto_library(
name = "vanjeelidar_proto",
srcs = ["vanjeelidar.proto"],
deps = [
"//modules/common_msgs/basic_msgs:header_proto",
],
)

apollo_package()
16 changes: 16 additions & 0 deletions modules/drivers/lidar/vanjeelidar/proto/vanjeelidar.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto2";

package apollo.drivers.vanjee;

import "modules/common_msgs/basic_msgs/header.proto";

message VanjeeScanPacket {
optional uint64 stamp = 1;
optional bytes data = 2;
}

message VanjeeScan {
optional bool is_difop = 1;
optional bool is_frame_begin = 2;
optional bytes data = 3;
}
33 changes: 33 additions & 0 deletions modules/drivers/lidar/vanjeelidar/proto/vanjeelidar_config.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
syntax = "proto2";

package apollo.drivers.vanjee;

import "modules/drivers/lidar/common/proto/lidar_config_base.proto";

message Config {

// lidar base
required apollo.drivers.lidar.LidarConfigBase config_base = 33;

// general param
optional string model = 1;
// Input Param
optional uint32 connect_type = 2;
optional uint32 host_msop_port = 3;
optional uint32 lidar_msop_port = 4;
// Decoder Param
optional float start_angle = 5;
optional float end_angle = 6;
optional float min_distance = 7;
optional float max_distance = 8;
optional bool use_lidar_clock = 9 [default = false];
// supplementary parameters of Decoder Param
optional bool dense_points = 10 [default = false];
optional bool wait_for_difop = 11 [default = true];
optional bool config_from_file = 12 [default = false];
optional string angle_path = 13 [default = ""];
optional uint32 publish_mode = 14 [default = 2];
// supplementary parameters of Input Param
optional string host_address = 15 [default = "0.0.0.0"];
optional string lidar_address = 16 [default = "0.0.0.0"];
}
Loading

0 comments on commit 2bf92f3

Please sign in to comment.