Skip to main content
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 for qrb_ros_nn_inference

pipeline

Figure : The pipeline of qrb_ros_nn_inference

ROS topics used in the qrb_ros_nn_inference pipeline

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

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. 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) source /usr/share/qirp-setup.sh
    (ssh) export ROS_DOMAIN_ID=xx
    
  2. Launch three nodes: preprocess node, qrb_ros_nn_inference node and postprocess node.
    (ssh) ros2 launch model_inference.launch.py
    

Build and run qrb_ros_nn_inference

  1. Build qrb_ros_nn_inference provided by the QIR SDK on the host.
    cd <qirp_decompressed_workspace>
    source setup.sh
    cd qirp-samples/platform/qrb_ros_nn_inference
    colcon build --merge-install --cmake-args ${CMAKE_ARGS}
    
  2. Push qrb_ros_nn_inference to the device.
    NoteEnsure 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) tar --no-overwrite-dir --no-same-owner -zxf /opt/qrb_ros_nn_inference.tar.gz -C /usr/ros/jazzy/
    
  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) source /usr/share/qirp-setup.sh
    (ssh) export ROS_DOMAIN_ID=xx
    
  4. Launch three nodes: preprocess node, qrb_ros_nn_inference node and postprocess node.
    (ssh) ros2 launch model_inference.launch.py
    

Limitation

For the latest limitations, see qrb_ros_nn_inference on GitHub.