wb-toolbox icon indicating copy to clipboard operation
wb-toolbox copied to clipboard

Expose adaptive_rho option in OSQP block

Open traversaro opened this issue 3 years ago • 4 comments

Summary

We would like to expose the adaptive_rho option (and eventually other options in the OSQP block.

Motivation

By default, OSQP is not deterministic, but if you set adaptive_rho to false, you get a deterministic solver.

Additional context

This emerged in https://github.com/ami-iit/matlab-whole-body-simulator/pull/81#issuecomment-1274395409 .

traversaro avatar Oct 14 '22 14:10 traversaro

See https://github.com/robotology/wb-toolbox/issues/202 for a similar issue.

traversaro avatar Oct 14 '22 14:10 traversaro

See https://github.com/robotology/wb-toolbox/blob/master/toolbox/library/src/OSQP.cpp .

traversaro avatar Oct 14 '22 14:10 traversaro

Reading the list of settings for OSQP and their role in the OSQP, I think 3 variables are worth having in the OSQP block:

  • adaptive_rho: this is a flag to enable/disable the adaptive procedure for rho. The use of the adaptation algorithm increases the complexity and processing time for each time step, though it reduces the total processing time for complex problems. As a trade-off, OSQP uses the adaptation algorithm only when it is required. The realization of the problem's complexity depends on the processing time that depends don't the machine/computer specifications. So, enabling this parameter could make OSQP indeterministic.
  • polish: this is a flag to enable/disable the final polishing algorithm for increasing the solution accuracy. This feature is disabled by default.
  • max_iter: this is a number defining the maximum allowable iteration for OSQP.

VenusPasandi avatar Oct 17 '22 10:10 VenusPasandi

I would mention here that currently, OSQP block is deterministic because, we disabled adaptive rho option (see https://github.com/robotology/wb-toolbox/blob/master/toolbox/library/src/OSQP.cpp#L323)

VenusPasandi avatar Oct 18 '22 08:10 VenusPasandi