mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 03:57:46 +08:00
Add Chinese documentation for camera and lidar devices
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
应用指南
|
||||
======================================================
|
||||
|
||||
本章介绍使用SDK进行应用开发,包括启动参数配置、ROS2服务和话题使用。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
launch_parameters.md
|
||||
services.md
|
||||
topics.md
|
||||
coordinate_and_tf.md
|
||||
compressed_image.md
|
||||
point_cloud.md
|
||||
@@ -0,0 +1,11 @@
|
||||
### 压缩图像
|
||||
|
||||
您可以使用 `image_transport` 通过 `jpeg` 压缩图像。以下是使用示例:
|
||||
|
||||
要访问压缩的彩色图像,可以使用以下命令:
|
||||
|
||||
```bash
|
||||
ros2 topic echo /camera/color/image_raw/compressed --no-arr
|
||||
```
|
||||
|
||||
此命令将允许您从指定话题接收压缩的彩色图像。
|
||||
@@ -0,0 +1,367 @@
|
||||
## 坐标系和 TF 变换
|
||||
|
||||
### 相机传感器结构
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 从坐标系A到坐标系B的TF变换:
|
||||
|
||||
在Orbbec相机中,原点(0,0,0)取自camera_link位置。
|
||||
|
||||
可以使用以下命令查看相机的URDF模型和坐标系结构:
|
||||
|
||||
```bash
|
||||
ros2 launch orbbec_description view_model.launch.py model:=gemini_335_336.urdf.xacro
|
||||
```
|
||||
|
||||

|
||||
|
||||
### ROS2机器人坐标系 vs 相机光学坐标系
|
||||
|
||||
* 视角:
|
||||
* 想象我们站在相机后面,向前看。
|
||||
* 在讨论坐标、左右红外、传感器位置等时,始终使用此视角。
|
||||
|
||||

|
||||
|
||||
* ROS2坐标系:(X: 向前,Y: 向左,Z: 向上)
|
||||
* 相机光学坐标系:(X: 向右,Y: 向下,Z: 向前)
|
||||
* 我们封装器话题中发布的所有数据都是直接从相机传感器获取的光学数据。
|
||||
* 静态和动态TF话题发布光学坐标系和ROS坐标系,使用户能够在两个坐标系之间转换。
|
||||
|
||||
### ROS2 TF工具的使用
|
||||
|
||||
#### 查看TF树结构
|
||||
|
||||
可以使用以下ROS2命令来打印和可视化相机包发布的TF树:
|
||||
|
||||
**打印所有TF关系:**
|
||||
|
||||
```bash
|
||||
ros2 run tf2_tools view_frames
|
||||
```
|
||||
|
||||
这个命令会生成一个 `frames.pdf`文件,展示所有frame之间的层级关系。
|
||||
|
||||

|
||||
|
||||
**查看所有正在发布的TF信息:**
|
||||
|
||||
```bash
|
||||
ros2 topic echo /tf_static
|
||||
```
|
||||
|
||||
**查看指定两个frame之间的TF变换关系:**
|
||||
|
||||
使用以下命令可以查看两个特定frame之间的变换关系:
|
||||
|
||||
```bash
|
||||
ros2 run tf2_ros tf2_echo [source_frame] [target_frame]
|
||||
```
|
||||
|
||||
例如,查看从 `camera_link` 到 `camera_depth_optical_frame` 的变换:
|
||||
|
||||
```bash
|
||||
ros2 run tf2_ros tf2_echo camera_link camera_depth_optical_frame
|
||||
```
|
||||
|
||||
此命令会持续输出两个frame之间的实时变换信息,包括:
|
||||
|
||||
- 平移 (Translation):x、y、z 坐标(单位:米)
|
||||
- 旋转 (Rotation):四元数 (x, y, z, w)
|
||||
- 欧拉角 (RPY):以欧拉角形式表示的旋转
|
||||
- 齐次变换矩阵 (Transform Matrix):包含旋转和平移信息的 4×4 矩阵
|
||||
|
||||
示例输出:
|
||||
|
||||
```
|
||||
At time 0.0
|
||||
- Translation: [0.000, 0.000, 0.000]
|
||||
- Rotation: in Quaternion [-0.500, 0.500, -0.500, 0.500]
|
||||
- Rotation: in RPY (radian) [-1.571, -0.000, -1.571]
|
||||
- Rotation: in RPY (degree) [-90.000, -0.000, -90.000]
|
||||
- Matrix:
|
||||
0.000 0.000 1.000 0.000
|
||||
-1.000 0.000 0.000 0.000
|
||||
0.000 -1.000 0.000 0.000
|
||||
0.000 0.000 0.000 1.000
|
||||
```
|
||||
|
||||
#### 使用rviz2可视化TF树
|
||||
|
||||
在rviz2中可以实时可视化TF树结构和坐标系的相对位置:
|
||||
|
||||
```bash
|
||||
rviz2
|
||||
```
|
||||
|
||||
在rviz2中:
|
||||
|
||||
- 添加 `TF`显示插件
|
||||
- 配置固定框架(Fixed Frame)为 `camera_link`或 `camera_depth_optical_frame`
|
||||
- 选择显示的TF框架树
|
||||
|
||||

