Skip to content

Instantly share code, notes, and snippets.

@dbaldwin
Last active January 14, 2026 19:04
Show Gist options
  • Select an option

  • Save dbaldwin/9f9b30ce85f68cc05052a0b44fd7949a to your computer and use it in GitHub Desktop.

Select an option

Save dbaldwin/9f9b30ce85f68cc05052a0b44fd7949a to your computer and use it in GitHub Desktop.
Build PX4 with Docker on Mac M3

PX4 Docker Build on Mac M3

Quick Build Command

docker run --rm -w /src \
  --platform linux/amd64 \
  --env=CCACHE_DIR=/ccache \
  --volume=${HOME}/.ccache:/ccache:rw \
  --volume=$(pwd):/src:rw \
  px4io/px4-dev-nuttx-jammy:latest \
  /bin/bash -c "make ark_pi6x_default"

Replace ark_pi6x_default with your target. Output: build/<target>/<target>.px4

Prerequisites

  • Docker Desktop with Rosetta enabled (Settings → General → "Use Rosetta for x86_64/amd64 emulation")
  • Submodules initialized: git submodule update --init --recursive

Clean Build

rm -rf build/<target>

Modifying DDS Topics

Edit src/modules/uxrce_dds_client/dds_topics.yaml

Add a publication (PX4 → ROS2)

Add to the publications: section:

  - topic: /fmu/out/sensor_optical_flow
    type: px4_msgs::msg::SensorOpticalFlow

Add a subscription (ROS2 → PX4)

Add to the subscriptions: section:

  - topic: /fmu/in/sensor_optical_flow
    type: px4_msgs::msg::SensorOpticalFlow

After modifying topics

Rebuild the firmware—the DDS client code regenerates automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment