# \[Bug\] Gazebo Multi-Vehicle Simulation: PX4 not getting connected to multiple vehicles

**URL:** <https://discuss.px4.io/t/bug-gazebo-multi-vehicle-simulation-px4-not-getting-connected-to-multiple-vehicles/48304>\
**Category:** PX4 Autopilot\
**Created:** [January 16, 2026, 10:36am UTC](https://discuss.px4.io/t/bug-gazebo-multi-vehicle-simulation-px4-not-getting-connected-to-multiple-vehicles/48304 "2026-01-16T10:36:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rg-123](https://discuss.px4.io/user_avatar/discuss.px4.io/rg-123/32/19829_2.png) [@rg-123](https://discuss.px4.io/u/rg-123)\
**Post date:** [January 16, 2026, 10:36am UTC](https://discuss.px4.io/t/bug-gazebo-multi-vehicle-simulation-px4-not-getting-connected-to-multiple-vehicles/48304/1 "2026-01-16T10:36:04Z")

</div>

Hi all!

I am trying to simulate multiple planes (advanced plane - 4008) in Gazebo with the latest PX4 version 1.16.0 by following steps from the official docs ([Multi-Vehicle Simulation with Gazebo](https://docs.px4.io/main/en/sim_gazebo_gz/multi_vehicle_simulation)). When only one plane is spawned, I am able to do takeoff using QGC. If I spawn another one, the second one shows some sensor issue (mostly compass not found error) due to which arming isn’t possible.

Below are the steps I have followed.

### **Spawn GZ model and PX4 together**

```auto
PX4_SYS_AUTOSTART=4008 \
PX4_SIM_MODEL=gz_advanced_plane \
./build/px4_sitl_default/bin/px4 -i 0

```

Above command spawns a plane with name `gz_advanced_plane_0`. Spawned next plane with the following command.

```auto
PX4_SYS_AUTOSTART=4008 \
PX4_SIM_MODEL=gz_advanced_plane \
./build/px4_sitl_default/bin/px4 -i 1

```

I can see this plane in QGC, but there are pre-flight errors; below are the logs.

```auto
$ PX4_SYS_AUTOSTART=4008 \
PX4_SIM_MODEL=gz_advanced_plane \
./build/px4_sitl_default/bin/px4 -i 1
INFO [px4] instance: 1
INFO [px4] working directory /home/xxx/PX4-Autopilot/build/px4_sitl_default/rootfs/1

________  _____ 
| ___ \ \ \ / / / |
| |_/ / \ V / / /| |
| __/ / \ / /_| |
| | / /^\ \ \___ |
\_| \/ \/ |_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 1
env SYS_AUTOSTART: 4008
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from 'parameters.bson'
INFO [parameters] BSON document size 324 bytes, decoded 324 bytes (INT32:15, FLOAT:2)
INFO [param] selected parameter backup file parameters_backup.bson
INFO [dataman] data manager file './dataman' size is 1208528 bytes
INFO [init] Gazebo simulator
INFO [init] gazebo already running world: default
INFO [init] Gazebo world is ready
INFO [init] Spawning model
INFO [gz_bridge] world: default, model: advanced_plane_1
INFO [lockstep_scheduler] setting initial absolute time to 52204000 us
INFO [commander] LED: open /dev/led0 failed (22)
WARN [health_and_arming_checks] Preflight Fail: Accel Sensor 0 missing
WARN [health_and_arming_checks] Preflight Fail: Airspeed selector module down
WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data
WARN [health_and_arming_checks] Preflight Fail: Gyro Sensor 0 missing
WARN [health_and_arming_checks] Preflight Fail: Found 0 compass (required: 1)
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station	
INFO [airspeed_selector] No airspeed sensor detected. Switch to non-airspeed mode.	
INFO [uxrce_dds_client] init UDP agent IP:127.0.0.1, port:8888
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18571 remote port 14550
INFO [mavlink] partner IP: 127.0.0.1
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14581 remote port 14541
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14281 remote port 14031
INFO [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13031 remote port 13281
INFO [logger] logger started (mode=all)
INFO [logger] Start file log (type: full)
INFO [logger] [logger] ./log/2026-01-15/12_51_07.ulg	
INFO [logger] Opened full log file: ./log/2026-01-15/12_51_07.ulg
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [px4] Startup script returned successfully
pxh> INFO [tone_alarm] home set
ERROR [mavlink] vehicle_command_ack lost, generation 8 -> 26
ERROR [mavlink] vehicle_command_ack lost, generation 8 -> 26
ERROR [mavlink] vehicle_command_ack lost, generation 8 -> 26
ERROR [mavlink] vehicle_command_ack lost, generation 8 -> 26
WARN [health_and_arming_checks] Preflight Fail: Airspeed invalid
WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data
WARN [health_and_arming_checks] Preflight Fail: Found 0 compass (required: 1)
WARN [health_and_arming_checks] Preflight Fail: Airspeed invalid
WARN [health_and_arming_checks] Preflight Fail: Found 0 compass (required: 1)
INFO [airspeed_selector] Airspeed sensor healthy, start using again (-1, 1)	
WARN [health_and_arming_checks] Preflight Fail: Found 0 compass (required: 1)
INFO [mavlink] Ignore command 512 from 255/190 to 1/1
INFO [mavlink] Ignore command 521 from 255/190 to 1/1

```

I have tried spawning with the `PX4_GZ_STANDALONE=1` parameter also, but I see the same behaviour.

### **Spawn GZ model first and later connect PX4 to it**

Started the gazebo simulation as below

```auto
PX4-Autopilot$ gz sim Tools/simulation/gz/worlds/default.sdf

```

Spawned the advanced plane by following command, I could see the plane in Gazebo.

```auto
gz service -s /world/default/create --reqtype gz.msgs.EntityFactory --reptype gz.msgs.Boolean --timeout 3000 --req 'name: "advanced_plane_0"
sdf_filename: "/home/xxx//PX4-Autopilot/Tools/simulation/gz/models/advanced_plane/model.sdf" pose {position { x: 0 y: 0 z: 0 } orientation { w: 1 } }'

```

Connect PX4 to this model

```auto
PX4_SYS_AUTOSTART=4008 \
PX4_GZ_MODEL_NAME=advanced_plane_0 \
./build/px4_sitl_default/bin/px4 -i 0

```

I get the same error as in the above log. It is always a preflight error with sensor issues.

In all these situations, I can see gz topics corresponding to the spawned planes.

Does this mean, there might exists some issues with gazebo-bridge to PX4? I was able to spawn multiple planes in the previous PX4 version.

Looking for some direction to debug this issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![amirykz](https://discuss.px4.io/user_avatar/discuss.px4.io/amirykz/32/18949_2.png) [@amirykz](https://discuss.px4.io/u/amirykz)\
**Post date:** [February 18, 2026, 8:52am UTC](https://discuss.px4.io/t/bug-gazebo-multi-vehicle-simulation-px4-not-getting-connected-to-multiple-vehicles/48304/2 "2026-02-18T08:52:13Z")

</div>

Hi @rg-123 I am facing exact problem. I find following sources which i am still trying to implement, let me know if it helps.

[Source 1](https://discuss.px4.io/t/starting-px4-sitl-with-a-separate-gazebo-sim/47982/5)

Also, V1.16 has a new way of launching drones using:

> PX4\_UXRCE\_DDS\_NS=uav\_1 make px4\_sitl gz\_x500

which can only be used for single drone, however by tweaking [`UXRCE_DDS_NS_IDX`](https://docs.px4.io/main/en/advanced_config/parameter_reference#UXRCE_DDS_NS_IDX) you can use it for multi-vehicle as well. check [here](https://docs.px4.io/main/en/middleware/uxrce_dds#customizing-the-namespace)

Also remember that sometimes, **“gyroscope not found”** or similar errors like “ **missing data** ” happens because your system RAM can’t handle everything at once. try PX4\_SIM\_SPEED\_FACTOR=0.1 flag to run simulation.

I will share if I make any progress.

---

<div class="post-metadata">

**Author:** ![system](https://discuss.px4.io/uploads/default/original/3X/7/3/73ce918bdcd64854de904f0c8d9ab70ca9723f2a.png) [@system](https://discuss.px4.io/u/system)\
**Post date:** [May 19, 2026, 8:52am UTC](https://discuss.px4.io/t/bug-gazebo-multi-vehicle-simulation-px4-not-getting-connected-to-multiple-vehicles/48304/3 "2026-05-19T08:52:41Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
