Project

General

Profile

Running CAMS in simulation mode (Tutorial) » History » Version 9

Rafael Bailon-Ruiz, 2020-10-08 14:18

1 3 Rafael Bailon-Ruiz
h1. Running CAMS (Tutorial)
2
3
This tutorial will teach you how to run the CAMS GUI with a simple scenario in simulation mode.
4
5
{{toc}}
6
7
First of all, *make sure you successfully completed the [[Installation#Developer installation process|Installation (Developer)]] tutorial*. Then, open a terminal and change the current directory to the folder where the core packages are installed.
8
9 6 Rafael Bailon-Ruiz
<pre><code class="shell">
10
cd /path/to/nephelae_workspace
11
</code></pre>
12
13 4 Rafael Bailon-Ruiz
h2. Accessing the files for a simulated cloud environment
14 3 Rafael Bailon-Ruiz
15 7 Rafael Bailon-Ruiz
In order to run CAMS in fully simulated mode first yout need a mesoNH file describing a synthetic atmospheric environment. MesoNH files are databases in "NetCDF _(.nc)_ format":https://en.wikipedia.org/wiki/NetCDF.
16 3 Rafael Bailon-Ruiz
17 5 Rafael Bailon-Ruiz
The computer @girofle@ at LAAS contains a mesoNH file that can be used with CAMS. You can use the command below to mount the folder the remote folder as a local directory:
18 3 Rafael Bailon-Ruiz
19
<pre><code class="shell">
20
sshfs girofle.laas.fr:/media/Nephelae-Data/data/Nephelae/ mesonh_girofle_mount/
21
</code></pre>
22
23 7 Rafael Bailon-Ruiz
The recommended file for this tutorial is:
24 1 Rafael Bailon-Ruiz
25 7 Rafael Bailon-Ruiz
<pre>
26
REFHR.1.ARMCu.4D.nc
27
</pre>
28 3 Rafael Bailon-Ruiz
29 7 Rafael Bailon-Ruiz
Despite its huge size (~72 GB), the best way to work with this particular file is to download it to your computer. If you are at LAAS connected with an Ethernet cable, you have a high-bandwith and low-lattency link. Therefore you can read the files in the remote folder directly, but beware of errors that can occur if the quality of the connection degrades.
30 1 Rafael Bailon-Ruiz
31 3 Rafael Bailon-Ruiz
32 1 Rafael Bailon-Ruiz
h2. Scenario setup
33
34 9 Rafael Bailon-Ruiz
A valid configuration file is required to run the graphical interface server. Scenario configuration files describe the atmospheric environment and the UAVs so CAMS can use the appropriate algorithms and models to manage them. For this tutorial a simple configuration file is provided describing a scenario built upon a simulated atmosphere with cumulus clouds and two UAVs. 
35 3 Rafael Bailon-Ruiz
36 9 Rafael Bailon-Ruiz
1. Download the configuration file for this tutorial: !tutorial_simulation_mesonh_2uav.yaml!
37
38 3 Rafael Bailon-Ruiz
There are dedicated tutorial and reference guide wiki pages for scenario configuration, but for an initial run let's use a simple file.
39 1 Rafael Bailon-Ruiz
40
To configure manually: 
41
42 9 Rafael Bailon-Ruiz
<pre>
43
database/filepath: '/PATH/TO/database01.neph'
44
mesonh_files:  &mesonh_files '/PATH/TO/REFHR.1.ARMCu.4D.nc'
45
aircrafts/200/plugins/Missions/backup_file: '/PATH/TO/backup_200.bin'
46
aircrafts/201/plugins/Missions/backup_file: '/PATH/TO/backup_201.bin'
47
</pre>
48 8 Rafael Bailon-Ruiz
49
<pre>
50
51
---
52
# local frame must be given in utm coordinates
53
local_frame:
54
    east:     &local_frame_east   360284.0
55
    north:    &local_frame_north 4813595.0
56
    alt:      &local_frame_alt         0.0
57
    utm_zone: &local_frame_utm_zone    31N
58
59
# flight area in local coordinates
60
flight_area: &flight_area [[-1000.0, -5000.0, -100.0], [15000.0, 5000.0, 4000.0]]
61
62
# allow_warm_start: True
63
allow_warm_start: False
64
65
# database config
66
database:
67
    enable_save: False
68
    filepath: '/home/rbailonr/src/nephelae/nephelae_workdir/database01.neph'
69
    overwrite_existing: True
70
71
mesonh_files:  &mesonh_files '/home/rbailonr/src/nephelae/REFHR.1.ARMCu.4D.nc'
72
73
# Setting this to true will activate feedback to WORLD_ENV requests
74
# Do not pass it to True : NOT WORKING...
75
wind_feedback: False
76
77
# Setting this value forces the mesonh variables to read only this time
78
mesonh_fixed_time: &mesonh_fixed_time 96
79
80
# WindMap is constant => no wind here [0, 0]
81
wind_map:
82
    type: 'WindMapConstant'
83
    name: 'Horizontal Wind'
84
    wind: [-0.0, 0.0]
85
86
# DataViews
87
data_views:
88
    # View of liquid water content (data from Mesonh)
89
    humidity:
90
        type: 'FetchView'
91
        name: 'Humidity'
92
        tags: ['RCT']
93
        displayable: true
94
95
    # View of vertical wind (data from Mesonh)
96
    verticalWind:
97
        type: 'FetchView'
98
        name: 'Vertical Wind'
99
        tags: ['WT']
100
        displayable: true
101
102
    # View of temperature (data from Mesonh)
103
    temperature:
104
        type: 'FetchView'
105
        name: 'Temperature'
106
        tags: ['THT']
107
        displayable: true
108
109
    # View of altitude (data from the autopilot / registered data)
110
    altitude:
111
        type: 'StatusView'
112
        name: 'Altitude'
113
        tags: null
114
        displayable: true
115
116
    # View of time (since the task has started / registered data)
117
    time:
118
        type: 'StatusView'
119
        name: 'Time'
120
        info: 'time'
121
        tags: null
122
        displayable: true
123
124
# Play with the mesonh origin if you want to have a cloud near your standby
125
# position [t, x, y ,z]
126
mesonh_origin: &mesonh_origin [-460.0, -1400.0, -3000.0, -280.0]
127
128
129
130
# Default fields. Used to define yaml aliases, to define values in one single place.
131
defaults:
132
    start: &start_defaults
133
        - Length: [3]
134
        - SimpleBounds: [*flight_area]
135
    circle_radius:
136
        - &circle_radius_min  80.0
137
        - &circle_radius_max 500.0
138
        - defaults: &circle_radius_defaults
139
            - DefaultValue: [120.0]
140
            - SimpleBounds: [[*circle_radius_min, *circle_radius_max]]
141
    altitude:
142
        - &altitude_min  185.0
143
        - &altitude_max 4000.0
144
        - defaults: &altitude_defaults
145
            - SimpleBounds: [[-1000.0, 4000.0]]
146
    drift:
147
        - &xdrift_min -10.0
148
        - &xdrift_max  10.0
149
        - &ydrift_min -10.0
150
        - &ydrift_max  10.0
151
        - &zdrift_min  -3.0
152
        - &zdrift_max   3.0
153
        - drift: &drift_defaults
154
            - DefaultValue: [[0.0,0.0,0.0]]
155
            - Length: [3]
156
            - SimpleBounds: [[[*xdrift_min, *ydrift_min, *zdrift_min],
157
                              [*xdrift_max, *ydrift_max, *zdrift_max]]]
158
        - hdrift: &hdrift_defaults
159
            - Length: [2]
160
            - SimpleBounds: [[[*xdrift_min, *ydrift_min],
161
                              [*xdrift_max, *ydrift_max]]]
162
        - zdrift: &zdrift_defaults
163
            - SimpleBounds: [[*zdrift_min, *zdrift_max]]
164
165
    lace: &lace_defaults
166
        parameters:
167
            start: *start_defaults
168
            first_turn_direction:
169
                - DefaultValue:  [1.0]
170
                - AllowedValues: [[-1.0, 1.0]]
171
            circle_radius: *circle_radius_defaults
172
            drift: *drift_defaults
173
        updatables:
174
            hdrift: *hdrift_defaults
175
            zdrift: *zdrift_defaults
176
177
    rosette: &rosette_defaults
178
        parameters:
179
            start: *start_defaults
180
            first_turn_direction:
181
                - DefaultValue:  [1.0]
182
                - AllowedValues: [[-1.0, 1.0]]
183
            circle_radius: *circle_radius_defaults
184
            drift: *drift_defaults
185
        updatables:
186
            hdrift: *hdrift_defaults
187
            zdrift: *zdrift_defaults
188
189
    spiral3d: &spiral3d_defaults
190
        parameters:
191
            start: *start_defaults
192
            alt_stop: *altitude_defaults
193
            radius_start: *circle_radius_defaults
194
            radius_stop:  *circle_radius_defaults
195
            drift: *drift_defaults
196
        updatables:
197
            hdrift: *hdrift_defaults
198
            zdrift: *zdrift_defaults
199
200
    trinity: &trinity_defaults
201
        parameters:
202
            start: *start_defaults
203
            first_turn_direction:
204
                - DefaultValue:  [1.0]
205
                - AllowedValues: [[-1.0, 1.0]]
206
            circle_radius: *circle_radius_defaults
207
            drift: *drift_defaults
208
        updatables:
209
            hdrift: *hdrift_defaults
210
            zdrift: *zdrift_defaults
211
212
# List of possible UAVS : 200, 201, 202, 203, 204
213
# Configuration given : 
214
# - Autopilot : Paparazzi
215
# - No replay
216
aircrafts:
217
    200:
218
        replay: false
219
        type: 'pprz'
220
        plugins:
221
            - MesonhProbe:
222
                mesonhFiles: *mesonh_files
223
                mesonhVariables: ['RCT', 'RRT', 'WT', 'THT', ['UT','VT']]
224
                rctFeedback: True
225
                mesonhOrigin: *mesonh_origin
226
                fixTime: *mesonh_fixed_time
227
            - Missions:
228
                backup_file: '/home/rbailonr/src/nephelae/nephelae_workdir/backup_200.bin'
229
                Lace: *lace_defaults
230
                Rosette: *rosette_defaults
231
                Spiral3D: *spiral3d_defaults
232
                Trinity: *trinity_defaults
233
            - CloudCenterTracker:
234
                mapWhereCenterIs: 'LWC'
235
            - MissionWindUpdater:
236
                period: 10.0
237
            - Monitor
238
    201:
239
        replay: false
240
        type: 'pprz'
241
        plugins:
242
            - MesonhProbe:
243
                mesonhFiles: *mesonh_files
244
                mesonhVariables: ['RCT', 'RRT', 'WT', 'THT', ['UT','VT']]
245
                rctFeedback: True
246
                mesonhOrigin: *mesonh_origin
247
                fixTime: *mesonh_fixed_time
248
            - Missions:
249
                backup_file: '/home/rbailonr/src/nephelae/nephelae_workdir/backup_201.bin'
250
                Lace: *lace_defaults
251
                Rosette: *rosette_defaults
252
                Spiral3D: *spiral3d_defaults
253
                Trinity: *trinity_defaults
254
            - CloudCenterTracker:
255
                mapWhereCenterIs: 'LWC'
256
            - MissionWindUpdater:
257
                period: 10.0
258
            - Monitor
259
260
maps:
261
    kernels:
262
        lwc_kernel:
263
            type: 'WindKernel'
264
            length_scales: [120.0, 60.0, 60.0, 60.0]
265
            variance: 1.0e-8
266
            noise_variance: 1.0e-10
267
    LWC:
268
        name: 'Liquid Water Cyan'
269
        type: 'GprMap'
270
        kernel: 'lwc_kernel'
271
        data_view: 'humidity'
272
        data_range: [0.0, 1.0e-4]
273
        threshold: 2.0e-4
274
        std_map: 'Liquid Water std' # optional
275
        border_map: 'Liquid Water border' # optional
276
277
    clouds:
278
        name: 'Liquid Water (MesoNH)'
279
        type: 'MesonhMap'
280
        mesonh_variable: 'RCT'
281
        origin: *mesonh_origin
282
</pre>
283
284 3 Rafael Bailon-Ruiz
285
h2.