content
# 0) Prereq: make sure ROS 2 Jazzy is installed and sourced
source /opt/ros/jazzy/setup.bash
# 1) Install Nav2 core + bringup (Ubuntu 24.04 / ROS 2 Jazzy)
sudo apt update
sudo apt install -y ros-jazzy-navigation2 ros-jazzy-nav2-bringup
# 2) (Recommended) Install common tools used with Nav2
sudo apt install -y ros-jazzy-nav2-rviz-plugins ros-jazzy-tf2-tools
# 3) Persist ROS sourcing (optional)
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
# 4) Quick sanity check: packages exist
ros2 pkg list | grep -E "navigation2|nav2_bringup" | head
Test:
bash
source /opt/ros/jazzy/setup.bash
echo $ROS_DISTRO
ros2 --help
ros2 pkg list | head
Output:
jazzy
而且 ros2 指令可以正常執行,就代表 ROS 2 Jazzy 基本安裝與環境設定是正常的。