Home

Awesome

Control Toolbox

GitHub top language GitHub

- Important note (July 2021): this library is currently only scarcely maintained,
- it may take a while until we respond to bugs or feature requests.

This is the Control Toolbox, an efficient C++ library for control, estimation, optimization and motion planning in robotics.

Link to the wiki, quickstart!
Find the detailed documentation here.

Overview

This is the ADRL Control Toolbox ('CT'), an open-source C++ library for efficient modelling, control, estimation, trajectory optimization and model predictive control. The CT is applicable to a broad class of dynamic systems, but features additional modelling tools specially designed for robotics. This page outlines its general concept, its major building blocks and highlights selected application examples.

The library contains several tools to design and evaluate controllers, model dynamical systems and solve optimal control problems. The CT was designed with the following features in mind:

Robot Application Examples

The Control Toolbox has been used for Hardware and Simulation control tasks on flying, walking and ground robots.

<a href="http://www.youtube.com/watch?feature=player_embedded&v=Y7-1CBqs4x4" target="_blank"><img src="http://img.youtube.com/vi/Y7-1CBqs4x4/0.jpg" alt="Control Toolbox example video" width="360" height="270" border="10" /></a> <a href="http://www.youtube.com/watch?feature=player_embedded&v=vuCSKtP67E4" target="_blank"><img src="http://img.youtube.com/vi/vuCSKtP67E4/0.jpg" alt="Control Toolbox example video" width="360" height="270" border="10" /></a>

<a href="http://www.youtube.com/watch?feature=player_embedded&v=rWmw-ERGyz4" target="_blank"><img src="http://img.youtube.com/vi/rWmw-ERGyz4/0.jpg" alt="Control Toolbox example video" width="360" height="270" border="10" /></a> <a href="http://www.youtube.com/watch?feature=player_embedded&v=rVu1L_tPCoM" target="_blank"><img src="http://img.youtube.com/vi/rVu1L_tPCoM/0.jpg" alt="Control Toolbox example video" width="360" height="270" border="10" /></a>

Slightly more complex optimization examples, including gait optimization for a quadruped, are availabe in ct_ros.

What is the CT?

A common tasks for researchers and practitioners in both the control and the robotics communities is to model systems, implement equations of motion and design model-based controllers, estimators, planning algorithms, etc. Sooner or later, one is confronted with questions of efficient implementation, computing derivative information, formulating cost functions and constraints or running controllers in model-predictive control fashion.

The Control Toolbox is specifically designed for these tasks. It is written entirely in C++ and has a strong focus on highly efficient code that can be run online (in the loop) on robots or other actuated hardware. A major contribution of the CT is its implementations of optimal control algorithms, spanning a range from simple LQR reference implementations to constrained model predictive control. The CT supports Automatic Differentiation (Auto-Diff) and allows to generate derivative code for arbitrary scalar and vector-valued functions. We designed the toolbox with usability in mind, allowing users to apply advanced concepts such as nonlinear model predictive control (NMPC) or numerical optimal control easily and with minimal effort. While we provide an interface to a state-of-the art Auto-Diff compatible robot modelling software, all other modules are independent of the a particular modelling framework, allowing the code to be interfaced with existing C/C++ code or libraries.

The CT has been successfully used in a variety of different projects, including a large number of hardware experiments, demonstrations and academic publications. Example hardware applications are online trajectory optimization with collision avoidance \cite giftthaler2017autodiff, trajectory optimization for Quadrupeds \cite neunert:2017:ral and mobile manipulators \cite giftthaler2017efficient as well as NMPC on ground robots \cite neunert2017mpc and UAVs \cite neunert16hexrotor. The project originated from research conducted at the Agile & Dexterous Robotics Lab at ETH Zurich, but is continuously extended to cover more fields of applications and algorithms.

Scope of the CT

