Expand description
Introduction
Optima is an easy to set up and easy to use robotics toolbox. Its primary usecase is robot motion generation (e.g., trajectory optimization, motion planning, optimizationbased inverse kinematics, etc), though its underlying structures are general and can apply to many planning and optimization problem domains. The core library is written in Rust, though high quality support for other targets such as Python and Webassembly are afforded via Rust’s flexible compiler.
Optima features an extensive suite of efficient and flexible robotics subroutines, including forward kinematics, jacobian computations, etc. Optima also features implementations of stateoftheart robotics algorithms related to planning, optimization, and proximity computations, such as RelaxedIK, CollisionIK, and Proxima (with more algorithms on the way). These robotics features are designed to be easy to set up and access. Models of many popular robots such as UR5, Franka Emika Panda, Kinova Gen3, etc., are included outofthebox and can be instantiated with a single line of code. If your robot model is not included in our provided assets, a robot can be added to the library in just minutes.
Highlevel Features

The underlying nonlinear optimization engine has several backend options, such as the Open Engine and NLopt. All algorithms support a nonlinear objective function, nonlinear equality constraints, and nonlinear inequality constraints. Most provided algorithms are local solvers, though several global optimization algorithms are provided via NLopt as well. These optimization algorithm options can be swapped in and out by changing a single parameter, making testing and benchmarking over optimization algorithms easy to conduct.

The library presents a powerful Rust trait called
OptimaTensorFunction
; any function that implements this trait can automatically compute derivatives (up to the fourth derivative) using a derivative composition graph that automatically selects either analytical derivatives, when provided, or finitedifference approximate derivatives, by default, through its traversal. Thus, instead of depending on lowlevel automatic differentiation libraries that often fail on important subroutines, this approach provides a highly efficient and flexible way to perform derivatives for any implemented function. High order derivatives are even computable on multidimensional functions as the library supports tensors of any arbitrary dimension. For instance, a function \( \mathit{f}: \mathbb{R}^{3 \times 5} \rightarrow {R}^{4 \times 4} \) implemented as anOptimaTensorFunction
can automatically provide derivatives \( \frac{\partial f}{\partial \mathbf{X}} \in {R}^{4 \times 4 \times 3 \times 5} \), \( \frac{\partial^2 f}{\partial \mathbf{X}^2} \in {R}^{4 \times 4 \times 3 \times 5 \times 3 \times 5} \), etc. 
Optima uses flexible transform and rotation implementations that make SE(3) computations a breeze. For instance, any computations over transforms can use homogeneous matrices, implicit dual quaternions, a rotation matrix + vector, unit quaternion + vector, euler angles + vector, etc. No matter what SE(3) representation is chosen, the library will automatically ensure that all conversions and computations are handled correctly under the hood.

In just a few lines of code, individual robot models can be combined to form a “robot set”, allowing for easy planning and optimization over several robots all at once. For instance, a UR5 (6DOF) can be easily combined with two Rethink Sawyer (7DOF) robots to form a robot set with 20 total DOF. In addition, any robot in the library (including those in a robot set) can be easily supplemented with a mobile base of numerous types (e.g., floating base, planar base, etc.). The extra degrees of freedom accompanying these mobile base options are automatically added to the robot (or robot set) model.
Documentation
Further documentation including setup instructions, tutorials, etc. for Optima can be found at https://djrakita.github.io/optima_toolbox/.