Simulating Multiple Vehicles in PX4 SITL Gazebo

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

Screenshot from 2020-04-26 15-21-30

PRs that enabled this feature

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. 🙂

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s