Skip to main content
qrb_ros_nn_inference 包为机器人应用提供基于 AI 的感知能力。它提供以下功能:
  • 支持 .tflite、.so、.bin 三种模型格式的模型推理 API
  • 基于 Qualcomm 平台的模型推理加速

qrb_ros_nn_inference 的架构

下图展示了 qrb_ros_nn_interface 的架构。
Layered stack: application, qrb_ros_nn_inference node, QrbInferenceManager, QNN and TFLite SDKs, running on CPU, GPU, and Hexagon Tensor Processor.

qrb_ros_nn_inference 的架构。

qrb_ros_nn_inference 是基于 qrb_inference_manager 的 ROS2 包,后者是一个封装了 Qualcomm AI Engine Direct 和 Qualcomm Neural Network (QNN) Delegate for TensorFlow Lite API 的 C++ 库。 qrb_ros_nn_inference 从特定话题接收数据,然后不做任何处理直接使用接收到的数据进行模型推理。随后,模型推理的结果会通过另一个特定话题直接发送出去。

ROS 节点参数

下表描述了 qrb_ros_nn_inference 的 ROS 节点参数。

ROS 话题

下表描述了 qrb_ros_nn_inference 使用的 ROS 话题。

前提条件

你已根据安装 QIR SDK完成设备设置,并在设备上安装了 ROS2 Jazzy 和 Qualcomm Intelligent Robotics (QIR) SDK。

开箱即用运行 qrb_ros_nn_inference

1

安装 qrb_ros_transport 包

Install the packages
2

为模型推理准备预处理节点和后处理节点

Download the test nodes
3

使用 YOLOv8 检测模型测试 qrb_ros_nn_inference

a. 按照 QC AI hub Getting Started 下载 yolov8.tflite 模型。b. 下载用于目标检测的测试图像。
c. 在 ~/ros-ws/src/qrb_ros_nn_inference/test/qrb_ros_post_process/launch/nn_node_test.launch.py 中指出原始图像路径和模型路径。
nn_node_test.launch.py
d. 构建预处理节点和后处理节点。
Build and run the inference
输出结果图像位于 ~/ros-ws/src/qrb_ros_nn_inference/test/qrb_ros_post_process/inference_result 中。

构建并运行 qrb_ros_nn_inference

1

安装依赖

Install the dependencies
2

将仓库克隆到设备上

Download the source code
3

构建并运行 qrb_ros_nn_inference

Build and launch