Improve lidar documentation structure and add point cloud aggregation functionality

This commit is contained in:
xiexun
2025-09-24 14:13:07 +08:00
parent 4e49fca93d
commit 10998bcb79
2 changed files with 92 additions and 22 deletions
+50 -14
View File
@@ -1,6 +1,15 @@
# OrbbecSDK ROS2 LiDAR Driver # OrbbecSDK ROS2 LiDAR Driver
This ROS2 driver supports your use of Orbbec single-line/multi-line LiDAR. This document provides installation instructions, usage guides, and other important information to help you quickly get started using this driver. This ROS2 driver supports your use of Orbbec single-line/multi-line LiDAR. This document provides installation instructions## 4. IMU Data
### 4.1 IMU Topics
When IMU is enabled, the following topics will be published:
- **`/lidar/imu/sample`**: Unified IMU topic containing synchronized accelerometer and gyroscope data in `sensor_msgs/Imu` format.
- **`/lidar/lidar_to_imu`**: Transform from LiDAR frame to IMU frame.
### 4.2 Using IMU Dataides, and other important information to help you quickly get started using this driver.
## 1. Installation ## 1. Installation
@@ -30,15 +39,15 @@ sudo bash install_udev_rules.sh
sudo udevadm control --reload-rules && sudo udevadm trigger sudo udevadm control --reload-rules && sudo udevadm trigger
``` ```
### 2. Getting Started ### 1.4 Build the Package
```bash ```bash
cd ~/ros2_ws/ cd ~/ros2_ws/
# build release, Default is Debug # Build release version, default is Debug
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release
``` ```
Launch the LiDAR node ### 1.5 Launch the LiDAR Node
* First terminal * First terminal
@@ -138,30 +147,57 @@ The `lidar.launch.py` file contains default parameters for the driver. You can c
- **imu_rate**: Unified frequency of the IMU (both accelerometer and gyroscope). - **imu_rate**: Unified frequency of the IMU (both accelerometer and gyroscope).
- **accel_range**: Range of the accelerometer. - **accel_range**: Range of the accelerometer.
- **gyro_range**: Range of the gyroscope. - **gyro_range**: Range of the gyroscope.
- **linear_accel_cov**: Linear acceleration covariance value, default is `0.0001`.
- **angular_vel_cov**: Angular velocity covariance value, default is `0.0001`.
## Point Cloud Data Detailed Description ## 3. Point Cloud Data Details
### 3.1 Point Cloud Format
PointCloud2 (PointXYZITO) point cloud format is as follows: PointCloud2 (PointXYZITO) point cloud format is as follows:
``` ```
float32 x # X axis, unit:m float32 x # X axis, unit: meters
float32 y # Y axis, unit:m float32 y # Y axis, unit: meters
float32 z # Z axis, unit:m float32 z # Z axis, unit: meters
uint8 intensity # lidar intensity uint8 intensity # LiDAR intensity
uint8 tag # lidar tag uint8 tag # LiDAR tag
uint32 offset_time # Point cloud offset time relative to topic time, in nanoseconds uint32 offset_time # Point cloud offset relative to topic time, unit nanoseconds
``` ```
## 3. IMU Data ### 3.2 Point Cloud Aggregation Functionality
### 3.1 IMU Topics The `publish_n_pkts` parameter enables point cloud aggregation functionality, which allows the LiDAR to accumulate a specified number of frames before publishing, then merge these frames into a larger point cloud data package for publishing.
#### Features:
- **Parameter Range**: 1-12000 frames
- **Applicable Formats**: Only effective when lidar format is `LIDAR_POINT` or `LIDAR_SPHERE_POINT`
- **Default Value**: 1 (no aggregation, each frame published individually)
- **Purpose**: Improve point cloud density, suitable for applications requiring denser point cloud data
#### Usage Examples:
```bash
# Aggregate 10 frames before publishing
ros2 launch orbbec_camera lidar.launch.py lidar_format:=LIDAR_POINT publish_n_pkts:=10
# Aggregate 100 frames before publishing
ros2 launch orbbec_camera lidar.launch.py lidar_format:=LIDAR_SPHERE_POINT publish_n_pkts:=100
```
**Note**: Increasing the `publish_n_pkts` value will improve point cloud density but will also increase latency and memory usage. Please adjust according to actual application requirements.
## 4. IMU Data
### 4.1 IMU Topics
When IMU is enabled, the following topics will be published: When IMU is enabled, the following topics will be published:
- **`/lidar/imu/sample`**: Unified IMU topic containing synchronized accelerometer and gyroscope data in `sensor_msgs/Imu` format. - **`/lidar/imu/sample`**: Unified IMU topic containing synchronized accelerometer and gyroscope data in `sensor_msgs/Imu` format.
- **`/lidar/lidar_to_imu`**: Transform from LiDAR frame to IMU frame. - **`/lidar/lidar_to_imu`**: Transform from LiDAR frame to IMU frame.
### 3.2 Using IMU Data ### 4.2 Using IMU Data
To enable IMU data collection: To enable IMU data collection:
+42 -8
View File
@@ -6,9 +6,16 @@
### 1.1 先决条件 ### 1.1 先决条件
在使用OrbbecSDK ROS2激光雷达驱动之前,请确保您的系统已安装以下依赖项: 在使用OrbbecSDK ROS2激光雷达驱动之前,请确保您的系统已安装以下依赖项:## 4. IMU数据
- **ROS2**: 有效的ROS2安装(Humble、Foxy或其他支持的发行版)。 ### 4.1 IMU话题
启用IMU时,将发布以下话题:
- **`/lidar/imu/sample`**: 统一的IMU话题,包含 `sensor_msgs/Imu`格式的同步加速度计和陀螺仪数据。
- **`/lidar/lidar_to_imu`**: 从激光雷达坐标系到IMU坐标系的变换。
### 4.2 使用IMU数据**: 有效的ROS2安装(Humble、Foxy或其他支持的发行版)。
- 如果您需要帮助,请参考[ROS2安装指南](https://docs.ros.org/en/foxy/Installation.html)。 - 如果您需要帮助,请参考[ROS2安装指南](https://docs.ros.org/en/foxy/Installation.html)。
### 1.2 安装deb依赖项 ### 1.2 安装deb依赖项
@@ -30,7 +37,7 @@ sudo bash install_udev_rules.sh
sudo udevadm control --reload-rules && sudo udevadm trigger sudo udevadm control --reload-rules && sudo udevadm trigger
``` ```
### 2. 入门指南 ### 1.4 构建包
```bash ```bash
cd ~/ros2_ws/ cd ~/ros2_ws/
@@ -38,7 +45,7 @@ cd ~/ros2_ws/
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release
``` ```
启动激光雷达节点 ### 1.5 启动激光雷达节点
* 第一个终端 * 第一个终端
@@ -138,8 +145,12 @@ ros2 run orbbec_camera list_camera_profile_mode_node
- **imu_rate**: IMU的统一频率(加速度计和陀螺仪)。 - **imu_rate**: IMU的统一频率(加速度计和陀螺仪)。
- **accel_range**: 加速度计的量程。 - **accel_range**: 加速度计的量程。
- **gyro_range**: 陀螺仪的量程。 - **gyro_range**: 陀螺仪的量程。
- **linear_accel_cov**: 线性加速度协方差值,默认为 `0.0001`。
- **angular_vel_cov**: 角速度协方差值,默认为 `0.0001`。
## 点云数据详细说明 ## 3. 点云数据详细说明
### 3.1 点云格式
PointCloud2 (PointXYZITO) 点云格式如下: PointCloud2 (PointXYZITO) 点云格式如下:
@@ -152,16 +163,39 @@ uint8 tag # 激光雷达标签
uint32 offset_time # 点云相对话题时间的偏移量,单位纳秒 uint32 offset_time # 点云相对话题时间的偏移量,单位纳秒
``` ```
## 3. IMU数据 ### 3.2 点云聚合功能
### 3.1 IMU话题 通过 `publish_n_pkts` 参数可以开启点云聚合功能,该功能允许激光雷达在发布数据前累积指定数量的帧,然后将这些帧合并为一个更大的点云数据包进行发布。
#### 功能特点:
- **参数范围**: 1-12000 帧
- **适用格式**: 仅在激光雷达格式为 `LIDAR_POINT` 或 `LIDAR_SPHERE_POINT` 时有效
- **默认值**: 1(即不聚合,每帧单独发布)
- **用途**: 提高点云密度,适用于需要更密集点云数据的应用场景
#### 使用示例:
```bash
# 聚合10帧数据后发布
ros2 launch orbbec_camera lidar.launch.py lidar_format:=LIDAR_POINT publish_n_pkts:=10
# 聚合100帧数据后发布
ros2 launch orbbec_camera lidar.launch.py lidar_format:=LIDAR_SPHERE_POINT publish_n_pkts:=100
```
**注意**: 增加 `publish_n_pkts` 值会提高点云密度,但同时会增加延迟和内存使用量,请根据实际应用需求进行调整。
## 4. IMU数据
### 4.1 IMU话题
启用IMU时,将发布以下话题: 启用IMU时,将发布以下话题:
- **`/lidar/imu/sample`**: 统一的IMU话题,包含 `sensor_msgs/Imu`格式的同步加速度计和陀螺仪数据。 - **`/lidar/imu/sample`**: 统一的IMU话题,包含 `sensor_msgs/Imu`格式的同步加速度计和陀螺仪数据。
- **`/lidar/lidar_to_imu`**: 从激光雷达坐标系到IMU坐标系的变换。 - **`/lidar/lidar_to_imu`**: 从激光雷达坐标系到IMU坐标系的变换。
### 3.2 使用IMU数据 ### 4.2 使用IMU数据
要启用IMU数据采集: 要启用IMU数据采集: