This workspace provisions a persistent Podman-based PX4 development and simulation container.
- Uses
workspace/PX4-Autopilotas the persistent host workspace root mounted at/workspace/PX4-Autopilotin the container. - Clones PX4 into
workspace/PX4-Autopilot/px4_src, so your code changes survive container rebuilds. - Builds a local Ubuntu 24.04 image with the official PX4 Ubuntu setup script, ROS 2 Jazzy, colcon / vcs / rosdep, Gazebo bridge packages, MAVROS, and common C++ / ROS tooling.
- Persists
ccache, Gazebo state,pipcache, and shell history understate/. - Uses a repo-local Podman
btrfsgraphroot understate/podman-storage, so it does not depend on the host's default Podman storage driver. - Passes through X11 or Wayland plus
/dev/driwhen available, so Gazebo GUI can run from the container.
The default configuration is pinned to PX4 v1.16.1, which is the latest stable release as of 2026-04-20.
If you want to switch versions, copy .env.example to .env and edit:
cp .env.example .envThen set:
PX4_REF=v1.16.1
PX4_IMAGE_OS=ubuntu:24.04
PX4_LOCAL_IMAGE=localhost/px4-sim-dev:v1.16.1
PX4_ROS_DISTRO=jazzy
PX4_GFX_BACKEND=autocp .env.example .env
chmod +x scripts/*.sh
./scripts/up.sh
./scripts/shell.shDirectly launch the default Gazebo simulation:
./scripts/sitl.shOr choose a different Gazebo target:
./scripts/sitl.sh gz_x500_depthThe gz_x500_realsense target now launches the full RealSense stack inside the
container: PX4 SITL in the craic world, MicroXRCEAgent, ros_gz_bridge parameter_bridge, and rviz2.
This target also publishes a downward RGB camera on
/downward_camera/image_raw with camera info on /downward_camera/camera_info.
Stop the container without deleting your source tree or caches:
./scripts/down.shStart the existing container again without recreating it:
./scripts/up.shForce up.sh to recreate the container from the current image:
PX4_UP_FORCE_RECREATE=1 ./scripts/up.shworkspace/PX4-Autopilot: persistent workspace root shared with the containerworkspace/PX4-Autopilot/px4_src: PX4 source tree and all build outputsstate/ccache: compiler cachestate/gz: Gazebo runtime and model cachestate/pip-cache: Python package cachestate/bash_history: interactive shell historystate/podman-storage: project-local image and container storage used by Podman
scripts/build-image.shbuilds from Ubuntu 24.04, runsTools/setup/ubuntu.sh, and layers ROS 2 Jazzy plus common ROS / vision dependencies on top.:Zis included on bind mounts for Podman SELinux compatibility.scripts/init-px4.shrefuses to switch branches or tags if the PX4 repo has uncommitted changes.- The container uses host networking so QGroundControl or other local tooling can talk to PX4 SITL without extra port mapping.
- If your desktop blocks X11 access, run
xhost +si:localuser:$USERon the host before./scripts/up.sh. PX4_GFX_BACKEND=autonow prefers X11 / GLX when both X11 and Wayland are available, because Gazebo GUI is more stable that way in NVIDIA-backed containers. SetPX4_GFX_BACKEND=waylandif you explicitly want the native Wayland path.