Project

General

Profile

Scenario configuration reference guide » History » Version 1

Rafael Bailon-Ruiz, 2020-08-28 17:50

1 1 Rafael Bailon-Ruiz
h1. Scenario configuration
2
3
This page is meant to guide users on how to write a scenario configuration file for the CAMS.
4
5
A scenario configuration file is the description of the agents and processes that will be used by CAMS. These include: Aircrafts, Maps, Flight zones, Navigation frame, Data views, GPR Kernels and Database options among others.
6
7
h2. General structure of configuration files
8
9
Configuration files are written using "YAML":https://yaml.org/ markup. verify your syntax by following the guidelines provided by YAML.
10
11
h3. Quick tips:
12
* Use references : "&name_reference value" to create and define the reference, "*name_reference" to use it
13
* Namespaces can be defined either as a variable, as a dictionnary if others namespaces are declared inside, or as a list using minuses ( - )
14
* Values can be : Strings, Lists, Floats, Integers, Booleans (primary types)
15
16
The following will help you to write every aspect of your configuration file :
17
 
18
19
h3. Local Frame :
20
21
**local_frame** is defined in utm coordinates and have 4 different fields : **east**, **north**, **alt**, **utm_zone**.
22
- east, north and alt are floats
23
- utm_zone is a string
24
 
25
26
h3. Flight area :
27
28
The **flight_area** is a single value that is a list. This list contains two other list and both of the lists containing three floats (x, y, z). These floats are the minimal (first list) and maximal (last list) boundaries of the flight area.
29
 
30
31
h3. Database :
32
 
33
The **database** can be defined by defining three fields :
34
- **enable_save**, boolean. If the boolean is set to true, will write periodically the database in a file
35
- **filepath**, string. This is the string representation of the path used to save the file on your machine (you should use an absolute path)
36
- **overwrite_existing**, boolean. If set to true, will rewrite the existing file (if it exists)
37
38
h3. Wind Map :
39
40
While this is a map, the *wind_map* is set apart from the other maps. It possesses three different fields :
41
- **type**, which is a string. It refers to the type of wind map that will be used. For now you can only choose between 'WindObserverMap' and 'WindMapConstant'. Check the python documentation for the different types of wind maps.
42
- **name**, which is a string. It is the name of the map.
43
Depending of the type, the third field can be different :
44
- **wind**, if the type set is WindMapConstant. In this case, the value of this field is a list of two floats, representing respectively the speed of the wind in east and north directions.
45
- **sampleName**, if the type set is WindObserverMap. In this case, the value of this field is a list of two string, representing respectively the variables that are listened by the map to fetch informations on the wind.
46
47
h3. Data Views : 
48
49
The **data_views** is a collection of data views, each defined with a unique namespace. The number of data views can change between multiple scenarios. Each data view has two mandatory fields and an optional one.
50
- **type** is a string, representing the type of the data view used. This type can only be one of the following : 'FetchView', 'StatusView', 'HumidityCalibration', 'CloudSensorProcessing', 'Scaling', 'TimeView'. Refer to the python documentation for more informations on these types.
51
- **name** is a string, it is the name of the data view 
52
- **displayable** is an optional field. It is a boolean. If set to true, will appear in the charts of CAMS.
53
Other than that, the data view can have other fields to fill depending of the type set.
54
55
For FetchView :
56
- **tags** is a list of string, representing the tags of the data the view must search in the database.
57
 
58
For StatusView :
59
- **tags** is a single string, representing the id of uav to search for in the database. It can be set to null, resulting on fetching status of every uavs
60
- **info** is an optional string, that is used to fetch a specific status info. (The position in **x**, **y**, **alt**, **time**)
61
 
62
63
For HumidityCalibration :
64
- **lt** is a float, that is the threshold value
65
- **gain_1** is a float, that is the factor of the first linear function
66
- **offset_1** is a float, that is the offset of the first linear function
67
- **gain_2** is a float, that is the factor of the second linear function
68
- **offset_2** is a float, that is the offset of the second linear function
69
- **parents** is a list, that contains every parent of this view. The strings contained in the list must exists in data views keys.
70
 
71
72
For CloudSensorProcessing :
73
- **cloud_tags** is a list of string, representing the tags of the data related to the clouds that must be searched in the database
74
- **energy_tags** is a list of string, representing the tags of the data related to the uav energy (battery) that must be searched in the database
75
- **alpha** is a float that is the factor of the linear function applied
76
- **beta** is a float that is the offset of the linear function applied
77
- **scaling** is a float
78
- **lengthMedian** is an integer
79
 
80
81
For Scaling : 
82
- **alpha** is a float that is the factor of the linear function applied
83
- **beta** is a float that is the offset of the linear function applied
84
- **parents** is a list, that contains every parent of this view. The strings contained in the list must exists in data views keys.
85
 
86
87
For TimeView : 
88
- **parents** is a list, that contains every parent of this view. The strings contained in the list must exists in data views keys.
89
 
90
91
h3. Aircrafts
92
93
The **aircrafts** set contains every aircraft that will fly during the scenario. The id of an aircraft is the key used in the collection.
94
Each aircraft can be passed in replay mode by defining the optional **replay** field to true.
95
 
96
97
Each aircraft has a **type** field that MUST be set. The values authorized are : 
98
- pprz (usage with paparazzi)
99
- base (usage without any monitoring uav software)
100
 
101
102
The aircrafts have also a list of plugins that are contained inside the **plugins** field.
103
List of plugins available : **MesonhProbe**, **Missions**, **CloudCenterTracker**, **MissionWindUpdater**, **Monitor**, **CloudSensor**, **MeteoStick**, **Energy**
104
The following plugins have additional fields that must be filled in order to use them :
105
 
106
107
For MesonhProbe :
108
- **mesonhFiles**, that is a string representation of the path of the mesonh file to read (use an absolute path)
109
- **mesonhVariables**, that are the mesonh variables fetched from the mesonh file. This is a list of string
110
- **rctFeedback**, that is a boolean.
111
- **mesonhOrigin**, that is a list of 4 floats, representing the starting point of the mesonh dataset [t, x, y, z]. If a value is negative, it means that the last index of the database minus this value will be set as the origin.
112
- **fixTime**, that is a number. Ignores always the time sent by the requests and returns only the state of the dataset for this value. (for more coherence, use the mesonh_fixed_time field as reference)
113
 
114
115
For Missions :
116
- **backup_file**, that is a string representation of the path of the file that will save and be loaded at the start of the simulation, and containing all informations on the missions for this uav
117
There are optional fields to add, each representing a different mission. There are four possible at the moment : **Lace**, **Spiral3D**, **Rosette**, **Trinity**
118
 
119
120
For CloudCenterTracker :
121
- **mapWhereCenterIs**, that is a string. This string must be one of the key used to define a map (see Maps definition part below)
122
 
123
124
For MissionWindUpdater :
125
- **period**, float.
126
 
127
128
h3. Maps
129
130
**maps** is a set containing kernels used for the maps and the definition of each map (except the wind map)
131
For the **kernels** field, it is a set of kernels defined.
132
Each kernel is defined like this :
133
- **type** is a string representing the type of kernel used. At the moment, you should use only 'WindKernel'
134
- **length_scales** is a list of 4 float (t, x, y, z). It represents the distance of a data from the current point before it becomes useless
135
- **variance** is a float representing the variance
136
- **noise_variance** is a float representing the variance of the noise
137
 
138
Then for the maps, there are only two fields in common :
139
- **name**, the string representation of the name of the map
140
- **type**, the type of map used (it can only be GprMap or MesonhMap)
141
For each type, there are multiple additional fields to fill.
142
 
143
144
For MesonhMap :
145
- **mesonh_variable**, string. This is the variable searched in the Mesonh Dataset
146
- **origin**, that is a list of 4 floats, representing the starting point of the mesonh dataset
147
 
148
149
For GprMap : 
150
- **kernel**, string. The value must be the same as one of the kernels keys
151
- **data_view**, string. The value must be the same as one of the data_views keys
152
- **data_range**, list of two elements representing the min and max value of the data. Used mainly for display purposes
153
- **threshold**, float. Threshold of the map, used mainly for the computation of cloud data
154
- **std_map**, string optional. If set, will create the standard deviation of the map. The value of the field will be the name of this map
155
- **border_map**, string optional. If set, will create the border cloud map. The value of the field will be the name of this map
156
157
h3. Additional Fields
158
159
**allow_warm_start** is a boolean. If it is set to True, will load the database and continue on it. (see the field **filepath** of the database)
160
**mesonh_fixed_time** is a number. This number is meant to indicate the only time read in the Mesonh Read (for instance, if the value is 96, the only time that is read is (time origin of the mesonh + 96) in the dataset). Other times are simply ignored. This variable must be set. If null, will work without a time fixed. The value is in seconds
161
**mesonh_files** is the string representation of the path of the mesonh file to read (use an absolute path)
162
**wind_feedback** is a boolean. Setting this to true will activate feedback when a WORLD_ENV request is sent to the ivy bus
163
 
164
165
h2. Use the config file
166
167
Once written, the NEPHELAE_CONFIG environment variable must be in order to use it. There are two ways to do it :
168
- Setting the NEPHELAE_CONFIG environment during the current session (using the bashrc for instance, don't forget to source it).
169
- Calling the 'make runserver' with the NEPHELAE_CONFIG as argument (like this : NEPHELAE_CONFIG=_path_file_  make runserver)
170
 
171
172
I recommend to use the first option if you plan to use only one file during a long period of time