Page History
If you select this option in the Setup Tab of the LCC (Deploy Distributed), the behaviour behavior of the whole deployment changes fundamentally . Your software is no longer deployed once locally on your device. If no NUCs are online or set up, one instance of your selected program is started for each vehicle that is online at that time, so make sure that your software can deal with getting one vehicle ID each and that the started programs can communicate with each other (if necessary). The same also holds if NUCs are set up - your software is started on the NUCs (HLCs). (Your system must have installed the full setup). Each NUC takes care of one vehicle only. If more vehicles than NUCs are online, the remaining programs will run locally on your PC.
Requirements
Use the main PC
The main Lab PC (IP: 192.168.1.249) must be running (with an Apache Server), ideally before the NUCs are turned on.
Setting up the NUCs correctly
...
Provide all required packages
You need to do this before Before turning the NUCs on
- Start the main PC (IP: 192.168.1.249)
- Build the lab software (or make sure your desired version was the most recent build)
The middleware, cpm library and autostart software must be built - the build script puts data required for the software to work on the NUCs in folders that allow the NUCs to download it from the Apache Server (/var/www/html/nuc
).
...
If you use Matlab you need to use the init script. Load required data (e.g. XML configuration files), setup the reader and writer etc. Alternatively, use a script that is inspired by the init script. QOS_LOCAL_COMMUNICATION.xml is always located in ~/software/middleware/build
, and precompiled DDS IDL Matlab files can always be found in ~/software/cpm_lib/dds_idl_matlab
. Other files cannot be expected to be found on the NUC, unless you put them in the same folder as your own script.
Infocode | ||
---|---|---|
| ||
clc |
General information
Mapping of vehicle IDs
Vehicle IDs are matched to available NUC IPs The available NUCs are mapped to vehicles in an ascending order (IP ...211 → ID 1, IP NUC 11 → vehicle 1, NUC 15 → vehicle 4, ...215 → ID 4), depending on the vehicle IDs you have selected.You cannot simulate more vehicles remotely than NUCs are available - each .
Each NUC is always responsible for one vehilce only. Any further vehicle is simulated on your local devicevehicle only.
Using IDL-Datatypes and the cpm library
...
There is a folder called bash in the source code of the LCC. It contains scripts that are relevant for (remote) deployment of scripts, uploading scripts etc. You do not need to understand these scripts, but they are also used to load environment variables. You might encounter an error if you e.g. use another version of DDS than specified e.g. in environment_variables.bash. Your software might, for example, simply not start if the required variables could not be set. Make sure that you use the same package versions or change the entries accordingly.
Specifying the matlab version for HLCs on the NUCs
Anchor | ||||
---|---|---|---|---|
|
In the aforementioned bash folder there is a file lab_control_center/bash/tmux_script.bash in which the path to the Matlab version that the NUC uses to execute the HLC scripts can be specified. For example to select MATLAB 2022a:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
...
#Evaluate the matlab script
SCRIPT_NAME="${SCRIPT_NAME%%.*}" #remove .m
/usr/local/MATLAB/R2022a/bin/matlab -logfile matlab.log -sd "${PATH_TO_SCRIPT}" -batch "${SCRIPT_NAME}(${SCRIPT_ARGS})"
... |
or MATLAB 2020a:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
/opt/MATLAB/R2020a/bin/matlab -logfile matlab.log -sd "${PATH_TO_SCRIPT}" -batch "${SCRIPT_NAME}(${SCRIPT_ARGS})" |
Integrated error checking
...
The following data type is used to check for NUC-crashes.
https://github.com/embedded-software-laboratory/cpm_lab/blob/master/cpm_lib/dds_idl/HLCHello.idl
Explanation: Hello messages are sent regularly by each NUC. Missing messages or unexpected entries can be used to detect errors.
...
The UI indicates how many NUCs are online. The UI shows you how many NUCs are currently online (matching might take up to a minute after the NUCs have been booted and your program has started.) This can be useful for debugging or to find out on how many NUCs you can remotely distributedly deploy your program before, for the rest of your selected vehicles, the computation for those takes place locally. You can expand the section by clicking on the little triangle, thus revealing the IDs of the HLCs which are currently online:
...
- You are using the wrong domain ID (DDS) for the LCC. If LCC and NUCs are not within the same DDS domain, they cannot discover each other. Please check which ID you need to use.
- Packages are missing on the NUCs. In this case, upload packages are missing on the main PC or the NUCs have not been set up correctly (e.g. the autostart task, see requirements)
- The NUCs or your PC are not connected to the same network
- You are not using the main Lab PC (which is recommended for remote distributed deployment)
- The NUCs crashed
...
You can find out what to enter here if you hover over the input. You can either enter a comma-separated list that the LCC is supposed to remotely reboot (you can check if that worked by examining the online HLCs simultaneously), or you can enter a '*' to tell the LCC to reboot all currently connected NUCs.
Tip | ||
---|---|---|
| ||
The NUCs do not show up as online in the LCC despite running?
The upload of your HLC-Files crashes due to denied permission?
|
Crash checks for your programs
...