This package provides UAV model definitions for the Gazebo simulator and a custom spawning mechanism that assembles the drones dynamically from provided arguments.
⚠️ Attention please: This package is under development due to ROS2 transition.Please keep in mind that the migration will take time and the components you are used to in ROS1 may not be available yet.
⚠️ The following platforms have been ported to ROS2. Only default pixhawk sensors and a garmin rangefinder are currently available.
| Model | Spawn argument | Simulation |
|---|---|---|
| Holybro x500 | --x500 |
![]() |
| DJI f450 | --f450 |
![]() |
| DJI f330 | --f330 |
![]() |
| DJI f550 | --f550 |
![]() |
| F4F RoboFly | --robofly |
![]() |
| T-Drones m690 | --m690 |
![]() |
| Tarot t650 | --t650 |
![]() |
A custom drone model can be added from an external package. Please look at mrs_gazebo_custom_drone_example for an example. The custom drone wiki page contains a detailed description of all the important steps and configuration parts.
Use one of the prepared Tmuxinator sessions in roscd mrs_uav_gazebo_simulator/tmux as an example:
The drone models are dynamically created in runtime using the MRS drone spawner. The UAV platforms can be additionally equipped by adding components (rangefinders, LiDARs, cameras, plugins etc.).
To start the example Gazebo world call:
ros2 launch mrs_uav_gazebo_simulator simulation.launch.py world_file:=$(ros2 pkg prefix mrs_gazebo_common_resources)/share/mrs_gazebo_common_resources/worlds/grass_plane.sdf gz_headless:=falseAt this point the Gazebo world will only contain the environment with grass plane but with no vehicles yet.
The simulation.launch.py will automatically start the mrs_drone_spawner as a ROS2 node. If you use a custom launch file to start Gazebo, you can launch the spawner separately:
ros2 launch mrs_uav_gazebo_simulator mrs_drone_spawner.launch.pyThe mrs_drone_spawner will perform the following tasks:
-
Generate SDF models from the UAV templates
-
Add optional components (sensors, plugins...) based on the user input
-
Run PX4 SITL and Mavros, and ensure that all ports are correctly linked with the Gazebo simulator
-
Remove all subprocesses on exit
Vehicles are added to the simulation by calling the spawn service of the mrs_drone_spawner.
The service takes one string argument, which specifies the vehicle ID, type and sensor configuration.
Example: spawn a single vehicle with ID 1, type X500, with a down-facing laser rangefinder:
ros2 service call /mrs_drone_spawner/spawn mrs_msgs/srv/String "value: 1 --x500 --enable-rangefinder"To display the basic use manual for the spawner, call the service with the argument --help. NOTE: String argument cannot start with a dash. Add a space before the dashes to avoid errors. The service call returns the full help text, but the formatting may be broken. Please refer to the terminal running simulation or mrs_drone_spawner where the help text is also printed with proper formatting.
ros2 service call /mrs_drone_spawner/spawn mrs_msgs/srv/String "value: --help"You can also display a manual for a specific platform. This will list all the components that can be equipped to the selected platform, and their brief description.
ros2 service call /mrs_drone_spawner/spawn mrs_msgs/srv/String "value: --x500 --help"Multiple vehicles may be spawned with one service call:
ros2 service call /mrs_drone_spawner/spawn mrs_msgs/srv/String "value: 1 2 3 4 5 --t650 --enable-bluefox-camera --enable-rangefinder"The default parameters of some components may be reconfigured by adding param:=value after the component keyword. Multiple params may be used at the same time:
ros2 service call /mrs_drone_spawner/spawn mrs_msgs/srv/String "value: 1 --x500 --enable-rangefinder --enable-ouster model:=OS0-32 horizontal_samples:=128 update_rate:=10"The list of components and their reconfigurable parameters can be displayed using the platform-specific help.
For more details, please refer to the MRS drone spawner page.






