|
1 |
| -.. _project_multirotor_simulator: |
| 1 | +.. _project_ms: |
2 | 2 |
|
3 |
| -============================ |
4 |
| -Multirotor Simulator Example |
5 |
| -============================ |
| 3 | +=================================== |
| 4 | +Simple Multirotor Simulator Example |
| 5 | +=================================== |
6 | 6 |
|
7 | 7 | To install this project, clone the repository:
|
8 | 8 |
|
9 | 9 | .. code-block:: bash
|
10 | 10 |
|
11 |
| - git clone https://github.com/aerostack2/project_as2_multirotor_simulator |
| 11 | + git clone https://github.com/aerostack2/project_as2_multirotor_simulator.git |
12 | 12 |
|
13 | 13 | To start using this project, please go to the root folder of the project.
|
14 | 14 |
|
15 | 15 |
|
16 |
| - |
17 |
| -.. _project_multirotor_simulator_simulated: |
| 16 | +.. _project_ms_launching: |
18 | 17 |
|
19 | 18 | ---------
|
20 |
| -Execution |
| 19 | +Launching |
21 | 20 | ---------
|
22 | 21 |
|
23 |
| -The execution will launch the Aerostack2 components. |
| 22 | +The execution on the project is split into two parts: Aerostack2 components and ground station. |
24 | 23 |
|
25 |
| -The flags for the components launcher are: |
| 24 | +Launching Aerostack2 |
| 25 | +==================== |
26 | 26 |
|
27 |
| -* ``-n <namespace>`` - namespace for the drone. Default, not specified and uses ``config/world.yaml`` configuration. If specified, it uses ``config/platform_config_file.yaml`` configuration. |
28 |
| -* ``-m`` - multi agent mode. Default is disabled. If specified, it uses ``config/world_swarm.yaml`` configuration. |
29 |
| -* ``-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. |
30 |
| -* ``-e <estimator type>`` - estimator type. Default is ``ground_truth``. Available options: ``ground_truth``, ``raw_odometry``, ``raw_odometry_gps``. It uses configuration from ``config/state_estimator*.yaml``. |
31 |
| -* ``-r`` - record rosbag. Default is disabled. If specified, it records rosbag in ``rosbag`` directory. |
32 |
| -* ``-t`` - launch keyboard teleoperation. Default is disabled. If specified, it launches keyboard teleoperation. |
| 27 | +To launch the Aerostack2 components, execute the following command: |
33 | 28 |
|
| 29 | +.. code-block:: bash |
34 | 30 |
|
35 |
| -.. _project_multirotor_simulator_simulated_single_drone: |
| 31 | + ./launch_as2.bash |
36 | 32 |
|
37 |
| -Single drone |
38 |
| -============ |
39 | 33 |
|
40 |
| -In order to launch the components for a **single drone**, do: |
| 34 | +Launcher offers a few options to customize the execution. ``./launch_as2.bash -h`` will show option list. Options can be set with the following flags: |
41 | 35 |
|
42 |
| -.. code-block:: bash |
| 36 | +- ``-c``: motion controller plugin (pid_speed_controller, differential_flatness_controller), choices: [pid, df]. Default: pid |
| 37 | +- ``-m``: multi agent. Default not set |
| 38 | +- ``-n``: select drones namespace to launch, values are comma separated. By default, it will get all drones from world description file |
| 39 | +- ``-g``: launch using gnome-terminal instead of tmux. Default not set |
43 | 40 |
|
44 |
| - ./launch_as2.bash -d -t |
| 41 | +Launching Ground Station |
| 42 | +======================== |
45 | 43 |
|
46 |
| -This will open a simulation for a single drone alongside the Aerostack2 components necessary for the mission execution. |
47 |
| -A window with RViz (argument ``-d``) should popup. |
| 44 | +To launch the ground station, execute the following command: |
48 | 45 |
|
| 46 | +.. code-block:: bash |
49 | 47 |
|
50 |
| -It will also open a keyboard teleoperation (argument ``-t``), which you can use to teleoperate the drone with the :ref:`aerostack2 keyboard teleoperation user interface <user_interfaces_keyboard_teleoperation>`. |
51 |
| - |
52 |
| -A window like the following image should popup: |
| 48 | + ./launch_ground_station.bash |
53 | 49 |
|
54 |
| -.. figure:: images/keyboard_teleop_view.png |
55 |
| - :scale: 50 |
56 |
| - :class: with-shadow |
57 |
| - |
58 |
| - Keyboard teleoperation |
| 50 | +Launcher offers a different pool of options to customize the execution. ``./launch_ground_station.bash -h`` will show option list. Options can be set with the following flags: |
59 | 51 |
|
60 |
| -To start the mission, execute: |
| 52 | +- ``-m``: multi agent. Default not set |
| 53 | +- ``-t``: launch keyboard teleoperation. Default not launch |
| 54 | +- ``-v``: open rviz. Default launch |
| 55 | +- ``-r``: record rosbag. Default not launch |
| 56 | +- ``-n``: drone namespaces, comma separated. Default get from world description config file |
| 57 | +- ``-g``: launch using gnome-terminal instead of tmux. Default not set |
61 | 58 |
|
62 |
| -.. code-block:: bash |
63 | 59 |
|
64 |
| - python3 mission.py |
| 60 | +Closing |
| 61 | +======= |
65 | 62 |
|
66 |
| -Also, you can try the mission planner, which describes the mission in a JSON format: |
| 63 | +Close all nodes (aerostack2 and ground_station) with the following command executing outside the tmux session: |
67 | 64 |
|
68 | 65 | .. code-block:: bash
|
69 | 66 |
|
70 |
| - python3 mission_planner.py |
| 67 | + ./stop.bash |
71 | 68 |
|
| 69 | +.. note:: |
72 | 70 |
|
73 |
| -To do a clean exit of tmux, execute: |
| 71 | + The command ``tmux kill-server`` will have a similar effect but closing all tmux sessions, so be careful if you have other tmux sessions running. |
74 | 72 |
|
75 |
| -.. code-block:: bash |
| 73 | + If launcher was executed with the flag ``-g``, closing should be done manually exiting all gnome-terminal tabs. |
76 | 74 |
|
77 |
| - ./stop.bash |
78 | 75 |
|
| 76 | +.. _project_ms_mission: |
79 | 77 |
|
| 78 | +----------------- |
| 79 | +Mission execution |
| 80 | +----------------- |
80 | 81 |
|
81 |
| -.. _project_multirotor_simulator_simulated_swarm_drones: |
| 82 | +The project offers a few examples of mission execution. |
82 | 83 |
|
83 |
| -Swarm drones |
84 |
| -============ |
| 84 | +- **Keyboard Teleoperation control**: Using reactive teleoperation control. For both single and multiagent swarms. |
| 85 | +- **Python API missions**: Using Aerostack2 python API for mission definition. For single drone, using GPS and multiple drones. |
| 86 | +- **Behavior Tree missions**: Using Behavior Tree as the mission planner. For single drone only. |
| 87 | +- **Mission Interpreter**: Using Aerostack2 mission interpreter. For single drone only. |
85 | 88 |
|
86 |
| -In order to launch the components for a **swarm of 3 drones**, do: |
87 | 89 |
|
88 |
| -.. code-block:: bash |
| 90 | +.. _project_ms_keyboard_teleoperation: |
89 | 91 |
|
90 |
| - ./launch_as2.bash -m -t -d |
| 92 | +Keyboard Teleoperation control |
| 93 | +============================== |
91 | 94 |
|
92 |
| -This will open a simulation for a swarm of drones (argument ``-m``) alongside the Aerostack2 components necessary for the mission execution. |
93 |
| -A window with RViz (argument ``-d``) should popup. |
| 95 | +In order to launch the components for a **single drone**, Aerostack2 launcher does not need any additional flags. Just execute ``./launch_as2.bash``. |
| 96 | +This will launch the Aerostack2 components necessary for the mission execution. |
94 | 97 |
|
95 |
| -It will also open a keyboard teleoperation (argument ``-t``), which you can use to teleoperate the swarm with the :ref:`aerostack2 keyboard teleoperation user interface <user_interfaces_keyboard_teleoperation>`. |
| 98 | +.. figure:: images/multirotor_simulator.png |
| 99 | + :scale: 50 |
| 100 | + :class: with-shadow |
| 101 | + |
| 102 | + Multirotor Simulator simulator |
96 | 103 |
|
97 |
| -A window like the following image should popup: |
| 104 | +Ground station should be launched with ``-t`` flag to enable keyboard teleoperation. Take a look at the :ref:`keyboard teleoperation user guide <user_interfaces_keyboard_teleoperation>` for more information. |
| 105 | +A window containing the teleoperation widget should pop up: |
98 | 106 |
|
99 |
| -.. figure:: images/keyboard_swarm_view.png |
| 107 | +.. figure:: images/keyboard_teleop_view.png |
100 | 108 | :scale: 50
|
101 | 109 | :class: with-shadow
|
102 | 110 |
|
103 | 111 | Keyboard teleoperation
|
104 | 112 |
|
105 |
| -To start the mission, execute: |
| 113 | +.. note:: |
106 | 114 |
|
107 |
| -.. code-block:: bash |
| 115 | + The teleoperation widget is also available for multi drone missions. To launch a multi drone simulation, use the flag ``-m`` in both launch commands. |
108 | 116 |
|
109 |
| - python3 mission_swarm.py |
110 | 117 |
|
111 |
| -To do a clean exit of tmux, execute the following command with the list of the used drones: |
| 118 | +.. _project_ms_python_api: |
112 | 119 |
|
113 |
| -.. code-block:: bash |
| 120 | +Python API missions |
| 121 | +=================== |
| 122 | + |
| 123 | +In order to launch the components for **multiple drones**, both launchers require the flag ``-m``. |
| 124 | +This will launch the Aerostack2 components necessary for the mission execution. |
| 125 | + |
| 126 | +.. figure:: images/multirotor_simulator_swarm.png |
| 127 | + :scale: 50 |
| 128 | + :class: with-shadow |
| 129 | + |
| 130 | + Multirotor Simulator simulator |
| 131 | + |
| 132 | +There are three python scripts available for mission execution in the project. For single drone missions, use ``python3 mission.py`` for flying a square. |
| 133 | +When flying using GPS, use ``python3 mission_gps.py`` which will fly a square using GPS waypoints. |
| 134 | + |
| 135 | +For multi drone missions, use ``python3 mission_swarm.py`` where a group of drones will fly a swarm coreography. |
| 136 | + |
| 137 | +.. note:: |
| 138 | + |
| 139 | + To understand how missions are built using the Aerostack2 python API, take a look at the :ref:`development_guide_api_python_api` reference guide. |
| 140 | + |
| 141 | + |
| 142 | +.. _project_ms_mission_interpreter: |
| 143 | + |
| 144 | +Mission Interpreter |
| 145 | +=================== |
| 146 | + |
| 147 | +Previous missions were defined using python syntaxis. Aerostask2 offers a mission interpreter that allows mission definition using a JSON format. |
| 148 | +Currently, the mission interpreter script at the project is only available for single drone missions. |
| 149 | +To launch the mission interpreter, execute ``python3 mission_interpreter.py``. |
| 150 | +The execution is similar to the python API mission where the drone will fly a square. |
| 151 | + |
| 152 | + |
| 153 | +.. _project_ms_behavior_tree: |
| 154 | + |
| 155 | +Behavior Tree |
| 156 | +============= |
| 157 | + |
| 158 | +Missions can also be defined using a behavior tree. The project offers a mission example using a behavior tree for a single drone. |
| 159 | +To launch the behavior tree mission, execute ``python3 mission_behavior_tree.py``. |
| 160 | +The execution is similar to the python API mission where the drone will fly a square. |
| 161 | + |
| 162 | +.. note:: |
114 | 163 |
|
115 |
| - ./stop.bash drone0 drone1 drone2 |
| 164 | + Trees can be defined using GUIs like `Groot <https://www.behaviortree.dev/groot/>`. |
0 commit comments