Skip to content

zejdajan/mrs_simulation

 
 

Repository files navigation

MRS simulation

test

Build status Build Status Build Status

Overview

Support for spawning vehicles into Gazebo simulation, where user can select from multiple UAV platforms. This platforms can be additionaly equipped with several sensors (rangefinders, 2d lidars, stereo cameras etc.).

Usage

⚠️ New drone spawning mechanism:

  • From now on, the drone spawning mechanism will be controlled by a ROS node
  • Spawning new vehicles is now done by calling ROS services
  • The spawner node is launched automatically with the simulation
  • The arguments for vehicle configuration remain mostly unchanged, just use 'rosservice call /mrs_drone_spawner/spawn "args"' instead of 'spawn_uav args'
  • Distributed simulation (running gazebo on one computer and mavros/PX4 on another is currently not supported

Start of the Gazebo simulator

To start the prepared example of Gazebo world call:

roslaunch mrs_simulation simulation.launch world_file:='$(find mrs_gazebo_common_resources)/worlds/grass_plane.world' gui:=true

At this point the Gazebo world will only contain the environment with grass plane but with no vehicles yet.

Spawning of UAVs (NEW)

The simulation.launch will automatically start the mrs_drone_spawner python node. If you use a custom launch file to start the simulation, you can start it separately:

roslaunch mrs_simulation mrs_drone_spawner.launch

The mrs_drone_spawner will perform the following tasks:

  • Spawn vehicle models in the Gazebo simulation (ids from 0 to 250). This is done internally by calling the command rosrun gazebo_ros spawn_model.

  • For each vehicle, PX4 firmware and mavros is started at specific port numbers depending on the vehicle ID.

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 a down-facing laser rangefinder:

rosservice call /mrs_drone_spawner/spawn "1 --enable-rangefinder"

To display the manual containing a list of all available arguments, perform a dry-run of the script:

rosrun mrs_simulation mrs_drone_spawner

The arguments are also listed in the mrs_simulation/config/spawner_params.yaml file. Note that not all sensors are available for all the vehicle types. The config file stores the available configurations in the following format: parameter: [default_value, help_description, [compatible_vehicles]]

New features

Multiple vehicles may be spawned with one service call:

rosservice call /mrs_drone_spawner/spawn "1 2 3 4 5 --t650 --enable-bluefox-camera --enable-rangefinder"

Spawn position may be specified by a command line argument --pos x y z heading: [m, m, m, rad]

rosservice call /mrs_drone_spawner/spawn "1 --f550 --enable-rangefinder --pos 10 -15 0.3 0.7"

For multiple vehicles, --pos defines the spawn point of the first vehicle. Following vehicles will be spawned in a line, with an x-offset of 2 meters from the previous vehicle.

Spawn position may be specified by a .csv or a .yaml file using --file absolute_path_to_file:

rosservice call /mrs_drone_spawner/spawn "1 --f450 --enable-rangefinder --enable-ouster --use-gpu-ray --ouster-model OS1-64 --file `pwd`/spawn_poses.yaml"

Use a whitespace instead of an ID to get an available ID automatically assigned by the spawner.

rosservice call /mrs_drone_spawner/spawn " --f450 --enable-rangefinder"

Running the MRS control pipeline

Check out the wiki on how to run control core.

About

The ROS part of the "simulation" package.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 48.7%
  • Python 47.9%
  • CMake 3.0%
  • C++ 0.4%