Servers by jDrones

Ardupilot SITL + gazebo on different computers

I followed the SITL+gazebo tutorial ( using the plugin ( and I was able to run SITL + gazebo in the same computer.

However, I want to be able to run SITL in one computer and gazebo in another one, is it possible to pass the address of the gazebo computer as a parameter when starting


I have been struggling with the same issue over a week by now. According to the source, it seems that in libraries/AP_HAL_SITL/SITL_cmdline.cpp is the place where SITL is started. And at line 91, its clearly stated that simulator address can be specified as a command-line argument. According to my knowledge, this must be the address of Gazebo host. Now the thing is that this SITL is started via somehow I guess, and I haven’t found a way yet how to pass that sim_address to SITIL via sim_vehicle. Pull request for this feature ( also did not give much light about it. Only changes in are new frame types. Might it be that it comes somehow from model definition?

Now at gazebo side. There also should be this functionality implemented by this pull request:
If I’m not mistaken, it should allow specifying fdm_addr via model sdf configuration. I gave it a try, but when gazebo starts up, then UI still displays fdm_address as localhost. So I have to dig little deeper in that. Might be that my model configurations are somehow mixed up.

Anyway, it would be nice if someone can share some light in that matter.

Note, I’m not much familiar with either c++ nor ardupilot logic, so statements above are just assumptions made by searching through the source code.


@kpihus Re passing the address of the other computer running gazebo, you’ll have to use the -A arg in to pass the next argument to the SITL instance.

$ --help
                        pass arguments to SITL instance

The arguments of the SITL instance are here -

The one for address is --sim-address
Therefore, something like ... -A --sim-address=

Change to the correct address of the other machine
Not sure about how to change it from the Gazebo side

Hope this helps!

Hi, @rajat2004 thankyou for that. I’ll give it a try asap.
Allready fixed gazebo side, i was editing wrong model file :slight_smile:

Still not good enogh. As i understand i have to specify frametype as gazebo-iris with -f flag. But in this case, it cant connect to mavproxy. At least it keeps waiting heartbeat from tcp:
If i choos frame type as X for example, then it seems to work fine, but of course it does not open gazebo connection.
Any ideas?

Ok, i get it, it needs gazebo connection i order to start mavproxy, right? Seems that i have still some issues there.


I have a feeling that something is still wrong.
SITL starts with messages:

Set parameter SIM_SPEEDUP to 1.000000
Starting SITL Gazebo
Bind for SITL in
Setting Gazebo interface to 
Starting sketch 'ArduCopter'
Starting SITL input

Now that Bind for SITL in Is that correct? I presume it should listen on machines external address, in my case on ?

It’s old post but, somebody solve this issue ?

Here’s an example of how to configure SITL and Gazebo so they can run on different machines. In this case we’re running:

  • Gazebo on a macOS machine with address
  • SITL on an Ubuntu VM machine with address

We’ll use the iris_with_ardupilot model from the ardupilot_gazebo repo.

Configure the Gazebo model

Edit the SDF the ardupilot_gazebo plugin in models/iris_with_ardupilot/model.sdf to read:

<plugin name="ardupilot_plugin" filename="">
  <!-- Port settings for the machine running Gazebo -->

  <!-- Port settings for the machine running SITL -->

  <!-- control elements etc... -->


Reinstall the model with:

~/ardupilot_gazebo$ mkdir build && cd build && make -j4 && make install

then launch Gazebo (on with:

~/ardupilot_gazebo$ gazebo --verbose worlds/

It’s a little confusing as <fdm_addr> is actually the address of the SITL machine and the flight dynamics in this case is being supplied by Gazebo to SITL.

The ardupilot_plugin will bind to the socket and listen for messages from SITL. It will attempt to connect to and then send messages to SITL.


On the machine that you’re running SITL ( launch a session with:

$ \
  -v ArduCopter \
  -f gazebo-iris \
  --console \

Note that you must place the additional SITL instance arguments in quotes. You don’t need to specify the ports --sim-port-in-9002 and --sim-port-out=9003 as we are using the defaults.

In the SITL console you should see something like:

Setting SIM_SPEEDUP=1.000000
Starting SITL Gazebo
Bind for SITL in
Setting Gazebo interface to
Starting sketch 'ArduCopter'
Starting SITL input
Using Irlock at port : 9005
bind port 5760 for 0
Serial port 0 on TCP port 5760
Waiting for connection ....
Connection on serial port 5760
Loaded defaults from /home/rhys/Code/ardupilot/ardupilot/Tools/autotest/default_params/copter.parm,/home/rhys/Code/ardupilot/ardupilot/Tools/autotest/default_params/gazebo-iris.parm
bind port 5762 for 2
Serial port 2 on TCP port 5762
bind port 5763 for 3
Serial port 3 on TCP port 5763
MKFIFO failed with File exists
MKFIFO failed with File exists
Home: -35.363262 149.165237 alt=584.000000m hdg=353.000000
bus.bus=0 address=0x55
bus.bus=1 address=0x55
bus.bus=0 address=0x38
bus.bus=0 address=0x39
bus.bus=1 address=0x38
bus.bus=1 address=0x39
bus.bus=2 address=0x38
bus.bus=2 address=0x39
bus.bus=3 address=0x38
bus.bus=3 address=0x39
bus.bus=0 address=0x38
bus.bus=0 address=0x39
validate_structures:489: Validating structures
Loaded defaults from /home/rhys/Code/ardupilot/ardupilot/Tools/autotest/default_params/copter.parm,/home/rhys/Code/ardupilot/ardupilot/Tools/autotest/default_params/gazebo-iris.parm

Here SITL is binding to a datagram (udp) socket on the local machine. In the
ArduPilot SITL code the socket is binding to not
as reported. That’s important as the socket bound to will listen
to all network interfaces not just the local machine (which is why Gazebo can then
connect to it, whereas it could not connect to the loopback address).

Thank you very much for help.

Servers by jDrones