2.2.3.1. Setup Control module

The control module currently uses an model predictiv control approach based on a solver by embotech. This solver needs to be built first before it can be used. In theory and maybe in the future it is possible to built this solver on one machine and share it with others. Currently we built the solver on the machine we want to use it.

To built a solver one needs an embotech engineering license. This license is only valid for one specific host computer identified by some finterprint.

To use the solver one needs floating licenses (we don’t have any, at the moment) or atleast an software or hardware testing license. This license is also bind to a system finterprint. Since we want to use the solver inside a docker container, we need to create and assign a new license every time we run a new container. Since one shouldn’t recreate a container lightly.

2.2.3.1.1. Prerequisites

You have to:

  1. Assign your docker container a software or hardware license

  2. Setup a virtual python environment (venv / virtualenv)

  3. Assign your host system an engineering license.

  4. Download and install the forces pro client.

2.2.3.1.1.1. Open MyEmbotech Portal

  1. Log into the MyEmbotech Portal.

  2. Switch to the overview page for our license group.

2.2.3.1.1.2. Assign the license for the docker container

  1. Execute the fingerprint tool inside the docker container:

    docker exec -it as bash
    ./src/control/FORCES_PRO_Fingerprinter_docker_linux_x86_64
    
  2. Copy the finterprint and assign a software or hardware license with Docker-Gnu-x86_64 as platform.

2.2.3.1.1.3. Setup a virtual environment for assigning the license for the host system:

When you don’t know, what an python virtual environment is, you can find an tutorial here. Either use Ubuntu for the following steps or execute them in the WSL.

  1. First, you have to install the virtualenv library for python

    python3 -m pip install virtualenv
    
  2. Change into the directory of the clones repository and create the virtualenv. The virtualenv will be created under ./venv

    python3 -m virtualenv venv
    
  3. Activate the virtual environment.

    source venv/bin/activate
    
  4. Install all necessary requirements

    pip install av
    pip install -r docker/additional_resources/requirements_base.txt
    pip install numpy==1.23.5
    

2.2.3.1.1.4. Assign the license for the host system

  1. Choose the Engineering Licenses tab on the overview page for our license group.

  2. Assign or transfer (preferably for a computer that doesn’t need it anymore) an engineering license.

  3. Download the fingerprint generator for your host os.

  4. Make the generator executable and execute it.

    Listing 2.1 Make the finterprint generator executable and execute it on Unix host system
    chmod +x FORCES_PRO_Fingerprinter_linux_x86_64 && ./FORCES_PRO_Fingerprinter_linux_x86_64
    
  5. Copy the fingerprint and assign an engineering license.

  6. Download the client for the newly assigned engineering license.

  7. Unzip the downloaded client into ./src/control/forces_pro_client

    You have to redownload the forces pro client everytime you assigned a new software or hardware testing license which you want to use with a solver generated with the respective engineering license.

2.2.3.1.2. Generate solver

You always have to regenerate the mpc if you changed its configuration.

  1. Ensure that you activated the virtual python environment.

  2. Ensure that you specified a suitable configuration for the mpc in src/control/config/control.yaml

  3. Generate the solver:

    cd src/control/scripts/ && python generate_solver.py
    
  4. Go broom!