Project

General

Profile

Running CAMS in simulation mode (Tutorial) » History » Revision 10

Revision 9 (Rafael Bailon-Ruiz, 2020-10-08 14:18) → Revision 10/29 (Rafael Bailon-Ruiz, 2020-10-08 14:47)

h1. Running CAMS (Tutorial) 

 This tutorial will teach you how to run the CAMS GUI with a simple scenario in simulation mode. 

 {{toc}} 

 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. 

 <pre><code class="shell"> 
 cd /path/to/nephelae_workspace 
 </code></pre> 

 h2. Access Accessing the files for a simulated cloud environment files 

 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. 

 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: 

 <pre><code class="shell"> 
 sshfs girofle.laas.fr:/media/Nephelae-Data/data/Nephelae/ mesonh_girofle_mount/ 
 </code></pre> 

 The recommended file for this tutorial is: 

 <pre> 
 REFHR.1.ARMCu.4D.nc 
 </pre> 

 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. 


 h2. Scenario setup 

 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.  

 1. Download the configuration file for this tutorial: attachment:tutorial_simulation_mesonh_2uav.yaml !tutorial_simulation_mesonh_2uav.yaml! 

 2. You need adapt the following configuration values to match with the path of your CAMS workspace. Replace @/PATH/TO/@ with the actual path. 


 There are dedicated tutorial and reference guide wiki pages for scenario configuration, but for an initial run let's use a simple file. 

 To configure manually:  

 <pre> 
 database: filepath: database/filepath: '/PATH/TO/database01.neph'    # CAMS database file. It stores the atmospheric and UAV information generated during the run 
 mesonh_files:    &mesonh_files '/PATH/TO/REFHR.1.ARMCu.4D.nc' # MesoNH simulation file. 
 aircrafts: 200: plugins: Missions: backup_file: aircrafts/200/plugins/Missions/backup_file: '/PATH/TO/backup_200.bin' # 
 aircrafts: 201: plugins: Missions: backup_file: aircrafts/201/plugins/Missions/backup_file: '/PATH/TO/backup_201.bin' # 
 </pre> 

 There are many other options that can <pre> 

 --- 
 # local frame must be set given in utm coordinates 
 local_frame: 
     east:       &local_frame_east     360284.0 
     north:      &local_frame_north 4813595.0 
     alt:        &local_frame_alt           0.0 
     utm_zone: &local_frame_utm_zone      31N 

 # flight area in local coordinates 
 flight_area: &flight_area [[-1000.0, -5000.0, -100.0], [15000.0, 5000.0, 4000.0]] 

 # allow_warm_start: True 
 allow_warm_start: False 

 # database config 
 database: 
     enable_save: False 
     filepath: '/home/rbailonr/src/nephelae/nephelae_workdir/database01.neph' 
     overwrite_existing: True 

 mesonh_files:    &mesonh_files '/home/rbailonr/src/nephelae/REFHR.1.ARMCu.4D.nc' 

 # Setting this configuration file to adapt CAMS true will activate feedback to your needs. For more information, there is a [[scenario configuration reference guide]] in the wiki but for now should stay with the default setup. WORLD_ENV requests 
 # Do not pass it to True : NOT WORKING... 
 wind_feedback: False 

 TODO: Introduce & explain # Setting this value forces the main parameter groups in the configuration file mesonh variables to give an overview read only this time 
 mesonh_fixed_time: &mesonh_fixed_time 96 

 # WindMap is constant => no wind here [0, 0] 
 wind_map: 
     type: 'WindMapConstant' 
     name: 'Horizontal Wind' 
     wind: [-0.0, 0.0] 

 # DataViews 
 data_views: 
     # View of liquid water content (data from Mesonh) 
     humidity: 
         type: 'FetchView' 
         name: 'Humidity' 
         tags: ['RCT'] 
         displayable: true 

     # View of vertical wind (data from Mesonh) 
     verticalWind: 
         type: 'FetchView' 
         name: 'Vertical Wind' 
         tags: ['WT'] 
         displayable: true 

     # View of temperature (data from Mesonh) 
     temperature: 
         type: 'FetchView' 
         name: 'Temperature' 
         tags: ['THT'] 
         displayable: true 

     # View of altitude (data from the situation autopilot / registered data) 
     altitude: 
         type: 'StatusView' 
         name: 'Altitude' 
         tags: null 
         displayable: true 

     # View of time (since the user will be managing. 


 h2. Launch the UAV simulation task has started / registered data) 
     time: 
         type: 'StatusView' 
         name: 'Time' 
         info: 'time' 
         tags: null 
         displayable: true 

 # Play with paparazzi 

 Open a new terminal, change the current directory mesonh origin if you want to the paparazzi installation folder and open the _Paparazzi center_ : 

 <pre><code class="shell"> have a cloud near your standby 
 cd /PATH/TO/paparazzi # position [t, x, y ,z] 
 ./paparazzi mesonh_origin: &mesonh_origin [-460.0, -1400.0, -3000.0, -280.0] 



 # Default fields. Used to define yaml aliases, to define values in one single place. 
 </code></pre> defaults: 
     start: &start_defaults 
         - Length: [3] 
         - SimpleBounds: [*flight_area] 
     circle_radius: 
         - &circle_radius_min    80.0 
         - &circle_radius_max 500.0 
         - defaults: &circle_radius_defaults 
             - DefaultValue: [120.0] 
             - SimpleBounds: [[*circle_radius_min, *circle_radius_max]] 
     altitude: 
         - &altitude_min    185.0 
         - &altitude_max 4000.0 
         - defaults: &altitude_defaults 
             - SimpleBounds: [[-1000.0, 4000.0]] 
     drift: 
         - &xdrift_min -10.0 
         - &xdrift_max    10.0 
         - &ydrift_min -10.0 
         - &ydrift_max    10.0 
         - &zdrift_min    -3.0 
         - &zdrift_max     3.0 
         - drift: &drift_defaults 
             - DefaultValue: [[0.0,0.0,0.0]] 
             - Length: [3] 
             - SimpleBounds: [[[*xdrift_min, *ydrift_min, *zdrift_min], 
                               [*xdrift_max, *ydrift_max, *zdrift_max]]] 
         - hdrift: &hdrift_defaults 
             - Length: [2] 
             - SimpleBounds: [[[*xdrift_min, *ydrift_min], 
                               [*xdrift_max, *ydrift_max]]] 
         - zdrift: &zdrift_defaults 
             - SimpleBounds: [[*zdrift_min, *zdrift_max]] 

     lace: &lace_defaults 
         parameters: 
             start: *start_defaults 
             first_turn_direction: 
                 - DefaultValue:    [1.0] 
                 - AllowedValues: [[-1.0, 1.0]] 
             circle_radius: *circle_radius_defaults 
             drift: *drift_defaults 
         updatables: 
             hdrift: *hdrift_defaults 
             zdrift: *zdrift_defaults 

     rosette: &rosette_defaults 
         parameters: 
             start: *start_defaults 
             first_turn_direction: 
                 - DefaultValue:    [1.0] 
                 - AllowedValues: [[-1.0, 1.0]] 
             circle_radius: *circle_radius_defaults 
             drift: *drift_defaults 
         updatables: 
             hdrift: *hdrift_defaults 
             zdrift: *zdrift_defaults 

     spiral3d: &spiral3d_defaults 
         parameters: 
             start: *start_defaults 
             alt_stop: *altitude_defaults 
             radius_start: *circle_radius_defaults 
             radius_stop:    *circle_radius_defaults 
             drift: *drift_defaults 
         updatables: 
             hdrift: *hdrift_defaults 
             zdrift: *zdrift_defaults 

     trinity: &trinity_defaults 
         parameters: 
             start: *start_defaults 
             first_turn_direction: 
                 - DefaultValue:    [1.0] 
                 - AllowedValues: [[-1.0, 1.0]] 
             circle_radius: *circle_radius_defaults 
             drift: *drift_defaults 
         updatables: 
             hdrift: *hdrift_defaults 
             zdrift: *zdrift_defaults 

 1. Select the aircraft @Lisa_Neph_0@ from the A/C list # List of possible UAVS : 200, 201, 202, 203, 204 
 2. Click build # Configuration given :  
 # - Autopilot : Paparazzi 
 3. Repeat the same procedure with the @Lisa_Neph_1@ aircraft # - No replay 
 aircrafts: 
     200: 
         replay: false 
         type: 'pprz' 
         plugins: 
             - MesonhProbe: 
                 mesonhFiles: *mesonh_files 
                 mesonhVariables: ['RCT', 'RRT', 'WT', 'THT', ['UT','VT']] 
                 rctFeedback: True 
                 mesonhOrigin: *mesonh_origin 
                 fixTime: *mesonh_fixed_time 
             - Missions: 
                 backup_file: '/home/rbailonr/src/nephelae/nephelae_workdir/backup_200.bin' 
                 Lace: *lace_defaults 
                 Rosette: *rosette_defaults 
                 Spiral3D: *spiral3d_defaults 
                 Trinity: *trinity_defaults 
             - CloudCenterTracker: 
                 mapWhereCenterIs: 'LWC' 
             - MissionWindUpdater: 
                 period: 10.0 
             - Monitor 
     201: 
         replay: false 
         type: 'pprz' 
         plugins: 
             - MesonhProbe: 
                 mesonhFiles: *mesonh_files 
                 mesonhVariables: ['RCT', 'RRT', 'WT', 'THT', ['UT','VT']] 
                 rctFeedback: True 
                 mesonhOrigin: *mesonh_origin 
                 fixTime: *mesonh_fixed_time 
             - Missions: 
                 backup_file: '/home/rbailonr/src/nephelae/nephelae_workdir/backup_201.bin' 
                 Lace: *lace_defaults 
                 Rosette: *rosette_defaults 
                 Spiral3D: *spiral3d_defaults 
                 Trinity: *trinity_defaults 
             - CloudCenterTracker: 
                 mapWhereCenterIs: 'LWC' 
             - MissionWindUpdater: 
                 period: 10.0 
             - Monitor 

 !paparazzi_center_instructions.png! 

 maps: 
     kernels: 
         lwc_kernel: 
             type: 'WindKernel' 
             length_scales: [120.0, 60.0, 60.0, 60.0] 
             variance: 1.0e-8 
             noise_variance: 1.0e-10 
     LWC: 
         name: 'Liquid Water Cyan' 
         type: 'GprMap' 
         kernel: 'lwc_kernel' 
         data_view: 'humidity' 
         data_range: [0.0, 1.0e-4] 
         threshold: 2.0e-4 
         std_map: 'Liquid Water std' # optional 
         border_map: 'Liquid Water border' # optional 

     clouds: 
         name: 'Liquid Water (MesoNH)' 
         type: 'MesonhMap' 
         mesonh_variable: 'RCT' 
         origin: *mesonh_origin 
 </pre> 


 h2.