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:
STSTv4 (from Git!)
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:
Download the latest version and extract it to a directory
<st>Change to the directory
cd <st>
For version 4.3.3 execute
sed "s/1.6/1.8/g" -i build.xml
Compile using
antThis creates a JAR file
<jar>(e.g.ST-4.3.4.jar) in the<st>/distfolder
STSTv4 must be built from the Git version (to support nested JSON arrays):
Clone the source code:
git clone https://github.com/jsnyders/STSTv4.git
Change into the repository:
cd STSTv4Build with
antCopy the launch script template:
cp stst.sh.init stst.sh
Adapt the
STST_HOMEvariable in the launch script(Optional) To use StringTemplate from above adapt the
CPvariable:
sed "s#\$STST_HOME/lib/ST-4.0.8.jar#<st>/dist/<jar>#g" -i stst.sh
Fix the launch script:
sed "s#lib/stst.jar#build/jar/stst.jar#g" -i stst.sh
Make the launch script executable:
chmod +x stst.sh
Generated code
The following dependencies are required to build and execute the generated code:
Build dependencies:
Run-time dependencies:
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 tablesc0b: Keep both robot arms in contact with the tablesc1: Alignment task using an active mobile basesc2: 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