Skip to main content
This information demonstrates how to develop a pipeline application using the APIs provided by the QIR SDK. You can learn the basic workflow and write an example pipeline application by following the steps.
InformationWhy do you need to use the QIR SDK to develop a pipeline application?The normal development process requires extensive camera development experience and solid hardware knowledge to write camera-related code and handle image format conversion, while using the QIR SDK saves time and efforts.The following is a comparison between the normal development flow (without QIR SDK) and that uses the QIR SDK.
  • Using QIR SDK: Write a launch file to combine the existing nodes into a pipeline.
  • Without QIR SDK: Write camera-related code or handle image format conversion by yourselves.
The following example demonstrates how to use the QIR SDK to develop a pipeline application.

Pipeline application workflow

To write a pipeline application, you need to follow these workflow:
  1. Define the objective of your application.
  2. Check available APIs provided by the QIR SDK.
  3. Decide the pipeline.

Define the objective

Develop a sample that captures images from the device’s built-in camera and publishes them in RGB888 format to a ROS 2 topic.

Check the APIs

  1. Check the APIs the QIR SDK offers, see QIR SDK API list. A first check finds that qrb_ros_camera is able to capture data from the device’s built-in camera and publish it to the /cam0_stream1 topic. However, this topic uses NV12 encoding format by default, while the application requires the RGB888 format.
  2. Analyze other APIs that may be useful. As qrb_ros_camera doesn’t output the image in the format as needed, a further check finds the following matching ROS node: qrb_ros_colorspace_convert is able to convert image encoding from NV12 to RGB888.
  3. Locate the key points for the implementation. qrb_ros_camera publishes to the /cam0_stream1 topic, but the input for qrb_ros_colorspace_convert is /image_raw. Therefore, the example application needs to handle this conflict with additional processing.

Decide the pipeline

The following information analyzes the pipeline application requirements in detail as an example solution. Pipeline flow This example uses the following pipeline flow based on the analysis:
  1. Capture images from qrb_ros_camera and publish them to the /cam0_stream1 topic.
  2. Convert the images from NV12 to RGB888 format using qrb_ros_colorspace_convert and publish the RGB888 format images to the /image topic.

Example implementation

The following steps guide you through using the QIR SDK to write the pipeline based on the example solution and run it on the device, using the Qualcomm Dragonwing™ IQ-9075 Evaluation Kit (see Get started with QIR SDK) as an example.

Set up the cross-compile environment

On the host computer, go to the artifacts directory and decompress the QIR SDK package:
NoteThe QIR SDK supports developing a pipeline application on these development kits for Qualcomm Linux:
You have initialized the QIR SDK environment.

Import the sample project

This example uses the template project provided in the QIR SDK package to develop the pipeline. This template helps you quickly create a Python-based ROS 2 package.
NoteAlternatively, you can create a package on your IQ-9075 device with ros2 pkg create --build-type ament_python --license Apache-2.0 <pkg-name> --dependencies [deps], and then push it to the host with the QIR SDK installed in the environment.
To use the template project in the QIR SDK, go to the following directory:

Customize the launch file

Write the launch file
  1. Create the launch file that implements the following steps. This example uses two nodes qrb_ros_camera and qrb_ros_colorspace_convert. It remaps the /cam0_stream1 topic of qrb_ros_camera to the /image_raw topic, and then uses qrb_ros_colorspace_convert to publish the RGB888 format images to the /image topic.
    NoteFor information about how to write a launch file, see ROS 2 documentation — Creating a launch file.
  2. Update the setup.py file.

Build and deploy

You can now compile the package and deploy it to the device.
1

Build the workspace

2

Package and push the application to the device

3

Install the application on the device

SSH Session
4

Run the application

SSH Session
5

Verify the output

SSH Session
Now you can launch the new pipeline using the ros2 launch command and see the camera data being converted to RGB888 format and published to the /image topic.

Next steps

To build more advanced applications:
  • Use additional QIR APIs such as sensor data streams, diagnostics, or control interfaces.
  • Combine multiple modules to create hybrid applications (for example, autonomous navigation + health monitoring).
  • Learn how to use the QIR SDK to develop AI pipeline applications. See QIR SDK sample applications.
  • Check QIR SDK API list for a full list of available APIs.