Using RobCoGen

For the impatient

unzip robcogen-0.5.2.zip
cd robcogen-0.5.2/exe/
./robcogen.sh ../sample/fancy/model/fancy.kindsl    # launches the program
# you may now input 1, 4, and 28 to exit
ls -l /tmp/gen/cpp/                                 # check the generated C++

Requirements

RobCoGen is a Java program shipped with the required libraries.

To actually run RobCoGen one needs:

Nowadays, a jre is likely to be already installed in any machine. Maxima is available for a variety of platforms. In Linux distributions such as Ubuntu, both can be installed with the package manager.

So far, RobCoGen has been tested only in Ubuntu Linux, although it should be possible to use it on any platform supported by Java and Maxima.

Execution

RobCoGen is a command line program:

cd exe/
./robcogen.sh <robot description file> [<desired transforms file>]

Arguments:

The folder sample/fancy/model of the RobCoGen distribution contains a sample of both arguments.

When the second argument is provided, the matrices it references will be generated along with the rest of the code. Otherwise, no Jacobians are generated; some coordinate transforms are generated in any case as they are required by the dynamics algorithms.

Frontend

RobCoGen has a simple textual interface, prompting the user for an integer input. Enter a code from the displayed list, to trigger the corresponding generator (the identifier in capital letters is just a short mnemonic name for the code).

The list of available generation targets

Configuration

There are three configuration files alongside the script to launch the program:

(formerly, these files were respectively framework.properties, cpp.properties and log4j.properties)

Default values should work. In the following paragraphs I describe the few options one might want to change. Customize the rest if you know what you are doing. Some documentation is included in the configuration files themselves.

Output paths

See properties generator.outdir... in the main configuration file.

The .base sub-property selects the root folder in the filesystem where to place the generated code.

Since version 0.5.1, the other sub-properties .<lang> are treated as subfolders of the base. Also, setting .robotsubdir to true will result in an additional subfolder named as the robot model; in this case the final path will be in the form <base>/<robot>/<lang>.

Constant folding

Since version 0.5.0.

Property generator.misc.constantfolding in the main configuration file. Defaults to false.

Constant folding means that the robot model constants will appear in the generated code as float literals, possibly multiple times, in different locations. When set to false, symbolic identifiers will be used instead; the details on how these identifiers are associated with the actual value depends on the target language.

Constants in the form of PI expressions (like PI, PI/2.0, etc.) are always folded through. If you do not want this to happen, please use a float literal instead (like 3.14159).

Testing

There are no specific tests for the code generator itself, but there are functions to test the generated code, both C++ and Octave.

The tests themselves are written in Octave, and perform simple numerical comparisons with another, reference implementation of dynamics algorithms.

For more information, please refer to the readme of the repository of the test functions.

The tests are also included in the binary distribution of RobCoGen, in the folder etc/octave-tests.

Starting from version 0.5.1, RobCoGen generates some C++ programs and scripts to help testing the generated C++. See option 26 of the user interface.

Using RobCoGen