Running Gazebo and PX4 SITL in different machines

I would like to run Gazebo and PX4 SITL in different machines, as my laptop struggles running both and the IDE while debugging.

From what I understand the connection between PX4-SITL and Gazebo is done via mavlink UDP messages.

Can the IP the UPD messages are sent and received to/from be changed ? How?

Thanks

On the same subnet set the param MAV_BROADCAST to 1. As you start sitl you can do this on the command line with

param set MAV_BROADCAST 1

You could also try running gazebo headless. That’s the only way it’s usable on my laptop.

HEADLESS=1 make posix_sitl_default gazebo_standard_vtol

Thanks for the command to run gazebo headless, very useful, I had resorted to killing gzclient everytime!

I’m having no luck however with the broadcast.

PX4 blocks with this message:

INFO [simulator] Waiting for initial data on UDP port 14560. Please start the flight simulator to proceed..

Do I have to do something equivalent on the gazebo side?
Is gazebo broadcasting too by default? or sending to localhost?

Thanks

Actually my setup is a bit different. I often run PX4 + gazebo on one machine, and QGC on another. I haven’t tried PX4 on one and Gazebo on another, but I don’t see why it wouldn’t work if you find where the connection is configured.

Here’s where Gazebo opens the mavlink connection. https://github.com/PX4/sitl_gazebo/blob/2c64ddd7419a96df36809411959f87d7b88e6e06/src/gazebo_mavlink_interface.cpp#L430