Skip to content

agimus-project/colmpc

Repository files navigation

COLMPC: Collision Avoidance for MPC

This repo is mainly an addon residual for Crocoddyl for collision avoidance for trajectory optimisation and model predictive control (MPC).

Here's a video of the addon residual in a real time torque controlled 7-DoF manipulator robot:

Dependencies

For OCP & MPC scripts:

  • HPPFCL (commit: 65fb435b44a1bbd5059347d7a311cc7c7aa1349e) for collision computations.
  • Pinocchio (v2.7.0) fast rigid body dynamics.
  • Crocoddyl (commit: 5b415a16138d)framework for the solver.

For visualization:

For the examples:

Installation

HPP-FCL & Pinocchio must be built from sources. Build pinocchio with the flag : WITH_COLLISION_SUPPORT=ON.

Note

Don't forget to switch to the right commits!

Usage

Before trying the examples, test your hppfcl installation. To do this and make sure the hppfcl librairy works well on your computer, run in the test folder : python -m unittest.

Possible issue

If you have a problem with FakeCollisionGeometry, it is likely that the linking of Pinocchio with HPPFCL wasn't done properly. Verify that you have the right commits & the right compilation flags.

For the MPC part:

Create a meshcat-server by writting in a terminal meshcat-server. Then, to see the example with hard constraints simply run in the main directory python examples/mpc_panda_reaching.py. To compare it with the standard MPC without hard constraint but collision avoidance written as soft constraint, run python examples/mpc_panda_reaching_soft_constraint.py.

As the code is still in developpement, the code is constantly moving and sometimes, examples do not work. Hence, do not hesitate to contact me at ahaffemaye@laas.fr.

Citation

To cite COLMPC in your academic research, please use the following bibtex entry:

@inproceedings{haffemayer_model_2024,
	title = {Model predictive control under hard collision avoidance constraints for a robotic arm},
	author = {Haffemayer, Arthur and Jordana, Armand and Fourmy, Médéric and Wojciechowski, Krzysztof and Saurel, Guilhem and Petrík, Vladimír and Lamiraux, Florent and Mansard, Nicolas},
    booktitle={Ubiquitous Robots (UR)}
	year = {2024},
}

Credits

The examples are based on the examples of Sebastien Kleff.