Jaeyoung Lim
Previously, it was only possible to simulate multiple vehicles in SITL by extending ROS launchfiles. However, this is not scalable especially when you are trying simulate large number of vehicles or change the number of vehicles a lot.
Now you can simulate multiple vehicles in PX4 SITL gazebo, without depending on ROS. Simply run the following command. A more detailed instruction can be found in the PX4 Devguide
Tools/gazebo_sitl_multiple_run.sh [-m <model>] [-n <number_of_vehicles>] [-w <world>]
Spawning different models
Tools/gazebo_sitl_multiple_run.sh -m iris -n 20
Tools/gazebo_sitl_multiple_run.sh -m plane -n 10
Tools/gazebo_sitl_multiple_run.sh -m standard_vtol
Spawning into different worlds
The vehilces can be spawned into different worlds. For example, the baylands
world. The list of worlds can be found in the documentation
Tools/gazebo_sitl_multiple_run.sh -w baylands
PRs that enabled this feature
- https://github.com/PX4/Firmware/pull/13729
- https://github.com/PX4/Firmware/pull/13985
- https://github.com/PX4/Firmware/pull/14126
- https://github.com/PX4/Firmware/pull/14764
Anecdote
When I was starting with PX4 SITL years ago, I did something similar but failed miserably. After 4 years, I ended up fixing it myself. 🙂