Software is one of the key building blocks for robotic systems and there is a great effort in creating software tools and libraries for robotics. However, when it comes to control and especially Numerical Optimal Control, there are not many open source tools available that are both easy to use for fast development as well as efficient enough for online usage. While there exist mature toolboxes for Numerical Optimal Control and Trajectory Optimization, they are highly specialized, standalone tools that due not provide sufficient flexibility for other applications. Here is where the CT steps in. The CT has been designed from ground up to provide the tools needed for fast development and evaluation of control methods while being optimized for efficiency allowing for online operation. While the emphasis lies on control, the tools provided can also be used for simulation, estimation or optimization applications.

In contrast to other robotic software, CT is not a rigid integrated application but can be seen quite literal as a toolbox: It offers a variety of tools which can be used and combined to solve a task at hand. While ease-of-use has been a major criteria during the design and application examples are provided, using CT still requires programming and control knowledge. However, it frees the users from implementing standard methods that require in-depth experience with linear algebra or numerical methods. Furthermore, by using common definitions and types, a seamless integration between different components such as systems, controllers or integrators is provided, enabling fast prototyping.

Design and Implementation

The main focus of CT is efficiency, which is why it is fully implemented in C++. Since CT is designed as a toolbox rather than an integrated application, we tried to provide maximum flexibility to the users. Therefore, it is not tied to a specific middleware such as ROS and dependencies are kept at a minimum. The two essential dependencies for CT are <a href="http://eigen.tuxfamily.org" target="_blank">Eigen</a> and <a href="http://github.com/ethz-asl/kindr" target="_blank">Kindr</a> (which is based on Eigen). This Eigen dependency is intentional since Eigen is a defacto standard for linear algebra in C++, as it provides highly efficient implementations of standard matrix operations as well as more advanced linear algebra methods. Kindr is a header only Kinematics library which builds on top of it and provides data types for different rotation representations such as Quaternions, Euler angles or rotation matrices.

Structure and Modules of the CT

The Control Toolbox consists of three main modules. The Core (ct_core) module, the Optimal Control (ct_optcon) module and the Rigid Body Dynamics (ct_rbd) module. There is a clear hierarchy between the modules. That means, the modules depend on each other in this order, e.g. you can use the core module without the optcon or rbd module.

For testing as well as examples, we also provide the models module (ct_models) which contains various robot models including a quadruped, a robotic arm, a normal quadrotor and a quadrotor with slung load.

The four different main modules are detailed in the following.

ct_core (Core)

ct_optcon (Optimal Control)

ct_rbd (Rigid Body Dynamics)

ct_models

How to get started

To get started with the control toolbox, please build the repository documentation with doxygen and follow the "Getting Started" tutorial.

Support

Acknowledgements

Contributors

Funding

This software has been developed at the <a href="http://www.adrl.ethz.ch" target="_blank">Agile & Dexterous Robotics Lab</a> at <a href="http://www.ethz.ch/en" target="_blank">ETH Zurich</a>, Switzerland between 2014 and 2018. During that time, development has been made possible through financial support from the <a href="http://www.snf.ch/en/" target="_blank">Swiss National Science Foundation (SNF)</a> through a SNF Professorship award to Jonas Buchli and the National Competence Centers in Research (NCCR) <a href="https://www.nccr-robotics.ch/" target="_blank">Robotics</a> and <a href="http://www.dfab.ch/en/" target="_blank">Digital Fabrication</a>.

Licence Information

The Control Toolbox is released under the <a href="https://choosealicense.com/licenses/bsd-2-clause/" target="_blank">BSD-2 clause license</a>. Please see LICENCE.txt and NOTICE.txt

How to cite the CT

@article{adrlCT,
  title={The control toolbox — An open-source C++ library for robotics, optimal and model predictive control},
  author={Markus Giftthaler and Michael Neunert and Markus St{\"a}uble and Jonas Buchli},
  journal={2018 IEEE International Conference on Simulation, Modeling, and Programming for Autonomous Robots (SIMPAR)},
  year={2018},
  pages={123-129}
}

Earlier Versions

Earlier versions up to v2.3 are hosted on bitbucket, they can be found at https://bitbucket.org/adrlab/ct/wiki/Home

Related Publications

This toolbox has been used in, or has helped to realize the following academic publications: