Multirotor Simulator Example
To install this project, clone the repository:
git clone https://github.com/aerostack2/project_as2_multirotor_simulator
To start using this project, please go to the root folder of the project.
Execution
The execution will launch the Aerostack2 components.
The flags for the components launcher are:
-n <namespace>
- namespace for the drone. Default, not specified and usesconfig/world.yaml
configuration. If specified, it usesconfig/platform_config_file.yaml
configuration.-m
- multi agent mode. Default is disabled. If specified, it usesconfig/world_swarm.yaml
configuration.-d
- launch rviz visualization. If not specified, it does not launch rviz visualization. If specified, it launches rviz visualization with config/tf_visualization.rviz configuration.-e <estimator type>
- estimator type. Default isground_truth
. Available options:ground_truth
,raw_odometry
,raw_odometry_gps
. It uses configuration fromconfig/state_estimator*.yaml
.-r
- record rosbag. Default is disabled. If specified, it records rosbag inrosbag
directory.-t
- launch keyboard teleoperation. Default is disabled. If specified, it launches keyboard teleoperation.
Single drone
In order to launch the components for a single drone, do:
./launch_as2.bash -d -t
This will open a simulation for a single drone alongside the Aerostack2 components necessary for the mission execution.
A window with RViz (argument -d
) should popup.
It will also open a keyboard teleoperation (argument -t
), which you can use to teleoperate the drone with the aerostack2 keyboard teleoperation user interface.
A window like the following image should popup:
To start the mission, execute:
python3 mission.py
Also, you can try the mission planner, which describes the mission in a JSON format:
python3 mission_planner.py
To do a clean exit of tmux, execute:
./stop.bash
Swarm drones
In order to launch the components for a swarm of 3 drones, do:
./launch_as2.bash -m -t -d
This will open a simulation for a swarm of drones (argument -m
) alongside the Aerostack2 components necessary for the mission execution.
A window with RViz (argument -d
) should popup.
It will also open a keyboard teleoperation (argument -t
), which you can use to teleoperate the swarm with the aerostack2 keyboard teleoperation user interface.
A window like the following image should popup:
To start the mission, execute:
python3 mission_swarm.py
To do a clean exit of tmux, execute the following command with the list of the used drones:
./stop.bash drone0 drone1 drone2