# Develop applications using the QIR SDK

This information guides you to use the QIR SDK to develop your own robot and ROS applications.

The `QIR SDK` installation package provides not only a runtime installation package with an out-of-the-box experience but also a cross-compilation toolchain.
It's located in the `<decompressed_workspace>/target/<dev-kit-name>/qirpsdk_artifacts/<dev-kit-name>` directory.

For example, `qcs6490-rb3gen2-vision-kit` cross-compilation toolchain is located at:

<decompressed_workspace>/target/qcs6490-rb3gen2-vision-kit/qirpsdk_artifacts/qcs6490-rb3gen2-vision-kit
    Copy to clipboard

Following is the directory structure and description of the toolchain:

tree qirp-sdk -L 1
    ├── runtime
    ├── setup.sh
    ├── sample-code
    └── toolchain
    Copy to clipboard

| Name | Description |
| --- | --- |
| `runtime` | This directory contains the run-time environment necessary for executing applications developed with the QIR SDK. It typically includes libraries and binaries that support the running of the applications on the target platform. |
| `setup.sh` | This shell script sets up the development environment for the QIR SDK. Running this script usually configures the necessary environment variables and paths to ensure that the SDK's libraries are correctly accessible for application development and compilation. |
| `sample-code` | This directory houses example applications and code snippets provided as part of the QIR SDK. |
| `toolchain` | This directory contains the cross-compilation toolchain that's part of the QIR SDK. The toolchain includes compilers, linkers, and other utilities needed to build applications for the target platform. This toolchain enables developers to compile their applications on a development machine (host) for execution on the target device (target). |

## Develop a sample ROS2 application

The following example provides a general procedure for developing a ROS application using the QIR SDK, using a ROS2 demo application on GitHub.

### Install the prebuilt `QIR SDK` to the Host

On the host machine, navigate to the artifacts directory and decompress `QIR SDK` using the `tar` command:

> 
> 
> cd <decompressed_workspace>/target/qcs6490-rb3gen2-vision-kit/qirpsdk_artifacts/qcs6490-rb3gen2-vision-kit
>     tar -zxvf qirp-sdk_<qirp_version>.tar.gz
>     Copy to clipboard
> 
> 
> This command generates the `qirp-sdk` directory.

Note

The `qirp-sdk_<qirp_version>.tar.gz` is located in the deployed path of QIR artifacts. The `<qirp_version>` changes with each release, such as 2.0.0, 2.0.1.
For example, the complete package name can be `qirp-sdk_2.3.0.tar.gz`. For all released versions,
see [Qualcomm® Intelligent Robotics SDK (QIR SDK) 2.0 Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/80-75695-1).

### Using QIR SDK to develop applications

1. Set up the cross-compile environment.

cd <decompressed_workspace>/target/qcs6490-rb3gen2-vision-kit/qirpsdk_artifacts/qcs6490-rb3gen2-vision-kit/qirp-sdk
        source setup.sh
        Copy to clipboard
2. Fetch the project as the code baseline.

git clone https://github.com/ros2/demos.git -b jazzy
        Copy to clipboard
3. Develop your own application according either in C++ or Python.

Tab Develop ROS application using C++
Tab Develop ROS application using Python

1. Develop your own application. The following is an example.

cd demos/demo_nodes_cpp
            vim src/topics/talker.cpp +46
            Copy to clipboard

        Change the `demo_nodes_cpp/src/topics/talker.cpp` msg data in line 46:

msg_->data = "Hello World : Qualcomm : " + std::to_string(count_++);
            Copy to clipboard
    2. Set the necessary environment variables and use the colcon tool to build the ROS2 package demo\_nodes\_cpp and its dependencies.

colcon build --merge-install --packages-up-to demo_nodes_cpp --cmake-args ${CMAKE_ARGS}
            Copy to clipboard
    3. Push the demo to the device.

