PX4 Setup for MacOS m3 Sequoia

In the guide there is a spot which says:

If you have an Apple M1, M2 etc..... 

Select Terminal.app and right-click on it, then choose Duplicate.
Rename the duplicated Terminal app, e.g. to x86 Terminal
Now select the renamed x86 Terminal app and right-click and choose *Get Info
...

This has functionality is no longer available and as such I created an alias intel and brew-intel in my .zshenv file:

alias intel='env /usr/bin/arch -x86_64 /bin/zsh --login -c "source ~/.zshrc-intel; exec zsh -l"' 

alias brew_intel="/usr/local/bin/brew"

I’ve also created a separate python env that is created in this shell so that all x86 components are leveraged.

I have not gotten a successful build, although I have successfully created the toolchain, cloned the repo, etc. A lot of the issues look like bad compiled headers from C++ libs. I am reaching out to see if anyone has successfully created an env on Mac OSX15 with m series chip.

Thanks!

Mac Specs
Apple M3 Pro
36 GB
Sequoia 15.5

Nov 2023

A work around that I can live with is through using docker to ensure the environment sets up nicely. I had to use the older Gazebo and VCN to view the GUI.

First, I used docker to pull in the px4 dev simulation (note this terminal becomes the PX4 repl):

docker pull px4io/px4-dev-simulation-focal

Then ran the bash script below:

docker run -it --platform linux/amd64 \
  -p 5900:5900 \
  -p 18570:18570/udp \
  -p 14550:14550/udp \
  -v /Users/YOUR_USER/PX4-Autopilot:/src/PX4-Autopilot \
  -w /src/PX4-Autopilot \
  --shm-size=1gb \
  px4io/px4-dev-simulation-focal bash -c "
    # Install VNC components
    apt-get update && apt-get install -y x11vnc xvfb openbox mesa-utils
    
    # Start virtual display
    export DISPLAY=:1
    Xvfb :1 -screen 0 1280x1024x24 &
    sleep 3
    
    # Start window manager
    openbox &
    sleep 2
    
    # Start VNC server
    x11vnc -display :1 -nopw -listen 0.0.0.0 -xkb -rfbport 5900 -forever -shared &
    sleep 5
    
    # Set up environment
    export LIBGL_ALWAYS_SOFTWARE=1
    export PX4_SIM_HOST_ADDR=0.0.0.0
    
    echo 'VNC server running on port 5900'
    echo 'Connect with VNC viewer to localhost:5900'
    echo 'MAVLink available on UDP port 14550'
    
    # Build and run PX4
    make clean
    make px4_sitl_default gazebo-classic_iris
  "

Then opening up a VNC Viewer I was able to view the drone.


I am still fighting with qgroundcontrol to communicate with the docker container, but I might just throw it in docker if it doesn’t work.