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

# 软件设置

全新安装的一次性设置。执行这些步骤一次，然后继续适合您目标的机器人工作流程：[QRB ROS 生态系统](./qrb-ros-overview)或[在 NPU 上运行深度估计](./npu-workflows)。

这些步骤遵循 Ubuntu 上标准的 ROS 2 Jazzy 安装流程。如果您已经熟悉该流程，请参考 [ROS 2 Jazzy 官方安装文档](https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html)——下面的命令与其完全一致。

## 1. 添加 ROS 2 Jazzy 软件源

```bash theme={null}
sudo apt update
sudo apt install -y curl gnupg2 lsb-release ca-certificates software-properties-common locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

sudo add-apt-repository universe -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
  -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
  http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" \
  | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
```

## 2. 安装 ROS 2 Jazzy

```bash theme={null}
sudo apt update
sudo apt install -y ros-jazzy-desktop \
  python3-colcon-common-extensions \
  python3-rosdep \
  python3-argcomplete
sudo rosdep init || true
rosdep update
```

## 3. 配置环境

将以下内容追加到 `~/.bashrc`，以便每个新终端自动 source ROS：

```bash theme={null}
echo 'source /opt/ros/jazzy/setup.bash' >> ~/.bashrc
source ~/.bashrc
```