cd demo_nodes_cpp/install
            tar -czvf demo_nodes_cpp.tar.gz lib share
            scp demo_nodes_cpp.tar.gz root@[ip-addr]:/opt/
            ssh root@[ip-addr]
            (ssh) mount -o remount,rw /usr
            (ssh) tar -zxf /opt/demo_nodes_cpp.tar.gz -C /usr/
            Copy to clipboard
    4. Run the demo application on the device.

(ssh) source /usr/share/qirp-setup.sh
            (ssh) ros2 run demo_nodes_cpp talker
            
            open a new terminal, and run the following commands:
            (ssh) source /usr/share/qirp-setup.sh
            (ssh) ros2 run demo_nodes_cpp listener
            Copy to clipboard
    5. Check the output.

The terminal 1 output is as follows:
            [INFO] [1739864779.759719598] [talker]: Publishing: 'Hello World : Qualcomm : 1'
            [INFO] [1739864780.759687179] [talker]: Publishing: 'Hello World : Qualcomm : 2'
            [INFO] [1739864781.760812014] [talker]: Publishing: 'Hello World : Qualcomm : 3'
            ...
            
            The terminal 2 output is as follows:
            
            [INFO] [1739864779.760348380] [listener]: I heard: [Hello World : Qualcomm : 1]
            [INFO] [1739864780.760276535] [listener]: I heard: [Hello World : Qualcomm : 2]
            [INFO] [1739864781.762066296] [listener]: I heard: [Hello World : Qualcomm : 3]
            ...
            Copy to clipboard

1. Develop your own application. The following is an example.

cd demos/demo_nodes_py
            vim demo_nodes_py/topics/talker.py +33
            Copy to clipboard

        Change the `demo_nodes_py/topics/talker.py` msg data in line 33:

msg.data = 'Hello World : Qualcomm : {0}'.format(self.i)
            Copy to clipboard
    2. Set the necessary environment variables and use the colcon tool to build the ROS 2 package demo\_nodes\_py and its dependencies.

colcon build --merge-install --packages-up-to demo_nodes_py
            Copy to clipboard
    3. Push the demo to the device.

cd demo_nodes_py/install
            tar -czvf demo_nodes_py.tar.gz lib share
            scp demo_nodes_py.tar.gz root@[ip-addr]:/opt/
            ssh root@[ip-addr]
            (ssh) mount -o remount,rw /usr
            (ssh) tar -zxf /opt/demo_nodes_py.tar.gz -C /usr/
            Copy to clipboard
    4. Run the demo application on the device.

(ssh) export HOME=/home
            (ssh) source /usr/bin/ros_setup.sh && source /usr/share/qirp-setup.sh
            (ssh) ros2 run demo_nodes_py talker
            
            open a new terminal, and run the following commands:
            (ssh) export HOME=/home
            (ssh) source /usr/bin/ros_setup.sh && source /usr/share/qirp-setup.sh
            (ssh) ros2 run demo_nodes_py listener
            Copy to clipboard
    5. Check the output.

The terminal 1 output is as follows:
            [INFO] [1739864779.759719598] [talker]: Publishing: 'Hello World : Qualcomm : 1'
            [INFO] [1739864780.759687179] [talker]: Publishing: 'Hello World : Qualcomm : 2'
            [INFO] [1739864781.760812014] [talker]: Publishing: 'Hello World : Qualcomm : 3'
            ...
            
            The terminal 2 output is as follows:
            
            [INFO] [1739864779.760348380] [listener]: I heard: [Hello World : Qualcomm : 1]
            [INFO] [1739864780.760276535] [listener]: I heard: [Hello World : Qualcomm : 2]
            [INFO] [1739864781.762066296] [listener]: I heard: [Hello World : Qualcomm : 3]
            ...
            Copy to clipboard

Last Published: Oct 10, 2025

[Previous Topic
Orbbec-camera](https://docs.qualcomm.com/bundle/publicresource/80-70020-265/topics/orbbec-camera_5_2_8.md) [Next Topic
Optional developer workflows](https://docs.qualcomm.com/bundle/publicresource/80-70020-265/topics/optional-workflows.md)