Skip to content

ROS integration for whole-body MPC

Wilson Jallet requested to merge wjallet/ros-integration into wjallet/devel

This PR adds ROS support for the whole-body MPC (my branch wjallet/devel). It eliminates a lot of dead code and makes necessary changes to some of the code architecture.


  • simplify code which creates Crocoddyl OCP (
    • use numpy masks where applicable
    • rename ambiguous "task" variable
    • do not use np.insert or np.append
  • simplify the C++ Params class by:
    • removing a lot unused parameters (for centroidal MPC)
    • direct parsing of Yaml arrays to C++ Eigen vectors or matrices
    • remove or change type data members defined as std::vector only to be converted in Python to numpy
    • default constructor default-initializes all data members, does nothing else
    • static factory function create_from_file(filename=default_filename) replaces older ctor
    • add static factory create_from_str() which allows parsing from a std::string
  • enable pickling for the Params class (relevant for multiprocessing on macOS apparently)
  • fix the CMake config for macOS
  • fix package.xml
  • add CMake listfile formatting and linting
  • enable conversion from C++ YAML::Node to Python dicts (for Python-only params)
  • add utils for converting between ROS multiarrays and NumPy arrays
  • change the TaskSpec class:
    • some parameters are loaded from the Yaml config file
    • renames file to
  • rename CrocOCP to AlgtrOCP
    • separates AlgtrOCP into a subclass for instantiating ProxDDP, and one for proxddp.SolverFDDP
  • update the README
  • do not pass around the TaskSpec object
  • python: remove qrw.Utils.init_robot() because it modified the Params object without telling the user
    • replace by more explicit and self-contained make_footstep()
    • no attributes added to Params object (params.T is replaced by params.N_gait in C++ and initialized there)

We have tested building with Linux, macOS, and macOS with Catkin from robostack.

Thanks to the work of Etienne Arlaud @Inria Paris.

Resolves #3

Edited by Wilson Jallet

Merge request reports