|
||||
|
||||
### 相机TF计算和发布机制
|
||||
|
||||
#### 核心函数:[OBCameraNode::calcAndPublishStaticTransform()](https://github.com/orbbec/OrbbecSDK_ROS2/blob/166c35b4ea211c60265ca9b38b1b15519d1ea3dd/orbbec_camera/src/ob_camera_node.cpp#L3475)
|
||||
|
||||
相机节点通过此函数计算和发布所有传感器之间的静态转换关系。
|
||||
|
||||
```cpp
|
||||
void OBCameraNode::calcAndPublishStaticTransform() {
|
||||
tf2::Quaternion quaternion_optical, zero_rot;
|
||||
zero_rot.setRPY(0.0, 0.0, 0.0);
|
||||
quaternion_optical.setRPY(-M_PI / 2, 0.0, -M_PI / 2);
|
||||
tf2::Vector3 zero_trans(0, 0, 0);
|
||||
auto base_stream_profile = stream_profile_[base_stream_];
|
||||
auto device_info = device_->getDeviceInfo();
|
||||
CHECK_NOTNULL(device_info);
|
||||
auto pid = device_info->getPid();
|
||||
if (!base_stream_profile) {
|
||||
RCLCPP_ERROR_STREAM(logger_, "Failed to get base stream profile");
|
||||
return;
|
||||
}
|
||||
CHECK_NOTNULL(base_stream_profile.get());
|
||||
for (const auto &item : stream_profile_) {
|
||||
auto stream_index = item.first;
|
||||
|
||||
auto stream_profile = item.second;
|
||||
if (!stream_profile) {
|
||||
continue;
|
||||
}
|
||||
OBExtrinsic ex;
|
||||
try {
|
||||
ex = stream_profile->getExtrinsicTo(base_stream_profile);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_, "Failed to get " << stream_name_[stream_index]
|
||||
<< " extrinsic: " << e.getMessage());
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
|
||||
auto Q = rotationMatrixToQuaternion(ex.rot);
|
||||
Q = quaternion_optical * Q * quaternion_optical.inverse();
|
||||
tf2::Vector3 trans(ex.trans[0], ex.trans[1], ex.trans[2]);
|
||||
auto timestamp = node_->now();
|
||||
if (stream_index.first != base_stream_.first) {
|
||||
if (stream_index.first == OB_STREAM_IR_RIGHT && base_stream_.first == OB_STREAM_DEPTH) {
|
||||
trans[0] = std::abs(trans[0]); // because left and right ir calibration is error
|
||||
}
|
||||
publishStaticTF(timestamp, trans, Q, frame_id_[base_stream_], frame_id_[stream_index]);
|
||||
}
|
||||
publishStaticTF(timestamp, zero_trans, quaternion_optical, frame_id_[stream_index],
|
||||
optical_frame_id_[stream_index]);
|
||||
RCLCPP_INFO_STREAM(logger_, "Publishing static transform from " << stream_name_[stream_index]
|
||||
<< " to "
|
||||
<< stream_name_[base_stream_]);
|
||||
RCLCPP_INFO_STREAM(logger_, "Translation " << trans[0] << ", " << trans[1] << ", " << trans[2]);
|
||||
RCLCPP_INFO_STREAM(logger_, "Rotation " << Q.getX() << ", " << Q.getY() << ", " << Q.getZ()
|
||||
<< ", " << Q.getW());
|
||||
}
|
||||
|
||||
if ((pid == FEMTO_BOLT_PID || pid == FEMTO_MEGA_PID) && enable_stream_[DEPTH] &&
|
||||
enable_stream_[COLOR] && enable_publish_extrinsic_) {
|
||||
// calc depth to color
|
||||
|
||||
CHECK_NOTNULL(stream_profile_[COLOR]);
|
||||
auto depth_to_color_extrinsics = base_stream_profile->getExtrinsicTo(stream_profile_[COLOR]);
|
||||
auto Q = rotationMatrixToQuaternion(depth_to_color_extrinsics.rot);
|
||||
Q = quaternion_optical * Q * quaternion_optical.inverse();
|
||||
publishStaticTF(node_->now(), zero_trans, Q, camera_link_frame_id_, frame_id_[base_stream_]);
|
||||
} else {
|
||||
publishStaticTF(node_->now(), zero_trans, zero_rot, camera_link_frame_id_,
|
||||
frame_id_[base_stream_]);
|
||||
}
|
||||
|
||||
if (enable_stream_[DEPTH] && enable_stream_[COLOR] && enable_publish_extrinsic_) {
|
||||
static const char *frame_id = "depth_to_color_extrinsics";
|
||||
OBExtrinsic ex;
|
||||
try {
|
||||
ex = base_stream_profile->getExtrinsicTo(stream_profile_[COLOR]);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_,
|
||||
"Failed to get " << frame_id << " extrinsic: " << e.getMessage());
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
depth_to_other_extrinsics_[COLOR] = ex;
|
||||
auto ex_msg = obExtrinsicsToMsg(ex, frame_id);
|
||||
CHECK_NOTNULL(depth_to_other_extrinsics_publishers_[COLOR]);
|
||||
depth_to_other_extrinsics_publishers_[COLOR]->publish(ex_msg);
|
||||
}
|
||||
|
||||
if (enable_stream_[DEPTH] && enable_stream_[INFRA0] && enable_publish_extrinsic_) {
|
||||
static const char *frame_id = "depth_to_ir_extrinsics";
|
||||
OBExtrinsic ex;
|
||||
try {
|
||||
ex = base_stream_profile->getExtrinsicTo(stream_profile_[INFRA0]);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_,
|
||||
"Failed to get " << frame_id << " extrinsic: " << e.getMessage());
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
depth_to_other_extrinsics_[INFRA0] = ex;
|
||||
auto ex_msg = obExtrinsicsToMsg(ex, frame_id);
|
||||
CHECK_NOTNULL(depth_to_other_extrinsics_publishers_[INFRA0]);
|
||||
depth_to_other_extrinsics_publishers_[INFRA0]->publish(ex_msg);
|
||||
}
|
||||
if (enable_stream_[DEPTH] && enable_stream_[INFRA1] && enable_publish_extrinsic_) {
|
||||
static const char *frame_id = "depth_to_left_ir_extrinsics";
|
||||
OBExtrinsic ex;
|
||||
try {
|
||||
ex = base_stream_profile->getExtrinsicTo(stream_profile_[INFRA1]);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_,
|
||||
"Failed to get " << frame_id << " extrinsic: " << e.getMessage());
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
depth_to_other_extrinsics_[INFRA1] = ex;
|
||||
auto ex_msg = obExtrinsicsToMsg(ex, frame_id);
|
||||
CHECK_NOTNULL(depth_to_other_extrinsics_publishers_[INFRA1]);
|
||||
depth_to_other_extrinsics_publishers_[INFRA1]->publish(ex_msg);
|
||||
}
|
||||
if (enable_stream_[DEPTH] && enable_stream_[INFRA2] && enable_publish_extrinsic_) {
|
||||
static const char *frame_id = "depth_to_right_ir_extrinsics";
|
||||
OBExtrinsic ex;
|
||||
try {
|
||||
ex = base_stream_profile->getExtrinsicTo(stream_profile_[INFRA2]);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_,
|
||||
"Failed to get " << frame_id << " extrinsic: " << e.getMessage());
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
ex.trans[0] = -std::abs(ex.trans[0]);
|
||||
depth_to_other_extrinsics_[INFRA2] = ex;
|
||||
auto ex_msg = obExtrinsicsToMsg(ex, frame_id);
|
||||
CHECK_NOTNULL(depth_to_other_extrinsics_publishers_[INFRA2]);
|
||||
depth_to_other_extrinsics_publishers_[INFRA2]->publish(ex_msg);
|
||||
}
|
||||
if (enable_stream_[DEPTH] && enable_stream_[ACCEL] && enable_publish_extrinsic_) {
|
||||
static const char *frame_id = "depth_to_accel_extrinsics";
|
||||
OBExtrinsic ex;
|
||||
try {
|
||||
ex = base_stream_profile->getExtrinsicTo(stream_profile_[ACCEL]);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_,
|
||||
"Failed to get " << frame_id << " extrinsic: " << e.getMessage());
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
depth_to_other_extrinsics_[ACCEL] = ex;
|
||||
auto ex_msg = obExtrinsicsToMsg(ex, frame_id);
|
||||
CHECK_NOTNULL(depth_to_other_extrinsics_publishers_[ACCEL]);
|
||||
depth_to_other_extrinsics_publishers_[ACCEL]->publish(ex_msg);
|
||||
}
|
||||
if (enable_stream_[DEPTH] && enable_stream_[GYRO] && enable_publish_extrinsic_) {
|
||||
static const char *frame_id = "depth_to_gyro_extrinsics";
|
||||
OBExtrinsic ex;
|
||||
try {
|
||||
ex = base_stream_profile->getExtrinsicTo(stream_profile_[GYRO]);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_,
|
||||
"Failed to get " << frame_id << " extrinsic: " << e.getMessage());
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
depth_to_other_extrinsics_[GYRO] = ex;
|
||||
auto ex_msg = obExtrinsicsToMsg(ex, frame_id);
|
||||
CHECK_NOTNULL(depth_to_other_extrinsics_publishers_[GYRO]);
|
||||
depth_to_other_extrinsics_publishers_[GYRO]->publish(ex_msg);
|
||||
}
|
||||
if (enable_sync_output_accel_gyro_) {
|
||||
tf2::Quaternion zero_rot;
|
||||
zero_rot.setRPY(0.0, 0.0, 0.0);
|
||||
tf2::Vector3 zero_trans(0, 0, 0);
|
||||
publishStaticTF(node_->now(), zero_trans, zero_rot, optical_frame_id_[GYRO],
|
||||
accel_gyro_frame_id_);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 函数解析
|
||||
|
||||
下面是代码的详细解释:
|
||||
|
||||
**四元数初始化与坐标系变换**
|
||||
|
||||
```cpp
|
||||
tf2::Quaternion quaternion_optical, zero_rot;
|
||||
zero_rot.setRPY(0.0, 0.0, 0.0);
|
||||
quaternion_optical.setRPY(-M_PI / 2, 0.0, -M_PI / 2);
|
||||
```
|
||||
|
||||
- `quaternion_optical`:定义光学坐标系到ROS标准坐标系的旋转变换(90度旋转)
|
||||
- 这个旋转将相机光学坐标系(X右、Y下、Z前)转换为ROS标准坐标系(X前、Y左、Z上)
|
||||
|
||||
**获取设备信息与基准流**
|
||||
|
||||
```cpp
|
||||
auto base_stream_profile = stream_profile_[base_stream_];
|
||||
auto device_info = device_->getDeviceInfo();
|
||||
// 通常基准流是深度流(DEPTH)
|
||||
```
|
||||
|
||||
- 选择一个基准流(通常是深度流),所有其他传感器的变换都相对于这个基准流进行计算
|
||||
|
||||
**遍历所有流并计算相对变换**
|
||||
|
||||
```cpp
|
||||
for (const auto &item : stream_profile_) {
|
||||
auto stream_index = item.first;
|
||||
auto stream_profile = item.second;
|
||||
|
||||
// 获取该流相对于基准流的外参
|
||||
OBExtrinsic ex;
|
||||
ex = stream_profile->getExtrinsicTo(base_stream_profile);
|
||||
|
||||
// 将旋转矩阵转换为四元数
|
||||
auto Q = rotationMatrixToQuaternion(ex.rot);
|
||||
|
||||
// 应用光学坐标系变换:Q_new = quaternion_optical * Q * quaternion_optical.inverse()
|
||||
Q = quaternion_optical * Q * quaternion_optical.inverse();
|
||||
|
||||
tf2::Vector3 trans(ex.trans[0], ex.trans[1], ex.trans[2]);
|
||||
```
|
||||
|
||||
- `OBExtrinsic`包含了两个传感器之间的旋转矩阵(`rot`)和平移向量(`trans`)
|
||||
- 通过四元数乘法将光学坐标系变换应用到每个传感器的旋转关系中
|
||||
- 这个变换将相机原生的光学坐标系转换为ROS标准坐标系
|
||||
|
||||
**发布TF变换**
|
||||
|
||||
```cpp
|
||||
// 发布传感器到基准流的变换(在ROS坐标系中)
|
||||
publishStaticTF(timestamp, trans, Q, frame_id_[base_stream_], frame_id_[stream_index]);
|
||||
|
||||
// 发布传感器到其光学frame的变换
|
||||
publishStaticTF(timestamp, zero_trans, quaternion_optical, frame_id_[stream_index],
|
||||
optical_frame_id_[stream_index]);
|
||||
```
|
||||
|
||||
- 第一个 `publishStaticTF`:发布从基准流到当前传感器的变换(平移+旋转)
|
||||
- 第二个 `publishStaticTF`:发布从物理frame到光学frame的变换(纯旋转,无平移)
|
||||
- `frame_id_[stream_index]`:物理坐标系frame名称(如 `camera_depth_frame`)
|
||||
- `optical_frame_id_[stream_index]`:光学坐标系frame名称(如 `camera_depth_optical_frame`)
|
||||
|
||||
**特殊处理左右红外摄像头**
|
||||
|
||||
```cpp
|
||||
if (stream_index.first == OB_STREAM_IR_RIGHT && base_stream_.first == OB_STREAM_DEPTH) {
|
||||
trans[0] = std::abs(trans[0]);
|
||||
}
|
||||
```
|
||||
|
||||
- 左右红外摄像头在设备坐标系中关于中心平面对称
|
||||
- 通过 `abs()`确保X轴偏移为正值,保持几何一致性
|
||||
|
||||
**发布深度到其他传感器的外参**
|
||||
|
||||
```cpp
|
||||
if (enable_stream_[DEPTH] && enable_stream_[COLOR] && enable_publish_extrinsic_) {
|
||||
OBExtrinsic ex = base_stream_profile->getExtrinsicTo(stream_profile_[COLOR]);
|
||||
auto ex_msg = obExtrinsicsToMsg(ex, "depth_to_color_extrinsics");
|
||||
depth_to_other_extrinsics_publishers_[COLOR]->publish(ex_msg);
|
||||
}
|
||||
```
|
||||
|
||||
- 通过TF发布变换关系
|
||||
@@ -0,0 +1,283 @@
|
||||
# 启动参数
|
||||
|
||||
> 如果您不确定如何设置参数,可以连接orbbec相机并打开 [OrbbecViewer](https://github.com/orbbec/OrbbecSDK/releases)。
|
||||
|
||||
以下是可用的启动参数:
|
||||
|
||||
### 核心与数据流配置
|
||||
|
||||
* **`camera_name`**
|
||||
* 启动节点的命名空间。
|
||||
* **`serial_number`**
|
||||
* 相机的序列号。当使用多个相机时需要此参数。
|
||||
* **`usb_port`**
|
||||
* 相机的USB端口。当使用多个相机时需要此参数。
|
||||
* **`device_num`**
|
||||
* 设备数量。如果需要多个相机,必须填写此参数。
|
||||
* **`[color|depth|left_ir|right_ir|ir]_[width|height|fps|format]`**
|
||||
* 传感器流的分辨率和帧率。
|
||||
* **`[color|depth|left_ir|right_ir|ir]_rotation`**
|
||||
* 设置流图像旋转。
|
||||
* 可能的值为 `0`、`90`、`180`、`270`。
|
||||
* **`[color|depth|left_ir|right_ir|ir]_flip`**
|
||||
* 启用流图像翻转。
|
||||
* **`[color|depth|left_ir|right_ir|ir]_mirror`**
|
||||
* 启用流图像镜像。
|
||||
* **`enable_point_cloud`**
|
||||
* 启用点云。
|
||||
* **`enable_colored_point_cloud`**
|
||||
* 启用RGB点云。
|
||||
* **`cloud_frame_id`**
|
||||
* 修改ros消息中的 `frame_id` 名称。
|
||||
* **`ordered_pc`**
|
||||
* 启用无效点云过滤。
|
||||
* **`point_cloud_qos`、`[stream]_qos`、`[stream]_camera_info_qos`**
|
||||
* ROS 2消息服务质量(QoS)设置。可能的值为 `SYSTEM_DEFAULT`、`DEFAULT`、`PARAMETER_EVENTS`、`SERVICES_DEFAULT`、`PARAMETERS`、`SENSOR_DATA`,不区分大小写。这些分别对应 `rmw_qos_profile_system_default`、`rmw_qos_profile_default`、`rmw_qos_profile_parameter_events`、`rmw_qos_profile_services_default`、`rmw_qos_profile_parameters` 和 `SENSOR_DATA`。
|
||||
* **`color.image_raw.enable_pub_plugins`**
|
||||
* 启用彩色图像传输插件。默认值:`["image_transport/compressed", "image_transport/raw", "image_transport/theora"]`。
|
||||
* **`depth.image_raw.enable_pub_plugins`**
|
||||
* 启用深度图像传输插件。默认值:`["image_transport/compressedDepth", "image_transport/raw"]`。
|
||||
* **`left_ir.image_raw.enable_pub_plugins`**
|
||||
* 启用左红外图像传输插件。默认值:`["image_transport/compressed", "image_transport/raw", "image_transport/theora"]`。
|
||||
* **`right_ir.image_raw.enable_pub_plugins`**
|
||||
* 启用右红外图像传输插件。默认值:`["image_transport/compressed", "image_transport/raw", "image_transport/theora"]`。
|
||||
* **`point_cloud_decimation_filter_factor`**
|
||||
* 点云下采样因子。范围:`1–8`,`1`表示不下采样,数值越大下采样越强。
|
||||
* **`preset_resolution_config`**
|
||||
* 摄像头设备的预设分辨率配置。格式: "width,height,ir_decimation_factor,depth_decimation_factor". Example: "1280,720,4,4". 仅在 Gemini435Le 设备上受支持。留空禁用。
|
||||
|
||||
### 传感器控制
|
||||
|
||||
#### 彩色流
|
||||
* **`enable_color_auto_exposure`**
|
||||
* 启用彩色自动曝光。
|
||||
* **`enable_color_auto_exposure_priority`**
|
||||
* 启用彩色自动曝光优先级。
|
||||
* **`color_exposure`**
|
||||
* 设置彩色曝光。
|
||||
* **`color_gain`**
|
||||
* 设置彩色增益。
|
||||
* **`enable_color_auto_white_balance`**
|
||||
* 启用彩色自动白平衡。
|
||||
* **`color_white_balance`**
|
||||
* 设置彩色白平衡。
|
||||
* **`color_ae_max_exposure`**
|
||||
* 设置彩色自动曝光的最大曝光值。
|
||||
* **`color_brightness`**、**`color_sharpness`**、**`color_gamma`**、**`color_saturation`**、**`color_contrast`**、**`color_hue`**
|
||||
* 设置彩色亮度、锐度、伽马、饱和度、对比度和色调。
|
||||
* **`color_backlight_compensation`**
|
||||
* 启用彩色相机的背光补偿功能。**范围**:`0–6`,**默认值**:`3`。
|
||||
* **`color_powerline_freq`**
|
||||
* 设置电源线频率。可能的值为 `disable`、`50hz`、`60hz`、`auto`。
|
||||
* **`enable_color_decimation_filter`** / **`color_decimation_filter_scale`**
|
||||
* 启用彩色抽取滤波器并设置其比例。
|
||||
* **`color_ae_roi_[left|right|top|bottom]`**
|
||||
* 设置彩色自动曝光ROI。
|
||||
* **`color_denoising_level`**
|
||||
* 启用Gemini 330系列设备的ISP降噪功能。**范围:** `0–8`,**默认值:** `0`(自动)。
|
||||
|
||||
|
||||
#### 深度流
|
||||
* **`enable_depth_auto_exposure_priority`**
|
||||
* 启用深度自动曝光优先级。
|
||||
* **`mean_intensity_set_point`**
|
||||
* 设置深度图像的目标平均强度。例如:`mean_intensity_set_point:=100`。
|
||||
> **注意:** 这取代了已弃用的 `depth_brightness`,后者仍支持以保持向后兼容性。
|
||||
* **`enable_depth_scale`**
|
||||
* 启用深度缩放。
|
||||
* **`depth_precision`**
|
||||
* 深度精度应为 `1mm` 格式。默认值为 `1mm`。
|
||||
* **`depth_ae_roi_[left|right|top|bottom]`**
|
||||
* 设置深度自动曝光ROI。
|
||||
|
||||
#### 红外流
|
||||
* **`enable_ir_auto_exposure`**
|
||||
* 启用红外自动曝光。
|
||||
* **`ir_exposure`** / **`ir_gain`**
|
||||
* 设置红外曝光和增益。
|
||||
* **`ir_ae_max_exposure`**
|
||||
* 设置红外自动曝光的最大曝光值。
|
||||
* **`ir_brightness`**
|
||||
* 设置红外亮度。
|
||||
|
||||
#### 激光 / LDP
|
||||
* **`enable_laser`**
|
||||
* 启用激光。默认值为 `true`。
|
||||
* **`laser_energy_level`**
|
||||
* 设置激光能量级别。
|
||||
* **`enable_ldp`** / **`ldp_power_level`**
|
||||
* 启用LDP并设置其功率级别。
|
||||
|
||||
### 设备、同步与高级功能
|
||||
|
||||
#### 多相机同步
|
||||
* **`sync_mode`**
|
||||
* 设置同步模式。默认值为 `standalone`。
|
||||
* **`depth_delay_us`** / **`color_delay_us`**
|
||||
* 接收捕获命令或触发信号后深度/彩色图像捕获的延迟时间(微秒)。
|
||||
* **`trigger2image_delay_us`**
|
||||
* 接收捕获命令或触发信号后图像捕获的延迟时间(微秒)。
|
||||
* **`trigger_out_delay_us`**
|
||||
* 接收捕获命令或触发信号后触发信号输出的延迟时间(微秒)。
|
||||
* **`trigger_out_enabled`**
|
||||
* 启用触发输出信号。
|
||||
* **`software_trigger_enabled`** / **`software_trigger_period`**
|
||||
* 启用软件触发输出信号 / 设置软件触发周期(毫秒)。
|
||||
* **`frames_per_trigger`**
|
||||
* 触发模式下每次触发后每个流的帧数。
|
||||
|
||||
> 用于 [多相机同步](../5_advanced_guide/multi_camera/multi_camera_synced.md)。
|
||||
|
||||
#### 网络相机
|
||||
* **`enumerate_net_device`**
|
||||
* 启用自动枚举网络设备。
|
||||
* **`net_device_ip`** / **`net_device_port`**
|
||||
* 设置网络设备的IP地址和端口(通常为 `8090`)。
|
||||
* **`force_ip_enable`**
|
||||
* 启用强制IP功能。**默认值:** `false`
|
||||
* **`force_ip_mac`**
|
||||
* 连接多个相机时的目标设备MAC地址(例如,`"54:14:FD:06:07:DA"`)。您可以使用 `list_devices_node` 查找每个设备的MAC。**默认值:** `""`
|
||||
* **`force_ip_address`**
|
||||
* 要分配的静态IP地址。**默认值:** `192.168.1.10`
|
||||
* **`force_ip_subnet_mask`**
|
||||
* 静态IP的子网掩码。**默认值:** `255.255.255.0`
|
||||
* **`force_ip_gateway`**
|
||||
* 静态IP的网关地址。**默认值:** `192.168.1.1`
|
||||
|
||||
> 用于 [网络相机](../5_advanced_guide/configuration/net_camera.md)。
|
||||
|
||||
#### 设备特定
|
||||
* **`device_preset`**
|
||||
* 默认值为 `Default`。仅支持G330系列。有关更多信息,请参阅 [G330文档](https://www.orbbec.com/docs/g330-use-depth-presets/)。该值应为 [表中列出](../5_advanced_guide/configuration/predefined_presets.md) 的预设名称之一。
|
||||
* **`enable_gmsl_trigger`** / **`gmsl_trigger_fps`**
|
||||
* 启用gmsl触发输出信号 / 设置gmsl触发fps。用于 [gmsl相机](../5_advanced_guide/multi_camera/gmsl_camera.md)。
|
||||
|
||||
|
||||
#### 视差
|
||||
* **`disparity_to_depth_mode`**
|
||||
* `HW`:使用硬件视差到深度转换。`SW`:使用软件视差到深度转换。
|
||||
* **`disparity_range_mode`**、**`disparity_search_offset`**、**`disparity_offset_config`**
|
||||
* 视差搜索偏移参数。用于 [视差搜索偏移](../5_advanced_guide/configuration/disparity_search_offset.md)。
|
||||
|
||||
#### 交错AE模式
|
||||
* **`interleave_ae_mode`**
|
||||
* 设置 `laser` 或 `hdr` 交错。
|
||||
* **`interleave_frame_enable`**、**`interleave_skip_enable`**、**`interleave_skip_index`**
|
||||
* 控制交错帧模式的参数。
|
||||
* **`[hdr|laser]_index[0|1]_[...]`**
|
||||
* 在交错帧模式下,设置hdr或laser交错帧的第0和第1帧参数。
|
||||
* *所有交错参数用于 [交错ae模式](../5_advanced_guide/configuration/interleave_ae_mode.md)。*
|
||||
|
||||
#### 相机内同步
|
||||
|
||||
- **`depth_registration`**
|
||||
* 启用深度帧与彩色帧的对齐。当 `enable_colored_point_cloud` 设置为 `true` 时需要此字段。
|
||||
- **`align_mode`**
|
||||
* 要使用的对齐模式。选项为 `HW`(硬件对齐)和 `SW`(软件对齐)。
|
||||
- **`align_target_stream`**
|
||||
* 设置对齐目标流模式。
|
||||
* 可能的值为 `COLOR`、`DEPTH`。
|
||||
* `COLOR`:将深度对齐到彩色。
|
||||
* `DEPTH`:将彩色对齐到深度。
|
||||
- **`intra_camera_sync_reference`**
|
||||
- 设置相机内同步的参考点。适用于Gemini 330系列设备,当 `sync_mode` 设置为**软件**或**硬件触发**模式时。**选项:** `Start`、`Middle`、`End`。设置为空时,长基线设备默认End,短基线设备默认Middle。
|
||||
|
||||
### 基础与通用参数
|
||||
|
||||
#### 固件与后端
|
||||
* **`upgrade_firmware`**
|
||||
* 输入参数为固件路径。
|
||||
* **`preset_firmware_path`**
|
||||
* 输入参数为预设固件路径。如果输入多个路径,每个路径需要用 `,` 分隔,最多可输入3个固件路径。
|
||||
* **`uvc_backend`**
|
||||
* 可选值:`v4l2`、`libuvc`。
|
||||
* **`connection_delay`**
|
||||
* 重新打开设备的延迟时间(毫秒)。某些设备(如Astra mini)需要较长时间初始化,热插拔时立即重新打开设备可能导致固件崩溃。
|
||||
* **`retry_on_usb3_detection_failure`**
|
||||
* 如果相机连接到USB 2.0端口且未检测到,系统将尝试重置相机最多三次。使用USB 2.0连接时建议将此参数设置为 `false`,以避免不必要的重置。
|
||||
|
||||
#### TF、外参与校准
|
||||
* **`publish_tf`** / **`tf_publish_rate`**
|
||||
* 启用TF发布并设置其发布速率。
|
||||
* **`enable_publish_extrinsic`**
|
||||
* 启用外参发布。
|
||||
* **`ir_info_url`** / **`color_info_url`**
|
||||
* 设置IR/彩色相机信息的URL。
|
||||
* **`enable_color_undistortion`**
|
||||
* 启用彩色去畸变。
|
||||
|
||||
#### 时间同步
|
||||
* **`enable_sync_host_time`**
|
||||
* 启用主机时间与相机时间的同步。默认值为 `true`。如果使用全局时间,设置为 `false`。
|
||||
* **`time_domain`**
|
||||
* 选择时间戳类型:`device`、`global` 和 `system`。
|
||||
* **`time_sync_period`**
|
||||
|
||||
* 相机时间与主机系统同步的间隔(秒)。
|
||||
> **注意**:仅当 **`enable_sync_host_time = true`** 且 **`time_domain = device`** 时需要设置此参数。
|
||||
* **`enable_ptp_config`**
|
||||
* 启用PTP时间同步。仅适用于Gemini 335Le。需要 `enable_sync_host_time` 设置为 `false`。
|
||||
* **`enable_frame_sync`**
|
||||
* 启用帧同步。
|
||||
|
||||
#### 日志与诊断
|
||||
* **`log_level`**
|
||||
* SDK日志级别。默认为 `info`。可选值:`debug`、`info`、`warn`、`error`、`fatal`。
|
||||
* **`log_file_name`**
|
||||
* 保存的SDK日志文件名。当`log_level`为`debug`时生效。
|
||||
* **`diagnostic_period`**
|
||||
* 诊断周期(秒)。
|
||||
* **`enable_heartbeat`**
|
||||
* 启用心跳功能。默认为 `false`。如果为 `true`,相机节点将向固件发送心跳信号。
|
||||
|
||||
#### 其他
|
||||
* **`config_file_path`**
|
||||
* YAML配置文件的路径。默认为 `""`。如果未指定,将使用启动文件中的默认参数。
|
||||
* **`frame_aggregate_mode`**
|
||||
* 设置帧聚合输出模式。可选值:`full_frame`、`color_frame`、`ANY`、`disable`。
|
||||
* **`enable_d2c_viewer`**
|
||||
* 发布D2C叠加图像(仅用于测试)。
|
||||
|
||||
### IMU
|
||||
|
||||
* **`enable_accel`** / **`enable_gyro`**
|
||||
* 启用加速度计/陀螺仪并输出其信息话题数据。
|
||||
* **`enable_sync_output_accel_gyro`**
|
||||
* 启用同步 `accel_gyro`,并输出IMU话题实时数据。
|
||||
* **`accel_rate`** / **`gyro_rate`**
|
||||
* 加速度计/陀螺仪的频率。值范围从 `1.5625hz` 到 `32khz`。
|
||||
* **`accel_range`** / **`gyro_range`**
|
||||
* 加速度计(`2g`、`4g`、`8g`、`16g`)和陀螺仪(`16dps` 到 `2000dps`)的范围。
|
||||
* **`enable_accel_data_correction`** / **`enable_gyro_data_correction`**
|
||||
* 启用加速度计/陀螺仪的数据校正。
|
||||
* **`linear_accel_cov`** / **`angular_vel_cov`**
|
||||
* 线性加速度和角速度的协方差。
|
||||
|
||||
### 深度滤波器
|
||||
|
||||
* **`enable_decimation_filter`**
|
||||
* 启用深度抽取滤波器。使用 `decimation_filter_scale` 设置。
|
||||
* **`enable_hdr_merge`**
|
||||
* 启用深度hdr合并滤波器。使用 `hdr_merge_exposure_1` 等设置。
|
||||
* **`enable_sequence_id_filter`**
|
||||
* 启用深度序列id滤波器。使用 `sequence_id_filter_id` 设置。
|
||||
* **`enable_threshold_filter`**
|
||||
* 启用深度阈值滤波器。使用 `threshold_filter_max`、`threshold_filter_min` 设置。
|
||||
* **`enable_hardware_noise_removal_filter`**
|
||||
* 启用深度硬件降噪滤波器。
|
||||
* **`enable_noise_removal_filter`**
|
||||
* 启用深度软件降噪滤波器。使用 `noise_removal_filter_min_diff` 等设置。
|
||||
* **`enable_spatial_filter`**
|
||||
* 启用深度空间滤波器。使用 `spatial_filter_alpha` 等设置。
|
||||
* **`enable_temporal_filter`**
|
||||
* 启用深度时间滤波器。使用 `temporal_filter_diff_threshold` 等设置。
|
||||
* **`enable_hole_filling_filter`**
|
||||
* 启用深度孔洞填充滤波器。使用 `hole_filling_filter_mode` 设置。
|
||||
* **`enable_spatial_fast_filter`**
|
||||
* 启用深度空间快速滤波器。使用 `spatial_fast_filter_radius` 设置。
|
||||
* **`enable_spatial_moderate_filter`**
|
||||
* 启用深度空间中等滤波器。使用 `spatial_moderate_filter_diff_threshold` 等设置。
|
||||
|
||||
---
|
||||
|
||||
> **_重要_**:请仔细阅读 [此链接](https://www.orbbec.com/docs/g330-use-depth-post-processing-blocks/) 中有关软件滤波设置的说明。如果不确定,请勿修改这些设置。
|
||||
@@ -0,0 +1,53 @@
|
||||
## 在ROS 2中启用和可视化点云
|
||||
|
||||
本节演示如何从相机节点启用点云数据输出并使用RViz2进行可视化。
|
||||
|
||||
### 启用深度点云
|
||||
|
||||
#### 启用深度点云的命令
|
||||
|
||||
要激活深度信息的点云数据流,使用以下命令:
|
||||
|
||||
```bash
|
||||
ros2 launch orbbec_camera gemini_330_series.launch.py enable_point_cloud:=true
|
||||
```
|
||||
|
||||
#### 在RViz2中可视化深度点云
|
||||
|
||||
运行上述命令后,执行以下步骤可视化深度点云:
|
||||
|
||||
1. 打开RViz2。
|
||||
2. 添加 `PointCloud2` 显示。
|
||||
3. 选择 `/camera/depth/points` 话题进行可视化。
|
||||
4. 将固定帧设置为 `camera_link` 以正确对齐数据。
|
||||
|
||||
- **可视化示例**
|
||||
|
||||
深度点云在RViz2中可能如下所示:
|
||||
|
||||

|
||||
|
||||
### 启用彩色点云
|
||||
|
||||
#### 启用彩色点云的命令
|
||||
|
||||
要启用彩色点云功能,输入以下命令:
|
||||
|
||||
```bash
|
||||
ros2 launch orbbec_camera gemini_330_series.launch.py enable_colored_point_cloud:=true
|
||||
```
|
||||
|
||||
#### 在RViz2中可视化彩色点云
|
||||
|
||||
要可视化彩色点云数据:
|
||||
|
||||
1. 执行命令后启动RViz2。
|
||||
2. 添加 `PointCloud2` 显示面板。
|
||||
3. 从列表中选择 `/camera/depth_registered/points` 话题。
|
||||
4. 确保固定帧设置为 `camera_link`。
|
||||
|
||||
- **可视化示例**
|
||||
|
||||
RViz2中彩色点云的结果应该如下所示:
|
||||
|
||||

|
||||
@@ -0,0 +1,268 @@
|
||||
# 所有可用的相机控制服务
|
||||
|
||||
> **注意:** 与特定数据流相关的服务(例如 `/camera/set_color_*`)仅在启动文件中启用该数据流时可用(例如 `enable_color:=true`)。
|
||||
|
||||
### 数据流控制
|
||||
|
||||
#### 彩色流
|
||||
* `/camera/toggle_color`
|
||||
```bash
|
||||
ros2 service call /camera/toggle_color std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/get_color_exposure` & `/camera/get_color_gain`
|
||||
```bash
|
||||
ros2 service call /camera/get_color_exposure orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
ros2 service call /camera/get_color_gain orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
```
|
||||
* `/camera/set_color_auto_exposure`
|
||||
```bash
|
||||
ros2 service call /camera/set_color_auto_exposure std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/set_color_exposure` & `/camera/set_color_gain`
|
||||
```bash
|
||||
ros2 service call /camera/set_color_exposure orbbec_camera_msgs/srv/SetInt32 '{data: 1}'
|
||||
ros2 service call /camera/set_color_gain orbbec_camera_msgs/srv/SetInt32 '{data: 64}'
|
||||
```
|
||||
* `/camera/set_color_mirror`, `/camera/set_color_flip`, `/camera/set_color_rotation`
|
||||
```bash
|
||||
ros2 service call /camera/set_color_mirror std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/set_color_flip std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/set_color_rotation orbbec_camera_msgs/srv/SetInt32 '{data: 180}'
|
||||
```
|
||||
* `/camera/set_color_ae_roi`
|
||||
```bash
|
||||
# data_param: [左, 右, 上, 下]
|
||||
ros2 service call /camera/set_color_ae_roi orbbec_camera_msgs/srv/SetArrays '{data_param: [0,1279,0,719]}'
|
||||
```
|
||||
|
||||
#### 深度流
|
||||
* `/camera/toggle_depth`
|
||||
```bash
|
||||
ros2 service call /camera/toggle_depth std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/get_depth_exposure` & `/camera/get_depth_gain`
|
||||
```bash
|
||||
ros2 service call /camera/get_depth_exposure orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
ros2 service call /camera/get_depth_gain orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
```
|
||||
* `/camera/set_depth_auto_exposure`
|
||||
```bash
|
||||
ros2 service call /camera/set_depth_auto_exposure std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/set_depth_exposure` & `/camera/set_depth_gain`
|
||||
```bash
|
||||
ros2 service call /camera/set_depth_exposure orbbec_camera_msgs/srv/SetInt32 '{data: 3000}'
|
||||
ros2 service call /camera/set_depth_gain orbbec_camera_msgs/srv/SetInt32 '{data: 64}'
|
||||
```
|
||||
* `/camera/set_depth_mirror`, `/camera/set_depth_flip`, `/camera/set_depth_rotation`
|
||||
```bash
|
||||
ros2 service call /camera/set_depth_mirror std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/set_depth_flip std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/set_depth_rotation orbbec_camera_msgs/srv/SetInt32 '{data: 180}'
|
||||
```
|
||||
* `/camera/set_depth_ae_roi`
|
||||
```bash
|
||||
# data_param: [左, 右, 上, 下]
|
||||
ros2 service call /camera/set_depth_ae_roi orbbec_camera_msgs/srv/SetArrays '{data_param: [0,847,0,479]}'
|
||||
```
|
||||
|
||||
#### 红外流
|
||||
* `/camera/toggle_ir`
|
||||
|
||||
```bash
|
||||
ros2 service call /camera/toggle_ir std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/get_ir_exposure` & `/camera/get_ir_gain`
|
||||
```bash
|
||||
ros2 service call /camera/get_ir_exposure orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
ros2 service call /camera/get_ir_gain orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
```
|
||||
* `/camera/set_ir_long_exposure`
|
||||
```bash
|
||||
ros2 service call /camera/set_ir_long_exposure std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/set_ir_auto_exposure`
|
||||
```bash
|
||||
ros2 service call /camera/set_ir_auto_exposure std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/set_ir_exposure` & `/camera/set_ir_gain`
|
||||
```bash
|
||||
ros2 service call /camera/set_ir_exposure orbbec_camera_msgs/srv/SetInt32 '{data: 3000}'
|
||||
ros2 service call /camera/set_ir_gain orbbec_camera_msgs/srv/SetInt32 '{data: 64}'
|
||||
```
|
||||
* `/camera/set_ir_mirror`, `/camera/set_ir_flip`, `/camera/set_ir_rotation`
|
||||
```bash
|
||||
ros2 service call /camera/set_ir_mirror std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/set_ir_flip std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/set_ir_rotation orbbec_camera_msgs/srv/SetInt32 '{data: 180}'
|
||||
```
|
||||
* `/camera/switch_ir`
|
||||
```bash
|
||||
ros2 service call /camera/switch_ir orbbec_camera_msgs/srv/SetString '{data: left}'
|
||||
```
|
||||
|
||||
#### 所有数据流
|
||||
* `/camera/get_streams_enable` & `/camera/set_streams_enable`
|
||||
```bash
|
||||
ros2 service call /camera/get_streams_enable orbbec_camera_msgs/srv/GetBool '{}'
|
||||
ros2 service call /camera/set_streams_enable std_srvs/srv/SetBool '{data: false}'
|
||||
```
|
||||
|
||||
### 传感器与发射器控制
|
||||
|
||||
* `/camera/set_auto_white_balance` & `/camera/get_auto_white_balance`
|
||||
```bash
|
||||
ros2 service call /camera/set_auto_white_balance std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/get_auto_white_balance orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
```
|
||||
* `/camera/set_white_balance` & `/camera/get_white_balance`
|
||||
```bash
|
||||
ros2 service call /camera/set_white_balance orbbec_camera_msgs/srv/SetInt32 '{data: 2800}'
|
||||
ros2 service call /camera/get_white_balance orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
```
|
||||
* `/camera/set_laser_enable`
|
||||
```bash
|
||||
ros2 service call /camera/set_laser_enable std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
`/camera/get_laser_status`
|
||||
```bash
|
||||
ros2 service call /camera/get_laser_status orbbec_camera_msgs/srv/GetBool '{}'
|
||||
```
|
||||
* `/camera/set_ldp_enable` & `/camera/get_ldp_status`
|
||||
```bash
|
||||
ros2 service call /camera/set_ldp_enable std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/get_ldp_status orbbec_camera_msgs/srv/GetBool '{}'
|
||||
```
|
||||
* `/camera/set_ptp_config` & `/camera/get_ptp_config`
|
||||
```bash
|
||||
ros2 service call /camera/set_ptp_config std_srvs/srv/SetBool '{data: true}'
|
||||
ros2 service call /camera/get_ptp_config orbbec_camera_msgs/srv/GetBool '{}'
|
||||
```
|
||||
* `/camera/get_lrm_measure_distance`
|
||||
```bash
|
||||
ros2 service call /camera/get_lrm_measure_distance orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
```
|
||||
* `/camera/set_fan_work_mode`
|
||||
```bash
|
||||
ros2 service call /camera/set_fan_work_mode orbbec_camera_msgs/srv/SetInt32 '{data: 0}'
|
||||
```
|
||||
* `/camera/set_floor_enable`
|
||||
```bash
|
||||
ros2 service call /camera/set_floor_enable std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
|
||||
### 设备信息与管理
|
||||
|
||||
* `/camera/get_device_info`
|
||||
```bash
|
||||
ros2 service call /camera/get_device_info orbbec_camera_msgs/srv/GetDeviceInfo
|
||||
```
|
||||
* `/camera/get_sdk_version`
|
||||
```bash
|
||||
ros2 service call /camera/get_sdk_version orbbec_camera_msgs/srv/GetString
|
||||
```
|
||||
* `/camera/reboot_device`
|
||||
```bash
|
||||
ros2 service call /camera/reboot_device std_srvs/srv/Empty '{}'
|
||||
```
|
||||
|
||||
### 同步与触发
|
||||
|
||||
* `/camera/send_software_trigger`
|
||||
```bash
|
||||
ros2 service call /camera/send_software_trigger std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/set_sync_hosttime`
|
||||
```bash
|
||||
ros2 service call /camera/set_sync_hosttime std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/set_reset_timestamp`
|
||||
```bash
|
||||
# 仅在time_domain参数设置为device时可用
|
||||
ros2 service call /camera/set_reset_timestamp std_srvs/srv/SetBool '{data: true}'
|
||||
```
|
||||
* `/camera/set_sync_interleaverlaser`
|
||||
```bash
|
||||
# 仅在interleave_ae_mode为'laser'且interleave_frame_enable为true时可用
|
||||
ros2 service call /camera/set_sync_interleaverlaser orbbec_camera_msgs/srv/SetInt32 '{data: 0}'
|
||||
```
|
||||
|
||||
### 深度滤波器配置
|
||||
|
||||
* `/camera/set_filter`
|
||||
```bash
|
||||
# 设置DecimationFilter
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: DecimationFilter, filter_enable: false, filter_param: [5]}'
|
||||
|
||||
# 设置SpatialAdvancedFilter
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: SpatialAdvancedFilter, filter_enable: true, filter_param: [0.5,160,1,8]}'
|
||||
|
||||
# 设置SequenceIdFilter
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: SequenceIdFilter, filter_enable: true, filter_param: [1]}'
|
||||
|
||||
# 设置ThresholdFilter
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: ThresholdFilter, filter_enable: true, filter_param: [0,15999]}'
|
||||
|
||||
# 设置NoiseRemovalFilter
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: NoiseRemovalFilter, filter_enable: true, filter_param: [256,80]}'
|
||||
|
||||
# 设置HardwareNoiseRemoval
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: HardwareNoiseRemoval, filter_enable: true, filter_param: []}'
|
||||
|
||||
# 设置SpatialFastFilter
|
||||
# filter_param: [radius]
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: SpatialFastFilter, filter_enable: true, filter_param: [4]}'
|
||||
|
||||
# 设置SpatialModerateFilter
|
||||
# filter_param: [disp_diff, magnitude, radius]
|
||||
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: SpatialModerateFilter, filter_enable: true, filter_param: [160,1,3]}'
|
||||
```
|
||||
|
||||
### 数据捕获与校准管理
|
||||
|
||||
* `/camera/save_images`
|
||||
```bash
|
||||
ros2 service call /camera/save_images std_srvs/srv/Empty '{}'
|
||||
```
|
||||
* `/camera/save_point_cloud`
|
||||
```bash
|
||||
ros2 service call /camera/save_point_cloud std_srvs/srv/Empty '{}'
|
||||
```
|
||||
|
||||
> **注意**:以下服务目前仅支持435Le模块。每个服务一次只能存储一组数据或字符串。
|
||||
|
||||
* `/camera/write_customer_data` & `/camera/read_customer_data`
|
||||
```bash
|
||||
ros2 service call /camera/write_customer_data orbbec_camera_msgs/srv/SetString '{data: "string"}'
|
||||
ros2 service call /camera/read_customer_data orbbec_camera_msgs/srv/GetString '{}'
|
||||
```
|
||||
* `/camera/set_user_calib_params` & `/camera/get_user_calib_params`
|
||||
```bash
|
||||
ros2 service call /camera/set_user_calib_params orbbec_camera_msgs/srv/SetUserCalibParams \
|
||||
'{k: [614.9613647460938, 0.0, 634.91552734375,
|
||||
0.0, 614.65771484375, 391.407470703125,
|
||||
0.0, 0.0, 1.0],
|
||||
d: [-0.03131488710641861,
|
||||
0.032955970615148544,
|
||||
9.096559369936585e-05,
|
||||
-0.0003368517500348389,
|
||||
-0.01115430984646082,
|
||||
0.0, 0.0, 0.0],
|
||||
rotation: [0.9999880790710449, 0.0003024190664291382, -0.004874417092651129,
|
||||
-0.0002965621242765337, 0.9999992251396179, 0.001202247804030776,
|
||||
0.004874777048826218, -0.0012007878394797444, 0.9999874234199524],
|
||||
translation: [-0.023897956848144532,
|
||||
-9.439220279455185e-05,
|
||||
-6.804073229432106e-06]}'
|
||||
ros2 service call /camera/get_user_calib_params orbbec_camera_msgs/srv/GetUserCalibParams '{}'
|
||||
```
|
||||
|
||||
### 点云下采样
|
||||
* `/camera/set_point_cloud_decimation`
|
||||
```bash
|
||||
ros2 service call /camera/set_point_cloud_decimation orbbec_camera_msgs/srv/SetInt32 '{data: 8}'
|
||||
```
|
||||
* `/camera/get_point_cloud_decimation`
|
||||
```bash
|
||||
ros2 service call /camera/get_point_cloud_decimation orbbec_camera_msgs/srv/GetInt32 '{}'
|
||||
```
|
||||
@@ -0,0 +1,67 @@
|
||||
# 可用话题
|
||||
|
||||
话题按数据流和功能组织。默认情况下,所有话题都发布在 `/camera` 命名空间下,可以通过 `camera_name` 启动参数进行更改。
|
||||
|
||||
> **注意:** 特定数据流的话题(例如 `/camera/color/...`)只有在相应的启动参数(例如 `enable_color`)设置为 `true` 时才会发布。
|
||||
|
||||
### 图像流
|
||||
|
||||
这些话题提供每个启用的相机数据流的原始图像数据和相应的校准信息。对于 `color`、`depth`、`ir`、`left_ir` 和 `right_ir` 数据流,模式是一致的。
|
||||
|
||||
* `/camera/color/image_raw`
|
||||
* 彩色流的原始图像数据。
|
||||
* `/camera/color/camera_info`
|
||||
* 彩色流的相机校准数据和元数据。
|
||||
* `/camera/color/metadata`
|
||||
* 来自彩色流固件的底层元数据。
|
||||
|
||||
* `/camera/depth/image_raw`
|
||||
* 深度流的原始图像数据。
|
||||
* `/camera/depth/camera_info`
|
||||
* 深度流的相机校准数据和元数据。
|
||||
* `/camera/depth/metadata`
|
||||
* 来自深度流固件的底层元数据。
|
||||
|
||||
* `/camera/ir/image_raw`
|
||||
* 红外(IR)流的原始图像数据。
|
||||
* `/camera/ir/camera_info`
|
||||
* IR流的相机校准数据和元数据。
|
||||
* `/camera/ir/metadata`
|
||||
* 来自IR流固件的底层元数据。
|
||||
|
||||
### 点云话题
|
||||
|
||||
* `/camera/depth/points`
|
||||
* 从深度流生成的点云数据。
|
||||
* **条件:** 仅在 `enable_point_cloud` 为 `true` 时发布。
|
||||
|
||||
* `/camera/depth_registered/points`
|
||||
* 彩色点云数据,其中深度点配准到彩色图像帧。
|
||||
* **条件:** 仅在 `enable_colored_point_cloud` 为 `true` 时发布。
|
||||
|
||||
### IMU话题
|
||||
|
||||
惯性测量单元(IMU)话题提供加速度计和陀螺仪数据。其行为取决于同步设置。
|
||||
|
||||
* `/camera/accel/sample`
|
||||
* 单独的加速度计数据流。
|
||||
* **条件:** 在 `enable_accel` 为 `true` 且 `enable_sync_output_accel_gyro` 为 `false` 时发布。
|
||||
|
||||
* `/camera/gyro/sample`
|
||||
* 单独的陀螺仪数据流。
|
||||
* **条件:** 在 `enable_gyro` 为 `true` 且 `enable_sync_output_accel_gyro` 为 `false` 时发布。
|
||||
|
||||
* `/camera/gyro_accel/sample`
|
||||
* 包含加速度计和陀螺仪数据的同步数据流(单条消息)。
|
||||
* **条件:** 在 `enable_sync_output_accel_gyro` 为 `true` 时发布。
|
||||
|
||||
### 设备状态与诊断
|
||||
|
||||
* `/camera/device_status`
|
||||
* 报告相机设备的当前状态。
|
||||
|
||||
* `/camera/depth_filter_status`
|
||||
* 报告深度传感器后处理滤波器的状态。
|
||||
|
||||
* `/diagnostics`
|
||||
* 发布相机节点的诊断信息。目前包括设备温度。
|
||||
Reference in New Issue
Block a user