Skip to content

v2.0.0

Compare
Choose a tag to compare
@stephane-caron stephane-caron released this 28 Jul 09:48
· 43 commits to main since this release
af874f5

This release makes a major API update to switch from cold-start to hot-start when solving of MPC QP problems. It meanwhile adds two examples (with live plots) taken from real-robot use cases:

  • The open-loop MPC part of the LIPM walking controller: python examples/lipm_walking_controller.py
  • A closed-loop MPC balancer for Upkie, which also runs on the real robots: python examples/cart_pole.py

The problem class, now called MPCProblem, allows for initial/goal state and target trajectory updates. A new MPCQP class is introduced for QP vector updates (cost vectors depend on the initial state and targets, while on LTI problems QP matrices don't depend on these changing quantities, a source of optimization for faster solve times).

The new API also introduces two new submodules:

  • Live plots: a debugging tool for plotting MPC trajectories while running (uses the TkAgg matplotlib backend)
  • Systems: we start gathering common systems that can be re-used outside of examples. For instance, CartPole shipped with this release is used in a closed-loop MPC balancer on Upkie.

Added

  • Base class for exceptions raised by this library
  • Documentation checks using ruff
  • Exception: ProblemDefinitionError
  • MPCProblem: setter for the initial state
  • MPCProblem: target state trajectory for stage state cost
  • MPCQP class to update cost vectors during execution
  • Plan: first_input getter
  • Plan: is_empty property
  • Started ltv_mpc.live_plots submodule
  • Started ltv_mpc.systems submodule

Changed

  • Always add state-input inequalities (even when unfeasible)
  • Don't assume a Problem is fully defined in constructor
  • Initial and goal states are now keyword arguments of MPCProblem
  • Refactorbuild_qp into a new MPCQP class
  • Rename Problem to MPCProblem
  • Rename Solution to Plan
  • Rename stacked_inputs to just inputs in plans
  • Rename stacked_states to just states in plans
  • Solver keyword argument to solve_mpc is now mandatory
  • Use problem class from qpsolvers internally
  • Warn rather than raise an exception when initial state is unfeasible