# Multi-drone SITL

**URL:** <https://discuss.px4.io/t/multi-drone-sitl/36705>\
**Category:** PX4 Autopilot\
**Created:** [February 8, 2024, 9:39am UTC](https://discuss.px4.io/t/multi-drone-sitl/36705 "2024-02-08T09:39:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerct](https://discuss.px4.io/user_avatar/discuss.px4.io/kerct/32/14253_2.png) [@kerct](https://discuss.px4.io/u/kerct)\
**Post date:** [February 8, 2024, 9:39am UTC](https://discuss.px4.io/t/multi-drone-sitl/36705/1 "2024-02-08T09:39:52Z")

</div>

I tried to launch multiple vehicles using SDF models by following this [Multi-Vehicle Simulation with Gazebo Classic | PX4 Guide (main)](https://docs.px4.io/main/en/sim_gazebo_classic/multi_vehicle_simulation.html#multiple-vehicles-using-sdf-models) and it works for “plane”, but when I changed the model to iris\_vision (and had to modify the airframe to 10015\_gazebo-classic\_iris instead of 10016\_gazebo-classic\_iris), QGC only connects to 1 vehicle although 3 vehicles are spawned on gazebo. Why is this so and how can I connect to all of the vehicles in QGC?

Logs after roslaunch:

process[gazebo-1]: started with pid [74617]  
process[gazebo\_gui-2]: started with pid [74620]  
process[uav0/sitl\_0-3]: started with pid [74631]  
INFO [px4] instance: 0

* * *

| \_\_\_ \ \ \ / / / |  
| |_/ / \ V / / /| |  
| \_\_/ / \ / /_| |  
| | / /^\ \ \_\_\_ |  
\_| / / |\_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0  
process[uav0/iris\_vision\_0\_spawn-4]: started with pid [74641]  
INFO [init] found model autostart file as SYS\_AUTOSTART=1013  
INFO [param] selected parameter default file parameters.bson  
INFO [param] importing from ‘parameters.bson’  
INFO [parameters] BSON document size 251 bytes, decoded 251 bytes (INT32:11, FLOAT:2)  
INFO [param] selected parameter backup file parameters\_backup.bson  
INFO [dataman] data manager file ‘./dataman’ size is 7872608 bytes  
INFO [init] PX4\_SIM\_HOSTNAME: localhost  
INFO [simulator\_mavlink] Waiting for simulator to accept connection on TCP port 4560  
process[uav1/sitl\_1-5]: started with pid [74834]  
INFO [px4] instance: 1

* * *

| \_\_\_ \ \ \ / / / |  
| |_/ / \ V / / /| |  
| \_\_/ / \ / /_| |  
| | / /^\ \ \_\_\_ |  
\_| / / |\_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 1  
process[uav1/iris\_vision\_1\_spawn-6]: started with pid [74835]  
INFO [init] found model autostart file as SYS\_AUTOSTART=1013  
INFO [param] selected parameter default file parameters.bson  
INFO [param] selected parameter backup file parameters\_backup.bson  
SYS\_AUTOCONFIG: curr: 0 → new: 1  
MAV\_SYS\_ID: curr: 1 → new: 2  
UXRCE\_DDS\_KEY: curr: 1 → new: 2  
SYS\_AUTOSTART: curr: 0 → new: 1013  
CAL\_ACC0\_ID: curr: 0 → new: 1310988  
CAL\_GYRO0\_ID: curr: 0 → new: 1310988  
CAL\_ACC1\_ID: curr: 0 → new: 1310996  
CAL\_GYRO1\_ID: curr: 0 → new: 1310996  
CAL\_ACC2\_ID: curr: 0 → new: 1311004  
CAL\_GYRO2\_ID: curr: 0 → new: 1311004  
CAL\_MAG0\_ID: curr: 0 → new: 197388  
CAL\_MAG0\_PRIO: curr: -1 → new: 50  
CAL\_MAG1\_ID: curr: 0 → new: 197644  
CAL\_MAG1\_PRIO: curr: -1 → new: 50  
SENS\_BOARD\_X\_OFF: curr: 0.0000 → new: 0.0000  
SENS\_DPRES\_OFF: curr: 0.0000 → new: 0.0010  
INFO [dataman] data manager file ‘./dataman’ size is 7872608 bytes  
INFO [init] PX4\_SIM\_HOSTNAME: localhost  
INFO [simulator\_mavlink] Waiting for simulator to accept connection on TCP port 4561  
process[uav2/sitl\_2-7]: started with pid [75013]  
INFO [px4] instance: 2

* * *

| \_\_\_ \ \ \ / / / |  
| |_/ / \ V / / /| |  
| \_\_/ / \ / /_| |  
| | / /^\ \ \_\_\_ |  
\_| / / |\_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 2  
INFO [init] found model autostart file as SYS\_AUTOSTART=1013  
process[uav2/iris\_vision\_2\_spawn-8]: started with pid [75026]  
INFO [param] selected parameter default file parameters.bson  
INFO [param] selected parameter backup file parameters\_backup.bson  
SYS\_AUTOCONFIG: curr: 0 → new: 1  
MAV\_SYS\_ID: curr: 1 → new: 3  
UXRCE\_DDS\_KEY: curr: 1 → new: 3  
SYS\_AUTOSTART: curr: 0 → new: 1013  
CAL\_ACC0\_ID: curr: 0 → new: 1310988  
CAL\_GYRO0\_ID: curr: 0 → new: 1310988  
CAL\_ACC1\_ID: curr: 0 → new: 1310996  
CAL\_GYRO1\_ID: curr: 0 → new: 1310996  
CAL\_ACC2\_ID: curr: 0 → new: 1311004  
CAL\_GYRO2\_ID: curr: 0 → new: 1311004  
CAL\_MAG0\_ID: curr: 0 → new: 197388  
CAL\_MAG0\_PRIO: curr: -1 → new: 50  
CAL\_MAG1\_ID: curr: 0 → new: 197644  
CAL\_MAG1\_PRIO: curr: -1 → new: 50  
SENS\_BOARD\_X\_OFF: curr: 0.0000 → new: 0.0000  
SENS\_DPRES\_OFF: curr: 0.0000 → new: 0.0010  
[INFO] [1707385067.908294, 0.000000]: Loading model XML from ros parameter model\_description  
[INFO] [1707385067.914481, 0.000000]: Waiting for service /gazebo/spawn\_sdf\_model  
INFO [dataman] data manager file ‘./dataman’ size is 7872608 bytes  
[INFO] [1707385068.043895547]: Finished loading Gazebo ROS API Plugin.  
[INFO] [1707385068.046573407]: waitForService: Service [/gazebo/set\_physics\_properties] has not been advertised, waiting…  
INFO [init] PX4\_SIM\_HOSTNAME: localhost  
INFO [simulator\_mavlink] Waiting for simulator to accept connection on TCP port 4562  
[INFO] [1707385068.158453, 0.000000]: Loading model XML from ros parameter model\_description  
[INFO] [1707385068.163154, 0.000000]: Waiting for service /gazebo/spawn\_sdf\_model  
[INFO] [1707385068.275354277]: Finished loading Gazebo ROS API Plugin.  
[INFO] [1707385068.278909464]: waitForService: Service [/gazebo\_gui/set\_physics\_properties] has not been advertised, waiting…  
[WARN] [1707385068.287391373, 1227.964000000]: Shutdown request received.  
[WARN] [1707385068.287569354, 1227.964000000]: Reason given for shutdown: [[/gazebo\_gui] Reason: new node registered with same name]  
[INFO] [1707385068.523773, 0.000000]: Loading model XML from ros parameter model\_description  
[INFO] [1707385068.530012, 0.000000]: Waiting for service /gazebo/spawn\_sdf\_model  
[INFO] [1707385069.074627, 0.000000]: Calling service /gazebo/spawn\_sdf\_model  
[INFO] [1707385069.095384872]: waitForService: Service [/gazebo/set\_physics\_properties] is now available.  
[INFO] [1707385069.128833, 0.016000]: Calling service /gazebo/spawn\_sdf\_model  
[INFO] [1707385069.139490, 0.024000]: Calling service /gazebo/spawn\_sdf\_model  
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.  
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.  
…/src/intel/isl/isl.c:2105: FINISHME: …/src/intel/isl/isl.c:isl\_surf\_supports\_ccs: CCS for 3D textures is disabled, but a workaround is available.  
[INFO] [1707385069.588033, 0.120000]: Spawn status: SpawnModel: Successfully spawned entity  
[INFO] [1707385069.604423847, 0.120000000]: Physics dynamic reconfigure ready.  
INFO [simulator\_mavlink] Simulator connected on TCP port 4560.  
INFO [lockstep\_scheduler] setting initial absolute time to 132000 us  
WARN [vehicle\_angular\_velocity] no gyro selected, using sensor\_gyro\_fifo:0 1310988  
INFO [commander] LED: open /dev/led0 failed (22)  
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550  
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.  
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.  
[uav1/iris\_vision\_1\_spawn-6] process has finished cleanly  
log file: /home/chin\_tian/.ros/log/06bd7904-c635-11ee-a3c2-847b57726d20/uav1-iris\_vision\_1\_spawn-6\*.log  
[INFO] [1707385070.283032, 0.324000]: Spawn status: SpawnModel: Successfully spawned entity  
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540  
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030  
INFO [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280  
INFO [logger] logger started (mode=all)  
INFO [logger] Start file log (type: full)  
INFO [logger] [logger] ./log/2024-02-08/09\_37\_50.ulg   
INFO [logger] Opened full log file: ./log/2024-02-08/09\_37\_50.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  
INFO [tone\_alarm] home set  
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.  
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.  
[INFO] [1707385070.767095, 0.528000]: Spawn status: SpawnModel: Successfully spawned entity  
[uav0/iris\_vision\_0\_spawn-4] process has finished cleanly  
log file: /home/chin\_tian/.ros/log/06bd7904-c635-11ee-a3c2-847b57726d20/uav0-iris\_vision\_0\_spawn-4\*.log  
[uav2/iris\_vision\_2\_spawn-8] process has finished cleanly  
log file: /home/chin\_tian/.ros/log/06bd7904-c635-11ee-a3c2-847b57726d20/uav2-iris\_vision\_2\_spawn-8\*.log  
INFO [mavlink] partner IP: 127.0.0.1  
INFO [commander] Ready for takeoff!  
INFO [mavlink] partner IP: 127.0.0.1
