alphaville / optimization-engine

Nonconvex embedded optimization: code generation for fast real-time optimization + ROS support
https://alphaville.github.io/optimization-engine/
Other
512 stars 53 forks source link

Preconditioning in auto-generated solver #293

Closed alphaville closed 2 years ago

alphaville commented 2 years ago

Main Changes

Essentially, this PR finalises most of the tasks involved in #292.

In optimizer.rs:

In optimizer_builder.py:

In interface.c:

In alm_optimizer_status.rs

Other

Associated Issues

TODOs

alphaville commented 2 years ago

@Arun-R-M

A test case can be added that solves a known problem and calls the solver with initial_guess and p values and check against a hardcoded set of correct solution (possibly obtained from a previous version of opengen).

Good point, but we check whether the optimality conditions are satisfied and whether the solutions are feasible. I'll strengthen the unit test a little more.

alphaville commented 2 years ago

@Arun-R-M further testing revealed a bug: preconditioning scales the cost function, but then when we return the optimal cost to the user we need to scale it back (to undo the scaling). I'm pushing a change now that will make a test fail, but I'll fix it.