You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,157 +13,178 @@ To install this project, clone the repository:
13
13
To start using this project, please go to the root folder of the project.
14
14
15
15
16
-
17
-
.. _project_gazebo_simulated:
16
+
.. _project_gazebo_launching:
18
17
19
18
---------
20
-
Execution
19
+
Launching
21
20
---------
22
21
23
-
The execution will open a simulation in Gazebo and the Aerostack2 components will use simulation time.
24
-
25
-
The flags for the components launcher are:
26
-
27
-
- ``-m``: launch the components for the swarm multiagent system.
28
-
- ``-t``: launch keyboard teleoperation.
29
-
- ``-r``: record rosbag.
30
-
- ``-b``: use `Behavior Tree <https://www.behaviortree.dev/>`_.
31
-
- ``-n``: use custom dron namespace.
32
-
22
+
The execution on the project is split into two parts: Aerostack2 components and ground station.
33
23
24
+
Launching Aerostack2
25
+
====================
34
26
35
-
.. _project_gazebo_simulated_single_drone:
27
+
To launch the Aerostack2 components, execute the following command:
36
28
37
-
Single drone
38
-
============
29
+
.. code-block:: bash
39
30
40
-
In order to launch the components for a **single drone**, do:
31
+
./launch_as2.bash
41
32
42
-
.. code-block:: bash
43
33
44
-
./launch_as2.bash -t
34
+
This will open a Gazebo simulation alongside with a tmux session with an Aerostack2 instance for each drone launched.
45
35
46
-
This will open a simulation for a single drone alongside the Aerostack2 components necessary for the mission execution.
36
+
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:
47
37
48
-
A window like the following image should open.
38
+
- ``-m``: launch multiagent system simulation. By default not set.
39
+
- ``-n``: select drones namespace to launch, values are comma separated. By default, it launches all drones from world description file.
40
+
- ``-s``: disable launch Gazebo simulator. By default launch simulation.
41
+
- ``-g``: launch using gnome-terminal. By default not set, uses tmux.
49
42
50
-
.. figure:: images/single_drone_gz.png
51
-
:scale:50
52
-
:class:with-shadow
53
-
54
-
Gazebo simulator
43
+
Launching Ground Station
44
+
========================
55
45
56
-
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>`.
46
+
To launch the ground station, execute the following command:
57
47
58
-
A window like the following image should popup:
48
+
.. code-block:: bash
59
49
60
-
.. figure:: images/keyboard_teleop_view.png
61
-
:scale:50
62
-
:class:with-shadow
63
-
64
-
Keyboard teleoperation
50
+
./launch_ground_station.bash
65
51
66
-
To start the mission, execute:
52
+
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:
67
53
68
-
.. code-block:: bash
54
+
- ``-m``: launch multiagent system simulation. By default not set.
55
+
- ``-t``: launch keyboard teleoperation. By default not set.
56
+
- ``-v``: launch rviz. By default not set.
57
+
- ``-r``: record rosbag. By default not set.
58
+
- ``-n``: select drones namespace to launch, values are comma separated. By default, it launches all drones from world description file.
59
+
- ``-g``: launch using gnome-terminal. By default not set, uses tmux.
69
60
70
-
python3 mission.py
61
+
Closing
62
+
=======
71
63
72
-
Also, you can try the mission planner, which describes the mission in a JSON format:
64
+
Close all nodes (aerostack2 and ground_station) with the following command:
73
65
74
66
.. code-block:: bash
75
67
76
-
python3 mission_planner.py
68
+
./stop_tmuxinator.bash
77
69
78
-
Here it's what the execution should look like:
70
+
.. note::
79
71
80
-
.. raw:: html
72
+
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.
If launcher was executed with the flag ``-g``, closing should be done manually exiting all gnome-terminal tabs.
85
75
86
-
To do a clean exit of tmux, execute:
76
+
Close **only** the Aerostack2 nodes with the following command:
87
77
88
78
.. code-block:: bash
89
79
90
-
./stop.bash
91
-
92
-
80
+
./stop_tmuxinator_as2.bash
93
81
94
-
.. _project_gazebo_simulated_behavior_tree:
82
+
Close **only** the ground station nodes with the following command:
95
83
96
-
Behavior Tree
97
-
=============
84
+
.. code-block:: bash
98
85
99
-
In order to launch the components for using **behavior tree**, do:
86
+
./stop_tmuxinator_ground_station.bash
100
87
101
-
.. code-block:: bash
102
88
103
-
./launch_as2.bash -b
89
+
.. _project_gazebo_mission:
104
90
105
-
Then, you can start the mission with:
91
+
-----------------
92
+
Mission execution
93
+
-----------------
106
94
107
-
.. code-block:: bash
95
+
The project offers a few examples of mission execution.
108
96
109
-
python3 mission_behavior_tree.py
97
+
- **Keyboard Teleoperation control**: Using reactive teleoperation control. For both single and multiagent swarms.
98
+
- **Python API missions**: Using Aerostack2 python API for mission definition. For single drone, using GPS and multiple drones.
99
+
- **Behavior Tree missions**: Using Behavior Tree as the mission planner. For single drone only.
100
+
- **Mission Interpreter**: Using Aerostack2 mission interpreter. For single drone only.
110
101
111
-
To do a clean exit of tmux, execute:
112
102
113
-
.. code-block:: bash
103
+
.. _project_gazebo_keyboard_teleoperation:
114
104
115
-
./stop.bash
105
+
Keyboard Teleoperation control
106
+
==============================
116
107
108
+
In order to launch the components for a **single drone**, Aerostack2 launcher does not need any additional flags. Just execute ``./launch_as2.bash``.
109
+
This will open a simulation for a single drone alongside the Aerostack2 components necessary for the mission execution.
117
110
111
+
.. figure:: images/single_drone_gz.png
112
+
:scale:50
113
+
:class:with-shadow
114
+
115
+
Gazebo simulator
118
116
117
+
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.
118
+
A window containing the teleoperation widget should pop up:
119
119
120
-
.. _project_gazebo_simulated_swarm_drones:
120
+
.. figure:: images/keyboard_teleop_view.png
121
+
:scale:50
122
+
:class:with-shadow
123
+
124
+
Keyboard teleoperation
121
125
122
-
Swarm drones
123
-
============
126
+
.. note::
124
127
125
-
In order to launch the components for a **swarm of 3 drones**, do:
128
+
The teleoperation widget is also available for multi drone missions. To launch a multi drone simulation, use the flag ``-m`` in both launch commands.
126
129
127
-
.. code-block:: bash
128
130
129
-
./launch_as2.bash -m -t
131
+
.. _project_gazebo_python_api:
130
132
131
-
This will open a simulation for a swarm of drones (argument ``-m``) alongside the Aerostack2 components necessary for the mission execution.
133
+
Python API missions
134
+
===================
132
135
133
-
A window like the following image should open.
136
+
In order to launch the components for **multiple drones**, both launchers require the flag ``-m``.
137
+
This will open a simulation for a swarm of drones alongside the Aerostack2 components necessary for the mission execution.
134
138
135
139
.. figure:: images/swarm_gz.png
136
140
:scale:50
137
141
:class:with-shadow
138
142
139
143
Gazebo simulator
140
144
141
-
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>`.
142
-
143
-
A window like the following image should popup:
144
-
145
-
.. figure:: images/keyboard_swarm_view.png
146
-
:scale:50
147
-
:class:with-shadow
148
-
149
-
Keyboard teleoperation
145
+
There are three python scripts available for mission execution in the project. For single drone missions, use ``python3 mission.py`` for flying a square.
146
+
When flying using GPS, use ``python3 mission_gps.py`` which will fly a square using GPS waypoints. Here it is what the execution looks like:
For multi drone missions, use ``python3 mission_swarm.py`` where a group of drones will fly a swarm coreography. Here it is what the execution looks like:
Copy file name to clipboardExpand all lines: docs/_03_aerial_platforms/_gazebo_simulation/index.rst
+66-36Lines changed: 66 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -243,35 +243,64 @@ There are two aerial models available for simulation. These models are:
243
243
244
244
Hexrotor base model
245
245
246
-
In order to add an aerial model with sensors attached to it to the simulated world, Aerostack2 uses a configuration file, with JSON format, with the following structure:
247
-
248
-
.. code-block:: json
249
-
250
-
{
251
-
"world_name": "empty",
252
-
"drones": [
253
-
{
254
-
"model_type": "quadrotor_base",
255
-
"model_name": "drone_sim_0",
256
-
"xyz": [ 1.0, 1.0, 0.3 ],
257
-
"rpy": [ 0.0, 0.0, 0.0 ],
258
-
"payload": [
259
-
{
260
-
"model_type": "gps",
261
-
"model_name": "gps0"
262
-
},
263
-
{
264
-
"model_name": "gimbal",
265
-
"model_type": "gimbal_speed",
266
-
"payload": {
267
-
"model_name": "hd_camera0",
268
-
"model_type": "hd_camera"
269
-
}
270
-
}
271
-
]
272
-
}
273
-
]
274
-
}
246
+
In order to add an aerial model with sensors attached to it to the simulated world, Aerostack2 uses a configuration file, with YAML format, with the following structure:
247
+
248
+
.. code-block:: yaml
249
+
250
+
world_name: "empty"
251
+
drones:
252
+
- model_name: "drone0"
253
+
model_type: "quadrotor_base"
254
+
xyz:
255
+
- -2.0
256
+
- 0.0
257
+
- 0.3
258
+
rpy:
259
+
- 0
260
+
- 0
261
+
- 0.0
262
+
flight_time: 60
263
+
payload:
264
+
- model_name: "hd_camera0"
265
+
model_type: "hd_camera"
266
+
- model_name: "gimbal0"
267
+
model_type: "gimbal_position"
268
+
payload:
269
+
model_name: "hd_camera1"
270
+
model_type: "hd_camera"
271
+
272
+
- model_name: "drone1"
273
+
model_type: "quadrotor_base"
274
+
xyz:
275
+
- 2.0
276
+
- 0.0
277
+
- 0.3
278
+
rpy:
279
+
- 0
280
+
- 0
281
+
- 0.0
282
+
flight_time: 60
283
+
payload:
284
+
- model_name: "gimbal1"
285
+
model_type: "gimbal_speed"
286
+
payload:
287
+
model_name: "hd_camera1"
288
+
model_type: "hd_camera"
289
+
290
+
- model_name: "drone2"
291
+
model_type: "quadrotor_base"
292
+
xyz:
293
+
- 0.0
294
+
- 0.0
295
+
- 0.3
296
+
rpy:
297
+
- 0
298
+
- 0
299
+
- 0.0
300
+
flight_time: 60
301
+
payload:
302
+
- model_name: "hd_camera2"
303
+
model_type: "hd_camera"
275
304
276
305
Where:
277
306
@@ -315,21 +344,22 @@ Aerostack2 Gazebo platform provides a launch file, which parameters are:
315
344
* - namespace
316
345
- string
317
346
- Namespace of the platform, also named as drone id.
318
-
* - config_file
347
+
* - simulation_config_file
319
348
- string
320
349
- Path to the simulation configuration file.
321
350
* - control_modes_file
322
351
- string
323
352
- Optional. File path with the control modes configuration. Default the one in the package.
353
+
* - platform_config_file
354
+
- string
355
+
- Optional. File path with additional platform parameters.
356
+
* - log_level
357
+
- string
358
+
- Optional. Set Logging level. Default 'info'.
324
359
* - use_sim_time
325
360
- bool
326
361
- Optional. Syncronize simulation time with node time. Default false.
327
-
* - enable_takeoff_platform
328
-
- bool
329
-
- Optional. Enable takeoff by platfom. Default false.
330
-
* - enable_land_platform
331
-
- bool
332
-
- Optional. Enable land by platfom. Default false.
0 commit comments