> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up the environment for running sample applications

To successfully run the sample applications provided by the QIR SDK, you must complete the following settings on the host environment and the device to ensure proper running of the subsequent steps.

## Set up the device

Get the device ready for running sample applications by completing the following configurations:

<Tabs>
  <Tab title="IQ-9075 EVK">
    1. Navigate to [Set up the device](../../Linux/devices/iq9075-evk/set-up-the-device) of IQ-9075 documentation.
    2. Complete the following settings:

       a. [Set up the debug UART](../../Linux/devices/iq9075-evk/set-up-the-device#set-up-the-debug-uart).

       b. Connect the device via `Wi-Fi` or `Ethernet` according to [Connect to the device](../../Linux/devices/iq9075-evk/set-up-the-device#connect-to-the-device).
  </Tab>

  <Tab title="IQ-8275 EVK">
    1. Navigate to [Set up the device](../../Linux/devices/iq8275-evk/set-up-the-device) of IQ-8275 documentation.
    2. Complete the following settings:

       a. [Set up the debug UART](../../Linux/devices/iq8275-evk/set-up-the-device#set-up-the-debug-uart).

       b. Connect the device via `Wi-Fi` or `Ethernet` according to [Connect to the device](../../Linux/devices/iq8275-evk/set-up-the-device#connect-to-the-device).
  </Tab>
</Tabs>

## Set up the host computer

Ensure that the Ubuntu host and the device are in the same network by running `ping <device IP address>` on both the host computer and device.

```bash theme={null}
ping <device/host IP address>
```

## Set up the host Docker

The sample applications use ROS 2 Jazzy for communication on the host. You can run the sample applications in one of the following ways:

* **Docker (recommended)**: Configure the Ubuntu 24.04 Docker environment by performing the following steps. This ensures a consistent ROS 2 Jazzy environment regardless of your host Ubuntu version.
* **Host directly**: Install ROS 2 Jazzy on a host machine running Ubuntu 24.04 and run the sample applications directly on the host.

<Tabs>
  <Tab title="Docker (recommended)">
    ### Prerequisites

    Before you begin, ensure that:

    * The host computer is running Ubuntu.
    * Docker Engine is installed.
    * The Docker service is running.
    * The current user belongs to the `docker` group.

          <Note>
            **Note**

            If Docker is not installed, refer to [Docker](troubleshoot#docker).
          </Note>

    1. Download the `qrb_ros_simulation` repository and mesh files.
       ```powershell theme={null}
       mkdir -p ~/qrb_ros_simulation_ws
       cd ~/qrb_ros_simulation_ws
       git clone https://github.com/qualcomm-qrb-ros/qrb_ros_simulation.git
       cd qrb_ros_simulation
       git checkout -b 96b5ac0a8066453a6b176d1064e4b7c688f95ac1
       ```
    2. Build the local Docker image.

       ```bash theme={null}
       chmod +x scripts/docker_build.sh
       bash ./scripts/docker_build.sh
       ```

           <Note>
             **Note**

             If you encounter issues with Docker, see [Troubleshoot common issues](./troubleshoot).
           </Note>
    3. Start a Docker container.

       ```python theme={null}
       chmod +x scripts/docker_run.sh
       bash ./scripts/docker_run.sh
       ```

           <Note>
             **Note**

             The container's remote desktop is protected by the VNC password `qrbrossim` by default. Set your own password by exporting `VNC_PASSWORD` before running the script, for example `VNC_PASSWORD=<your-password> bash ./scripts/docker_run.sh`.
           </Note>
    4. Identify the host IP address that the Docker container and the development kit can reach. On the host, list the interface addresses:
       ```bash theme={null}
       ip -4 addr show
       ```
       Use the IP address on the same network as the development kit. You can verify the address from the device with:
       ```bash theme={null}
       ping <host-interface-ip-address>
       ```
    5. On any computer that can reach the host, open a web browser and go to `http://<host-interface-ip-address>:6080/vnc.html`. Select **Connect** and enter the VNC password to access the container's remote desktop.
    6. In the remote desktop, open a terminal (for example, right-click the desktop and select **Open Terminal Here**) and configure the ROS 2 environment.
       ```bash theme={null}
       source /opt/ros/jazzy/setup.bash
       export ROS_DOMAIN_ID=123
       rqt
       ```

    You have now built the Docker environment for ROS 2 Jazzy. If the environment is configured correctly, the `rqt` window is displayed inside the browser-based remote desktop.

    <Note>
      **Note**

      For how to use `rqt` to view the running effect of the sample applications, see the steps of each sample application.
    </Note>
  </Tab>

  <Tab title="Host directly">
    ### Prerequisites

    Before you begin, ensure that:

    * The host computer is running Ubuntu.

    1. Follow the official [ROS 2 Jazzy Debian package installation guide](https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html) to install ROS 2.

           <Note>
             **Note**

             During the "Install ROS 2" step, install the recommended Desktop version (Desktop Install).
           </Note>
    2. Install gazebo with ROS and other dependencies
       ```bash theme={null}
       sudo apt-get install -y ros-jazzy-ros-gz ros-jazzy-gz-ros2-control ros-jazzy-ros2-controllers
       ```
    3. [Download qrb\_ros\_simulation and meshes files](https://github.com/qualcomm-qrb-ros/qrb_ros_simulation#%E2%80%8D-build-from-source)
  </Tab>
</Tabs>

## Next steps

* [Run the demo application](./run-demo-application)
* [Evaluate more sample applications](./qir-sdk-sample-applications)
* [Develop robotics applications](./develop-applications-using-the-qir-sdk)
