Project

General

Profile

Actions

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

« Previous | Revision 9/29 (diff) | Next »
Rafael Bailon-Ruiz, 2020-10-08 14:18


Running CAMS (Tutorial)

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

First of all, make sure you successfully completed the Installation (Developer) tutorial. Then, open a terminal and change the current directory to the folder where the core packages are installed.

cd /path/to/nephelae_workspace

Accessing the files for a simulated cloud environment

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.

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:

sshfs girofle.laas.fr:/media/Nephelae-Data/data/Nephelae/ mesonh_girofle_mount/

The recommended file for this tutorial is:

REFHR.1.ARMCu.4D.nc

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.

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:

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:

database/filepath: '/PATH/TO/database01.neph'
mesonh_files:  &mesonh_files '/PATH/TO/REFHR.1.ARMCu.4D.nc'
aircrafts/200/plugins/Missions/backup_file: '/PATH/TO/backup_200.bin'
aircrafts/201/plugins/Missions/backup_file: '/PATH/TO/backup_201.bin'

---
# local frame must be 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 to true will activate feedback to WORLD_ENV requests
# Do not pass it to True : NOT WORKING...
wind_feedback: False

# Setting this value forces the mesonh variables to 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 autopilot / registered data)
    altitude:
        type: 'StatusView'
        name: 'Altitude'
        tags: null
        displayable: true

    # View of time (since the task has started / registered data)
    time:
        type: 'StatusView'
        name: 'Time'
        info: 'time'
        tags: null
        displayable: true

# Play with the mesonh origin if you want to have a cloud near your standby
# position [t, x, y ,z]
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.
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

# List of possible UAVS : 200, 201, 202, 203, 204
# Configuration given : 
# - Autopilot : Paparazzi
# - 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

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

h2.

Updated by Rafael Bailon-Ruiz over 3 years ago · 9 revisions