Project

General

Profile

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

Revision 10 (Rafael Bailon-Ruiz, 2020-10-08 14:47) → Revision 11/29 (Rafael Bailon-Ruiz, 2020-10-08 15:00)

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 the 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 

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


 <pre> 
 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: '/PATH/TO/backup_200.bin' # 
 aircrafts: 201: plugins: Missions: backup_file: '/PATH/TO/backup_201.bin' # 
 </pre> 

 There are many other options that can be set in this configuration file to adapt CAMS 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. 

 TODO: Introduce & explain the main parameter groups in the configuration file to give an overview of the situation the user will be managing. 


 h2. Launch the UAV simulation with paparazzi 

 h3. Configure the UAVs 

 Open a new terminal, change the current directory to the paparazzi installation folder and open the _Paparazzi center_ : 

 <pre><code class="shell"> 
 cd /PATH/TO/paparazzi 
 ./paparazzi 
 </code></pre> 

 1. Select the aircraft *Lisa_Neph_0* @Lisa_Neph_0@ from the A/C list 

 
 2. Click build 

 
 3. Repeat the same procedure with the *Lisa_Neph_1* @Lisa_Neph_1@ aircraft 

 !paparazzi_center_instructions.png! 

 *You only need to do this operation once, unless you modify the UAVs or change computers!* 

 h3. Start the simulation 

 Open two new terminal windows and run respectively to start the simulation of both UAVs: 

 <pre><code class="shell"> 
 cd nephelae_paparazzi/tests/sim_launchers && python3 sim_launcher.py Lisa_Neph_0 
 </code></pre> 

 <pre><code class="shell"> 
 cd nephelae_paparazzi/tests/sim_launchers && python3 sim_launcher.py Lisa_Neph_1 
 </code></pre> 

 Four new windows will appear _(You can close the duplicated GCS)_ 

 | !server_lisa_neph_0.png! | !server_lisa_neph_1.png! |  




 !paparazzi_gcs_2_UAV_simulation_tutorial.png! 

 Wait a couple of seconds for the simulation to warm up and then click on the *launch button* !gcs_launch_button.png! on *Lisa_Neph_0* and *Lisa_Neph_1*