Setup and installation

Preparation

JSON-LD metamodels

After cloning this repository, checkout the metamodels to the folder comp-rob2b/metamodels:

git clone https://github.com/comp-rob2b/metamodels comp-rob2b/metamodels

Code generator

The following dependencies are required for the code generator:

Apply the patches from the misc/patches directory to rdflib.

For convenience, we provide a step-by-step installation guide for the latter two dependencies. Note, that STSTv4 comes with a pre-bundled version of StringTemplate. Hence, the steps for StringTemplate can be considered optional and are only relevant if one plans to use a more recent StringTemplate version.

StringTemplate can either be installed from the pre-compiled version or it can be built from source:

  1. Download the latest version and extract it to a directory <st>

  2. Change to the directory

cd <st>
  1. For version 4.3.3 execute

sed "s/1.6/1.8/g" -i build.xml
  1. Compile using ant

  2. This creates a JAR file <jar> (e.g. ST-4.3.4.jar) in the <st>/dist folder

STSTv4 must be built from the Git version (to support nested JSON arrays):

  1. Clone the source code:

git clone https://github.com/jsnyders/STSTv4.git
  1. Change into the repository: cd STSTv4

  2. Build with ant

  3. Copy the launch script template:

cp stst.sh.init stst.sh
  1. Adapt the STST_HOME variable in the launch script

  2. (Optional) To use StringTemplate from above adapt the CP variable:

sed "s#\$STST_HOME/lib/ST-4.0.8.jar#<st>/dist/<jar>#g" -i stst.sh
  1. Fix the launch script:

sed "s#lib/stst.jar#build/jar/stst.jar#g" -i stst.sh
  1. Make the launch script executable:

chmod +x stst.sh

Generated code

The following dependencies are required to build and execute the generated code:

Make sure that the latter dependencies are accessible to the generated CMake script. That can be achieved via a local or system-wide installation, but also using CMake’s package registry (to avoid the installation). To this end, both projects can be configured with a -DENABLE_PACKAGE_REGISTRY=On option.

Building and execution

There are four make targets to build the different scenarios:

  • sc0a: Keep the robot’s right arm in contact with the table

  • sc0b: Keep both robot arms in contact with the table

  • sc1: Alignment task using an active mobile base

  • sc2: Alignment task using active arms

For instance, to build the latter scenario execute:

make sc2

This target triggers the intermediate code generation, code generation and the final compilation.

Run the code via

cd gen/build
./main

Documentation

The following dependencies are required for building the documentation:

Build the documentation with the following command:

make tutorial-html