Skip to content

Quickstart

Markus Giftthaler edited this page Dec 28, 2019 · 4 revisions

Quick-start - Installation and running an example

System requirements

  • Ubuntu 16.04 or 18.04
  • a compiler with C++14 support, e.g. gcc or clang

Installing dependencies

  • install Eigen 3 via
    sudo apt-get update
    sudo apt-get install libeigen3-dev

  • install boost
    sudo apt-get install libboost-all-dev

  • clone the kindr library into your workspace
    cd ~/your_workspace/src
    git clone https://github.com/ANYbotics/kindr.git

  • finally, clone the control toolbox into your workspace
    cd ~/your_workspace/src
    git clone https://github.com/ethz-adrl/control-toolbox.git

Building the library

For ROS or catkin users

Compiling the Library

It is assumed that you have a valid catkin-workspace set up, e.g. using catkin tools. Then, execute the following steps.

cd ~/your_workspace
catkin build -DCMAKE_BUILD_TYPE=Release

Building and running examples

To build an run the examples, e.g. the optimal control and optimal filtering examples:
cd ~/your_workspace
catkin build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true
source devel/setup.bash
rosrun ct_optcon ex_NLOC
rosrun ct_optcon ex_KalmanFiltering

Using plain cmake

Compiling the Library

First, make sure you build and install the kindr-library, see here.
Then go to your local clone of the control toolbox and run the build script:
cd your_workspace/control-toolbox/ct
chmod 775 build_ct.sh
./build_ct.sh -DCMAKE_BUILD_TYPE=Release

Building and running examples

Then go to your local clone of the control toolbox and run the build script with the following flags.
cd your_workspace/control-toolbox/ct
./build_ct.sh -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true

This creates a /build subdirectory in every single CT-project, where the examples will be located. For running the nonlinear optimal control or filtering examples, for instance, go to your workspace an run
./src/control-toolbox/ct_optcon/build/examples/ex_NLOC
./src/control-toolbox/ct_optcon/build/examples/ex_KalmanFiltering

Example output

Try to run the examples, e.g. the optimal control and optimal filtering examples:
cd ~/catkin_ws
source devel/setup.bash
rosrun ct_optcon ex_NLOC
which will print some iteration output and finally display the following

These are trajectories for driving a simple mass-spring-damper system to a goal config, optimized using the iLQR algorithm.

If you are intersted in state estimation, run rosrun ct_optcon ex_KalmanFiltering As a result, you should see this:

The plot shows state estimates for a simple mass-spring damper system, where given trajectories are disturbed with white noise.

For more detailed examples, visit the getting started section of the documentation.