# Execute AI model inference with `qrb_ros_nn_inference` [qrb_ros_nn_inference](https://github.com/qualcomm-qrb-ros/qrb_ros_nn_inference) is a ROS2 package for performing neural network model, providing AI-based perception for robotics applications. - 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 Here comes the pipeline for `qrb_ros_nn_inference`:
qrb_ros_nn_inference node
/qrb_inference_input_tensor
/qrb_inference_output_tensor
msg type: qrb_ros_tensor_list_msgs
msg type: qrb_ros_tensor_list_msgs
pre-process node
post-process node
QRB ROS NN Inference
**Figure : `qrb_ros_nn_inference` pipeline** ## ROS topics used in the `qrb_ros_nn_inference` pipeline | ROS topic | Message type | Published/Subscribed by | Description | | --- | --- | --- | --- | | `/qrb_inference_input_tensor` | `qrb_ros_tensor_list_msgs::msg::TensorList` | Subscribed by `qrb_ros_nn_inference` | Subscribes to the input tensor for model inference. | | `/qrb_inference_output_tensor` | `qrb_ros_tensor_list_msgs::msg::TensorList` | Published by `qrb_ros_nn_inference` | Publishes the output tensor of model. | ## ROS node parameters used in the `qrb_ros_nn_inference` pipeline | Node parameter | Type | Default value | Description | | --- | --- | --- | --- | | `backend_option` | `string` | `""` | Hardware acceleration option for model inference. For valid values, see [qrb_ros_nn_inference documentation](https://github.com/qualcomm-qrb-ros/qrb_ros_nn_inference/blob/main/qrb_inference_manager/Documentation.md#2.1). | | `model_path` | `string` | `""` | Indicates the path of the model file. | ## Prerequisites - You have **Set up the device** according to [Set up the environment for running sample applications](https://docs.qualcomm.com/doc/80-70033-265/topic/quick_start.html#setup-demo-qs). - You have downloaded the model from [QC AI hub](https://aihub.qualcomm.com). - You have prepared the preprocess node and postprocess node according to the [qrb_ros_nn_inference example](https://github.com/qualcomm-qrb-ros/qrb_ros_nn_inference/tree/main/test). ## Run out-of-the-box `qrb_ros_nn_inference` **Steps** 1. Start one terminal, and run the following commands to set up QIR SDK and ROS2 environment on the device. Value range of `ROS_DOMAIN_ID`: [0, 232] ssh root@[ip-addr] (ssh) mount -o remount,rw /usr (ssh) source /usr/share/qirp-setup.sh (ssh) export ROS_DOMAIN_ID=xx Copy to clipboard 2. Launch three nodes: preprocess node, `qrb_ros_nn_inference` node and postprocess node. (ssh) ros2 launch model_inference.launch.py Copy to clipboard ## Build and run `qrb_ros_nn_inference` **Steps** 1. Build `qrb_ros_nn_inference` provided by the QIR SDK on the host. cd source setup.sh cd qirp-samples/platform/qrb_ros_nn_inference colcon build --merge-install --cmake-args ${CMAKE_ARGS} Copy to clipboard 2. Push `qrb_ros_nn_inference` to the device. Note Ensure that the QIR SDK is installed on the device. cd qirp-samples/platform/qrb_ros_nn_inference/install tar czvf qrb_ros_nn_inference.tar.gz include lib share scp qrb_ros_nn_inference.tar.gz root@[ip-addr]:/opt/ ssh root@[ip-addr] (ssh) mount -o remount,rw /usr (ssh) tar --no-overwrite-dir --no-same-owner -zxf /opt/qrb_ros_nn_inference.tar.gz -C /usr/ Copy to clipboard 3. Start one terminal, and run the following commands to set up QIR SDK and ROS2 environment on the device. Value range of `ROS_DOMAIN_ID`: [0, 232] ssh root@[ip-addr] (ssh) mount -o remount,rw /usr (ssh) source /usr/share/qirp-setup.sh (ssh) export ROS_DOMAIN_ID=xx Copy to clipboard 4. Launch three nodes: preprocess node, `qrb_ros_nn_inference` node and postprocess node. (ssh) ros2 launch model_inference.launch.py Copy to clipboard ## Limitation For the latest limitations, see [qrb_ros_nn_inference](https://github.com/qualcomm-qrb-ros/qrb_ros_nn_inference) on GitHub. Last Published: Sep 30, 2026 [Previous Topic Evaluating performance of ROS2 components with qrb\_ros\_benchmark](https://docs.qualcomm.com/bundle/publicresource/80-70033-265/topics/qrb_ros_benchmark.md) [Next Topic Develop applications using the QIR SDK](https://docs.qualcomm.com/bundle/publicresource/80-70033-265/topics/develop_application_with_qirp_sdk.md)