Run MAVROS on Ubuntu in virtual machine and PX4 on MacOS

Hi there,

I am recently trying to set up the simulation environment (PX4+Gazebo+MAVROS) on my new Macbook M1.

What I am currently having are:

  1. PX4 + Gazebo run on my Mac OS smoothly.
  2. MAVROS can run on Ubuntu 20.04 in the virtual machine, Parallels.

The problem I have is how to make them talk to each other? I think it should be reasonable that PX4 sends MAVLink messages through UDP and the MAVROS in Ubuntu should be able to catch them and convert them to the ROS topics.

I guess I didn’t set the IP address correctly when launching MAVROS but I am not an expert on it. Can someone provide me with a solution or a direction I can do some research on how to debug it?

PS: I didn’t run everything in the virtual machine because the simulation in Gazebo was in low frequency while it looks very smooth on macOS. So I am trying to run the simulation on macOS while running ROS on Ubuntu in Parallels.

Many thanks in advance!


I had a error when make px4_sitl gazebo like this:

fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. 
ninja: build stopped: subcommand failed. [1/5] Generating ../../logs 
FAILED: external/Stamp/sitl_gazebo/sitl_gazebo-build 
cd /Users/l/px4/PX4-Autopilot/build/px4_sitl_default/build_gazebo && /usr/local/Cellar/cmake/3.22.1/bin/cmake --build /Users/l/px4/PX4-Autopilot/build/px4_sitl_default/build_gazebo -- -j 0 
ninja: build stopped: subcommand failed. make: *** [px4_sitl] Error 1

look like your mac can work well with px4+gazebo
i am using macos 12.1 and gazebo9.

can you give me some suggestion? thanks

the same problem. Now I realize my buying the m1 was a huge mistake!!!