RobCoGen is a command line program. After installation type

rcg --help

to see the available options.

One mandatory argument is the path of the robot model description file, which can either be a URDF or a KinDSL file

Examples

Generate Octave code for the sample robot "Fancy", which is included in the source archive:

rcg --octave --output rcgen/octave sample/fancy/fancy.kindsl

Generate C++ code for iit's HyQ robot; note that the floating base case must be explicitly mentioned:

rcg --floating --cpp --output rcgen/cpp sample/hyq/hyq.kindsl

Testing

Please see here for an introduction.

The following examples also refer to the sample robot model Fancy, and use arbitrary paths. Please adapt them according to your needs.

Octave code only

rcg --octave --output /tmp/rcgen/octave sample/fancy/fancy.kindsl
cd /tmp/rcgen/octave
octave runtests.m <spatial_v2 root> <robcogen root>/testing/src

Octave and C++

Generate all the code and the helper scripts:

rcg --octave --output /tmp/rcgen/octave sample/fancy/fancy.kindsl
rcg --cpp    --output /tmp/rcgen/cpp    sample/fancy/fancy.kindsl
rcg --tests  --output /tmp/rcgen/       sample/fancy/fancy.kindsl

Then run the master script that was created (testall.sh) with bash:

bash /tmp/rcgen/testall.sh <robcogen root> <spatial_v2 root> /tmp/rcgen/cpp /tmp/rcgen/octave
More details testall.sh will attempt to
  1. build the generated C++, which includes some binaries that conform to testing requirements
  2. execute the stand-alone consistency test for C++
  3. invoke in turn the testall.m Octave script, which attempts to execute
    • all the comparison test functions for the generated Octave code
    • all the comparison test functions for the generated C++ code