TR2024-087

PYROBOCOP: Python-based Robotic Control & Optimization Package for Manipulation and Collision Avoidance


Abstract:

Contacts are central to most manipulation tasks as they provide additional dexterity to robots to perform challenging tasks. However, frictional contacts leads to complex complementarity constraints. Planning in the presence of contacts requires robust handling of these constraints to find feasible solutions. This paper presents PYROBOCOP which is a lightweight Python-based package for control and optimization of robotic systems described by nonlinear Differential Algebraic Equations (DAEs). In particular, the proposed optimization package can handle systems with contacts that are described by complementarity constraints. We also present a general framework for specifying obstacle avoidance constraints using complementarity constraints. The package performs direct transcription of the DAEs into a set of nonlinear equations by performing orthogonal collocation on finite elements. The resulting optimization problem belongs to the class of Mathematical Programs with Complementarity Constraints (MPCCs). MPCCs fail to satisfy commonly assumed constraint qualifications and require special handling of the complementarity constraints in order for NonLinear Program (NLP) solvers to solve them effectively. PYROBOCOP provides automatic reformulation of the complementarity constraints that enables NLP solvers to perform optimization of robotic systems. The package is interfaced with ADOL-C [1] for obtaining sparse derivatives by automatic differentiation and IPOPT [2] for performing optimization. We provide extensive numerical examples for various different robotic systems with collision avoidance as well as contact constraints represented using complementarity constraints. We provide comparisons with other open source optimization packages like CasADi and Pyomo. The code is open sourced and available at https://github.com/merlresearch/PyRoboCOP.