Skip to main content
This information describes how to use the QIR SDK toolchain to compile a simple ROS 2 sample application. The demos and code for both Python and C++ development are available as examples.

Install the prebuilt QIR SDK to the host computer

On the host computer, go to the artifacts directory and decompress QIR SDK using the tar command:
cd <decompressed_workspace>/target/qcs9075-iq-9075-evk/qirpsdk_artifacts/qcs9075-iq-9075-evk
tar -zxvf qirp-sdk_<qirp_version>.tar.gz
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.7.0.tar.gz.
  • For all released versions, see Qualcomm® Intelligent Robotics SDK (QIR SDK) 2.0 Release Notes.
  • The QIR SDK supports these development kits for Qualcomm Linux:
    Development kitMachine name
    Qualcomm DragonwingTM IQ-9075 EVKiq-9075-evk
    Qualcomm DragonwingTM IQ-8275 EVKiq-8275-evk

Using QIR SDK to develop applications

  1. Set up the cross-compile environment.
    cd <decompressed_workspace>/target/qcs9075-iq-9075-evk/qirpsdk_artifacts/qcs9075-iq-9075-evk/qirp-sdk
    source setup.sh
    
  2. Fetch the project as the code baseline.
    git clone https://github.com/ros2/demos.git -b jazzy
    
  3. Develop your own application either in C++ or Python.
    1. Develop your own C++ application. The following is an example.
      cd demos/demo_nodes_cpp
      vim src/topics/talker.cpp +46
      
      Change the demo_nodes_cpp/src/topics/talker.cpp msg data in line 46:
      msg_->data = "Hello World : Qualcomm : " + std::to_string(count_++);
      
    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}
      
    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 --no-overwrite-dir --no-same-owner -zxf /opt/demo_nodes_cpp.tar.gz -C /usr/
      
    4. Run the demo application on the device. i. On the first terminal, run these commands:
      (ssh) source /usr/share/qirp-setup.sh
      (ssh) ros2 run demo_nodes_cpp talker
      
      ii. On the second terminal, run these commands:
      (ssh) source /usr/share/qirp-setup.sh
      (ssh) ros2 run demo_nodes_cpp listener
      
    5. Check the output. Terminal 1 output:
      
      [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'
      ...
      
      Terminal 2 output:
      
      [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]
      ...