Skip to main content
有关更多信息,请参见 sample_apriltag GitHub 仓库。
Live camera view of AprilTag markers being detected, each overlaid with its tag outline and identifier.

sample_apriltag 的管线流程

下图展示了 sample_apriltag 的管线流程。
AprilTag pipeline from camera capture through color space conversion and rectification to tag detection and pose output.

sample_apriltag 管线。

  • 该管线接收来自 qrb_ros_camera 的 NV12 图像,并将色彩空间转换为 RGB8 格式。
  • 然后,它使用 image_proc 对图像进行校正,并输出 /image_rect。
  • Apriltag 节点检测标签并计算其位姿,位姿通过 /tf 发布。

sample_apriltag 管线中使用的 ROS 节点

下表列出了 sample_apriltag 管线中使用的 ROS 节点,并描述了每个节点的功能。

sample_apriltag 管线中使用的 ROS topic

下表列出了 sample_apriltag 管线中使用的 ROS topic,以及消息类型和发布每个 topic 的节点。

前提条件

您已根据 安装 QIR SDK 在设备上完成设备设置、安装 ROS2 Jazzy 和 Qualcomm Intelligent Robotics (QIR) SDK。

运行开箱即用的 sample_apriltag

1

安装依赖项

Add the package repositories
2

安装 sample_apriltag 软件包

Install the packages
3

启动 AprilTag 管线示例

Start the pipeline
4

将以下 AprilTag 图像放置在摄像头前

5

在开发套件的另一个终端中,运行以下命令

a. 启动一个终端并运行以下命令以检查 apriltag 检测结果。
管线通过 /apriltag/detections 输出检测结果,并通过 /tf 检测标签位姿。b. 要检查 topic 输出,请运行以下命令:
结果:
Output
结果显示检测到的标签为 tagStandard41h12,标签 ID 为 1。

从 sample_apriltag 的源代码构建

当您需要修改示例代码时,可以从源代码构建 sample_apriltag。设备端步骤包括安装依赖项、克隆源代码仓库并构建软件包。

设备端步骤

1

安装依赖项

Install the dependencies
2

从 qrb-ros-sample 仓库下载源代码

Clone the sample repository
3

从源代码构建示例

Build the sample
4

运行并测试

根据 运行开箱即用的 sample_apriltag 的第 2-4 步运行并测试。