ctrl_toolbox is a C++17 library collecting reusable control-oriented building blocks under the ctb namespace.
ctb::DigitalPID1-D digital PID controller with anti-windup and configurable error function.ctb::VirtualFrameVirtual-frame based smoothing for Cartesian pose/velocity references.ctb::ExtendedKalmanFilterEKF framework with pluggable model and measurement components.- Utility helpers
Angle wrapping, geodesy conversions (
LatLong/local frames), and configuration helpers.
- CMake >= 3.2
- C++17 compiler
GeographicLiblibconfig++rml(Robotic Mathematical Library): https://github.com/GRAAL-Lab/rml.git
On Debian/Ubuntu, install system dependencies with:
sudo apt-get update
sudo apt-get install -y cmake g++ libgeographiclib-dev libconfig++-devrml must be installed separately and discoverable by your compiler/linker.
From the project root:
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build -jTo also compile the test executable:
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=ON
cmake --build build -jcmake --install buildThe project exports a CMake package configuration (ctrl_toolboxConfig.cmake) under:
share/ctrl_toolbox/cmake
find_package(ctrl_toolbox REQUIRED)
add_executable(my_controller main.cpp)
target_link_libraries(my_controller PRIVATE ctrl_toolbox)Use the umbrella include:
#include <ctrl_toolbox/ctrl_toolbox.hpp>or include individual modules, for example:
<ctrl_toolbox/pid/DigitalPID.h><ctrl_toolbox/virtual_frame/VirtualFrame.h><ctrl_toolbox/kalman_filter/ExtendedKalmanFilter.h><ctrl_toolbox/HelperFunctions.h>
#include <ctrl_toolbox/pid/DigitalPID.h>
int main()
{
ctb::PIDGains gains;
gains.Kp = 2.0;
gains.Ki = 0.4;
gains.Kd = 0.05;
gains.Kff = 0.0;
gains.N = 10.0;
gains.Tr = 0.2;
ctb::DigitalPID pid(gains, 0.01, 5.0);
const double reference = 1.0;
const double feedback = 0.8;
const double command = pid.Compute(reference, feedback);
(void)command;
return 0;
}- The library target is currently built as a shared library.
- Most APIs are defined in namespace
ctb. - The current repository includes a sample test executable in
test/ctrl_toolbox_test.cc.
This project is released under the MIT License. See LICENSE.md.
Maintained by GRAAL Laboratory, University of Genoa (Italy).