The simulation-side ROS 2 install is the same recipe as the general host PC setup, with one extra package (ros-jazzy-ros-gz) for the Gazebo bridge. This page exists separately because someone setting up only the simulation stack (without ArduPilot SITL) needs a slightly different subset.
Minimal apt install
sudo apt update
sudo apt install -y ros-jazzy-desktop \
ros-jazzy-ros-gz \
ros-jazzy-mavros ros-jazzy-mavros-extras \
ros-jazzy-rmw-cyclonedds-cpp \
python3-colcon-common-extensions python3-rosdep
sudo rosdep init && rosdep update
Why each:
ros-jazzy-desktop— ROS 2 core + rviz + visualization tooling.ros-jazzy-ros-gz— the bridge between ROS 2 topics and Gazebo messages.ros-jazzy-mavros— MAVLink ↔ ROS 2 translation for talking to ArduPilot.ros-jazzy-rmw-cyclonedds-cpp— optional alternative DDS implementation, useful for latency-critical tuning (details).colconandrosdep— the build system and dependency manager.
Environment
echo 'source /opt/ros/jazzy/setup.bash' >> ~/.bashrc
source ~/.bashrc
# Verify
printenv ROS_DISTRO # → jazzy
ros2 doctor # → mostly OK
MAVROS-specific extra step
MAVROS needs the geographiclib datasets for its mavros_extras components:
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
sudo bash ./install_geographiclib_datasets.sh
Skip this and you’ll see MAVLink: GeographicLib datasets are missing warnings — usually non-fatal, but irritating.
Verify
ros2 launch mavros apm.launch.py fcu_url:=tcp://localhost:5760
If MAVROS connects to a running ArduPilot SITL and starts publishing /mavros/state, the install is good.
Where to go next
- Settings hub — env vars and tuning
- ROS 2 Jazzy workspace bootstrap — building your first node
- Host PC setup — the broader install context