Main Paper: Consensus Complementarity Control
Build (Noble)
Build (Jammy)
Coverage
This repository contains the reference implementation of the Consensus Complementarity Control (C3) algorithm. For more in-depth examples, see dairlib.
Officially supported OS: Ubuntu 22.04.
-
Install Bazel or Bazelisk:
You can install Bazelisk (a user-friendly launcher for Bazel) or Bazel directly. Bazelisk is recommended as it automatically manages Bazel versions.To install Bazelisk:
sudo apt-get update sudo apt-get install -y curl sudo curl -L https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -o /usr/local/bin/bazel sudo chmod +x /usr/local/bin/bazel
For more details and to find a specific version, visit the Bazelisk releases page. Choose a version compatible with your system and project requirements.
Or, to install Bazel directly:
Follow the instructions at Bazel's official installation guide. -
Clone C3 (do not
cd
into the directory yet):git clone --filter=blob:none [email protected]:DAIRLab/c3.git
-
Install Drake and its dependencies:
git clone --depth 1 --branch v1.35.0 https://github.com/RobotLocomotion/drake.git sudo drake/setup/ubuntu/install_prereqs.sh
-
Install Gurobi 10.0:
Follow the instructions at Drake's Gurobi setup page to install Gurobi 10.0. -
(Optional) Remove Drake clone:
You may delete the Drake directory after installing dependencies.
-
Change to the C3 directory:
cd c3
-
Build the repository using Bazel:
bazel build ...
-
Run all unit tests:
bazel test ... --test_output=all
-
Run a specific test:
bazel test //systems:systems_test
-
Run coverage:
bazel coverage --combined_report=lcov ... genhtml --branch-coverage --output genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" # Generates the HTML report to be viewed inside the genhtml folder
This repository provides several C++ and Python examples demonstrating how to use the C3 library for different systems and workflows.
-
C++ Examples:
See the C3 Standalone Example, C3 Controller Example, and LCS Factory System Example sections in the examples README for build and run instructions. -
Python Examples:
See the Python Examples section in the examples README for how to build and run the Python scripts using Bazel.
For more information, including how to select different problems, visualize results, and understand the system architectures, refer to the examples/README.md
file.
c3/
├── bindings/ # Python bindings and tests
├── core/ # Core algorithm implementation
├── examples/ # Example applications and simulations
├── systems/ # Drake systems and tests
├── multibody/ # algorithms for computation in multibody environments
├── third_party/ # External dependencies
└── MODULE.bazel # Bazel module file
For a detailed explanation of the C3 algorithm, please refer to the main paper. Additional resources and in-depth examples can be found in the dairlib repository.
If you use C3 in your research, please cite:
@article{Aydinoglu2024,
title = {Consensus Complementarity Control for Multi-Contact MPC},
author = {Aydinoglu, Alp and Wei, Adam and Huang, Wei-Cheng and Posa, Michael},
year = {2024},
month = jul,
journal = {IEEE Transactions on Robotics (TRO)},
youtube = {L57Jz3dPwO8},
arxiv = {2304.11259},
doi = {10.1109/TRO.2024.3435423},
url = {https://ieeexplore.ieee.org/document/10614849}
}