OpTaS: An Optimization-based Task Specification Library for Trajectory Optimization and Model Predictive Control

Christopher E. Mower, João Moura, Nazanin Zamani Behabadi, Sethu Vijayakumar, Tom Vercauteren, Christos Bergeles

TL;DR

OpTaS is a new Python library that simplifies the development of Trajectory Optimization (TO) and Model Predictive Control (MPC) for complex robotic systems. By combining a user-friendly scripting interface with the power of symbolic mathematics and automatic differentiation, it allows researchers to quickly prototype multi-robot tasks that are both highly constrained and computationally efficient.

What Problem Does This Paper Address?

In modern robotics, tasks like surgery or collaborative assembly require robots to navigate "unstructured" environments. To do this, planners must balance multiple competing objectives: avoiding obstacles, maintaining joint limits, and coordinating multiple arms—all while following a smooth path.

Existing software tools generally fall into two camps:

  1. Specialized Solvers: Tools like TracIK are extremely fast but only solve specific problems (like Inverse Kinematics). They lack the flexibility to handle custom nonlinear constraints.
  2. Heavyweight Frameworks: Libraries like EXOTica or eTaSL are powerful but often rely on static configuration files (XML/YAML) or require users to manually provide complex analytical gradients (the math describing how constraints change). This makes rapid prototyping difficult and slows down execution when the environment changes dynamically.

OpTaS bridges this gap by providing a "middle ground" that is scriptable, flexible, and mathematically "smart" enough to handle the heavy lifting of optimization automatically.

Methods

The core of OpTaS is built on three main pillars:

  • CasADi Integration: It leverages CasADi, a symbolic framework that provides Automatic Differentiation (AD). This means the user only needs to define the task (e.g., "don't hit this sphere"), and OpTaS automatically generates the exact Jacobians and Hessians that solvers need to find a solution. This is much faster and more accurate than the "finite difference" approximations used by older libraries.
  • Optimization Builder: A high-level Python API allows users to define decision variables, parameters, and costs in a single script. Crucially, it supports parameterization, allowing users to update things like obstacle positions or goal targets during execution—a requirement for real-time MPC.
  • Robot Modeling: OpTaS can ingest standard URDF files to automatically generate kinematic models (Forward Kinematics, Jacobians, etc.) to any derivative order. It natively supports multi-robot setups within a single optimization problem.

The library acts as a "wrapper" that interfaces with industry-standard solvers like IPOPT, SNOPT, and OSQP, automatically identifying which solver is best suited for the user's specific problem formulation.

Datasets

As a software library paper, the authors do not use a traditional machine learning dataset. Instead, they evaluate OpTaS using:

  • Simulated Kuka LWR Robot: Used for benchmarking task-space trajectories and figure-eight tracking.
  • Comparative Benchmarks: Performance was measured against TracIK (a specialized IK solver) and EXOTica (a general-purpose planning framework).

Key Insights and Ideas

  • Dimensionality Flexibility: Most solvers force users to define a full 6D pose (position and orientation) for a task. OpTaS allows users to optimize only the dimensions that matter (e.g., 2D pushing). The authors show that by "neglecting" unnecessary dimensions, the robot can actually achieve a larger effective workspace.
  • The AD Advantage: The biggest "aha moment" comes from the comparison with EXOTica. When adding a complex "manipulability" cost, OpTaS significantly outperformed EXOTica. This is because EXOTica lacks built-in gradients for that specific task and falls back to slow numerical estimation, while OpTaS uses automatic differentiation to maintain high speed.
  • MPC-Ready: Because the library allows for "warm-starting" (using the previous solution as a starting point for the next) and dynamic parameter updates, it is uniquely suited for feedback control loops where the robot must react to a changing world.

Key Results

  • Computational Efficiency: In a figure-eight tracking experiment, OpTaS achieved a solver duration of 2.608 ± 0.239ms, outperforming EXOTica’s 3.694 ± 0.300ms.
  • Complex Cost Handling: When maximizing robot manipulability, OpTaS was nearly 3x faster than EXOTica (2.65ms vs 7.64ms) due to its superior gradient handling.
  • Specialization vs. Generality: While TracIK was faster (0.049ms), the authors note this is expected as TracIK is a "hard-coded" solver for a single task, whereas OpTaS is a general-purpose library that can solve almost any constrained nonlinear problem.

Limitations and Future Work

  • Local Optima: Like all gradient-based optimization tools, OpTaS finds local solutions. If a problem is highly non-convex (like a complex maze), it may get stuck unless given a good initial guess.
  • Solver Dependency: While OpTaS simplifies the interface, the ultimate speed is still limited by the underlying third-party solvers (IPOPT, SNOPT, etc.).
  • Future Directions: The authors have open-sourced the code on GitHub and intend for it to be a community-driven project, potentially adding more built-in constraints and tighter integration with other robotics middleware beyond ROS and PyBullet.

Summary updated

Abstract

This paper presents OpTaS, a task specification Python library for Trajectory Optimization (TO) and Model Predictive Control (MPC) in robotics. Both TO and MPC are increasingly receiving interest in optimal control and in particular handling dynamic environments. While a flurry of software libraries exists to handle such problems, they either provide interfaces that are limited to a specific problem formulation (e.g. TracIK, CHOMP), or are large and statically specify the problem in configuration files (e.g. EXOTica, eTaSL). OpTaS, on the other hand, allows a user to specify custom nonlinear constrained problem formulations in a single Python script allowing the controller parameters to be modified during execution. The library provides interface to several open source and commercial solvers (e.g. IPOPT, SNOPT, KNITRO, SciPy) to facilitate integration with established workflows in robotics. Further benefits of OpTaS are highlighted through a thorough comparison with common libraries. An additional key advantage of OpTaS is the ability to define optimal control tasks in the joint-space, task-space, or indeed simultaneously. The code for OpTaS is easily installed via pip, and the source code with examples can be found at github.com/cmower/optas.
BibTeX
@inproceedings{mower2023optas,
  author = {Christopher E. Mower and João Moura and Nazanin Zamani Behabadi and Sethu Vijayakumar and Tom Vercauteren and Christos Bergeles},
  title = {{OpTaS: An Optimization-based Task Specification Library for Trajectory Optimization and Model Predictive Control}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2023},
  url = {https://openreview.net/forum?id=nJg0zixReJ},
}

Loading related content...

Figure