Skip to content

DAIRLab/c3

Repository files navigation

C3: Consensus Complementarity Control

Main Paper: Consensus Complementarity Control

Build (Noble) Noble Test Report    Build (Jammy) Jammy Test    Coverage C3 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.


Table of Contents


Setup

  1. 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.

  2. Clone C3 (do not cd into the directory yet):

    git clone --filter=blob:none [email protected]:DAIRLab/c3.git
  3. 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
  4. Install Gurobi 10.0:
    Follow the instructions at Drake's Gurobi setup page to install Gurobi 10.0.

  5. (Optional) Remove Drake clone:
    You may delete the Drake directory after installing dependencies.


Build Instructions

  1. Change to the C3 directory:

    cd c3
  2. Build the repository using Bazel:

    bazel build ...

Testing and Coverage

  • 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

Running Examples

This repository provides several C++ and Python examples demonstrating how to use the C3 library for different systems and workflows.


Quick Start


For more information, including how to select different problems, visualize results, and understand the system architectures, refer to the examples/README.md file.


Directory Structure

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

Reference

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.

Citation

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}
}

About

Consensus Complementarity Control

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5