Creating a new CLAID package¶
Welcome to this tutorial on creating custom packages for CLAID! CLAID packages allow you to add your implemented new features based on CLAID and optionally share it with others. Typical scenarios include adding new Sensor Modules (e.g., to support new devices) or deploying machine learning models and algorithms. Before you can start creating CLAID packages, you have to set up the following prerequisites:
- CLAID command line tools: Tools aiding you in creating and building CLAID packages.
- CLAID SDK: Libraries enabling you to build CLAID packages locally.
- Build tools: Required to compile packages for certain platforms (e.g., Android Studio for Android packages).
Check out the instructions below.
Information for Windows users
It is currently not possible to build CLAID packages under Windows. We currently only support Linux and macOS for building CLAID packages.
1.1 Installing the CLAID command line tools¶
The following instructions will guide you in setting up the CLAID command line tools on your system. Specifically, you will set up the CLAID python package, which comes with a command line utility which is helpful in creating claid applications or packages.
Installing the CLAID command line utils
We highly recommend using a virtual python environment when using CLAID. We recommend Anaconda to manage virtual Python environments. You can download it from here: Anaconda. Once you have installed anaconda, open a command line terminal and execute the command below to setup a new anaconda environment. CLAID requires a python version >= 3.9. Use the following command to create a new environment for CLAID using Python 3.9.
Once the environment has been created, activate it using the following command: Make sure that you are using this environment throughout the subsequent tutorial series.Once you have set up the environment, it is time to install CLAID. CLAID for Python can be installed using the pip package manager. Execute the following in a command line terminal, which will automatically install the newest version of CLAID:
Upon successfull installation, please test the CLAID installation by running the following command in your terminal:
You should see the following output:
If you do see the output, CLAID is installed successfully and ready to be used.
1.2 Installing the CLAID SDK¶
To install the CLAID SDK, you need to download the SDK and create an environment variable. Check out the instructions below:
Installing the CLAID SDK
The CLAID SDK contains libraries and definition files required to build CLAID packages locally. To install the SDK, download it from our release files and extract it to a folder of your choice. Next, you need to set an environment variable CLAID_SDK_HOME, pointing to the path of the SDK. You can use the following commands on Linux or macOS.
On Linux
wget https://github.com/ADAMMA-CDHI-ETH-Zurich/CLAID/releases/download/v0.6.1/CLAIDSDK.zip ~/CLAIDSDK
echo "export CLAID_SDK_HOME=~/CLAIDSDK" >> ~/.bashrc
source ~/.bashrc
On macOS
wget https://github.com/ADAMMA-CDHI-ETH-Zurich/CLAID/releases/download/v0.6.1/CLAIDSDK.zip ~/CLAIDSDK
echo "export CLAID_SDK_HOME=~/CLAIDSDK" >> ~/.zshrc
source ~/.zshrc
To test if the CLAID SDK was installed successfully, run the following command in your terminal:
You should see the following output:
1.3 Installing build tools: Android Studio, Protobuf, Flutter¶
Building CLAID packages requires to install the Java Development Kit (JDK), Android Studio and the protobuf compiler. Further, if you want to install CLAID packages for Flutter, you need to install Flutter as well.
Installing the build tools
First, make sure to install Android Studio. Afterward, install the JDK, Protobuf compiler, and Dart Protobuf plugin using the commands below:
On Linux:
sudo apt-get install default-jdk
sudo apt-get install -y protobuf-compiler
dart pub global activate protoc_plugin
On macOS:
Once you installed everything, you can check if the build tools are installed correctly using the command below:
You should see the following output: