Skip to main content
qrb_ros_nn_inference is a ROS2 package that runs neural network models on the device, so your robotics application gets AI-based perception without leaving the ROS graph. It provides the following functionalities:
  • Model inference API which supports three model formats:
    • .tflite
    • .so
    • .bin
  • Model inference acceleration based on Qualcomm platforms.

Pipeline flow for qrb_ros_nn_inference

The following figure shows how a preprocess node feeds an input tensor to qrb_ros_nn_inference, which publishes the output tensor to a postprocess node. Preprocess node publishing an input tensor to the nn inference node, which publishes an output tensor to a postprocess node.

Figure : qrb_ros_nn_inference pipeline

ROS topics used in the qrb_ros_nn_inference pipeline

The following table lists the ROS topics in the pipeline, their message types, and the node that publishes or subscribes to each one.
ROS topicMessage typePublished/Subscribed byDescription
/qrb_inference_input_tensorqrb_ros_tensor_list_msgs::msg::TensorListSubscribed by qrb_ros_nn_inferenceSubscribes to the input tensor for model inference.
/qrb_inference_output_tensorqrb_ros_tensor_list_msgs::msg::TensorListPublished by qrb_ros_nn_inferencePublishes the output tensor of model.

ROS node parameters used in the qrb_ros_nn_inference pipeline

The following table lists the node parameters, their types, and their default values.
Node parameterTypeDefault valueDescription
backend_optionstring""Hardware acceleration option for model inference. For valid values, see qrb_ros_nn_inference documentation.
model_pathstring""Indicates the path of the model file.

Prerequisites

Run out-of-the-box qrb_ros_nn_inference

1

Set up QIR SDK and ROS2 environment on the device

Start one terminal, and run the following commands.Value range of ROS_DOMAIN_ID: [0, 232]
SSH Session
2

Launch the nodes

Launch three nodes: preprocess node, qrb_ros_nn_inference node and postprocess node.
SSH Session

Build and run qrb_ros_nn_inference

1

Build qrb_ros_nn_inference on the host

2

Push qrb_ros_nn_inference to the device

NoteEnsure that the QIR SDK is installed on the device.
SSH Session
3

Set up QIR SDK and ROS2 environment on the device

Start one terminal, and run the following commands.Value range of ROS_DOMAIN_ID: [0, 232]
SSH Session
4

Launch the nodes

Launch three nodes: preprocess node, qrb_ros_nn_inference node and postprocess node.
SSH Session

Limitations

For the latest limitations, see qrb_ros_nn_inference on GitHub.