The plugin automatically downloads the required compiler binaries and stores it in
Documents/UAVOS/Scripts/compiler folder. The compiler is based on wasi-sdk distribution.
The GCS has a built-in script editor, which has the basic functionality to edit, compile and save/load files.
Visual Studio Code IDE
.vscode configuration is provided to ease script development in
Documents/UAVOS/Scripts folder. The
.vscode files are copied by GCS from its resources. The configuration provides support for script compilation, linter, formatting, tasks, etc.
To use Visual Studio Code as IDE, follow these steps:
- open GCS built-in script editor for a node parameter;
- save script to a file in
- open the workspace
VScode, edit the saved file as desired;
- compile the file by using the provided task (for debug/linter purposes);
- GCS will watch the saved script file for changes and update the node parameter automatically;
When GCS script editor saves a script to a file or loads from a file - such file is watched for modifications by the GCS and the node configuration parameter is updated accordingly upon changes of the file’s content are detected.
The node parameter, which have the
scriptas its content will be compiled by the GCS on it’s value changes. You may need to
uploadthe vehicle parameters to bring the compiled script to run onboard;
Every script should have the following statement to interact with the APX node resources:
This will include the
apx.h file from
sysroot/include folder, which declares all APX node interfaces. See the example called
ApxTest.cpp for use cases.
clang WASM compiler is invoked by the GCS with the option
--sysroot=<path to sysroot>, according to this configuration.
More information can be found here:
Documents/UAVOS/Scripts/sysrootfolder - this is the
sysrootof the scripts compiled by the GCS;
- sysroot - the source code of the sysroot, which is copied to user folder;
- defined-symbols.txt - list of defined/linkable symbols, i.e. a node provides native implementation of these symbols;
Script examples are provided in
Documents/UAVOS/Scripts/examples folder for reference, and are copied by the GCS from its resources.
Check UAVOS GitHub organization for public repositories.