Class nHQP

Nested Relationships

Inheritance Relationships

Base Type

Class Documentation

class nHQP : public OpenSoT::Solver<Eigen::MatrixXd, Eigen::VectorXd>

Hierarchical QP solver based on nullspace basis optimization.

Layer #0: min |A0*x-b0| -> let N0 = Null(A0) be a basis of the nullspace of A0, and x0_opt = sol0 the solution

Layer #1: min |A1*x-b1|. Optimize on the nullspace coordinates (x1) by setting: x = sol0 + N0*x1. This results in A1 -> A1*N0, b1 -> b1 - A1*sol0. Then, let N1 be N0*Null(A1*N0), sol1 = sol0 + N0*x1_opt

Layer #K: min |AK*x-bK| -> x = solK-1 + NK-1*xK AK -> AK*NK-1, bK -> bK - AK*solK-1 solK = solK-1 + NK-1*xK_opt NK = NK-1 * Null(AK*NK-1)

Notice how each layer optimizes only over the remaining dofs after higher priority tasks have been optimized. Hence, the size of QP probles decreases along the hierarchy.

Limitations:

  • no support for equality constraints

  • no support for local constraints

  • [!!!] ranks of tasks should not change during runtime (e.g. disabling a task)

Todo:

: implement equality constraints by considering the nullspace Neq = Null(Aeq). All optimizations will then take place in the null space of equality constraints.

: add reference

Public Types

typedef std::shared_ptr<nHQP> Ptr

Public Functions

nHQP(Stack &stack_of_tasks, ConstraintPtr bounds, const double eps_regularisation, const solver_back_ends be_solver = solver_back_ends::qpOASES)

nHQP constructor

Parameters
  • stack_of_tasks – vector of tasks

  • bounds – and constraints of the problem

  • eps_regularisation – resularization for the back-end

  • be_solver – to solve the QP

virtual ~nHQP() override

~nHQP destructor

virtual bool solve(Eigen::VectorXd &solution) override

solve implementation

Parameters

solution

Returns

false if something went wrong

void setMinSingularValueRatio(double sv_min)

setMinSingularValueRatio for the A and b regularization for all priority levels

Parameters

sv_min – between 0. and 1.

void setMinSingularValueRatio(std::vector<double> sv_min)

setMinSingularValueRatio for the A and b regularization for a single priority levels

Parameters

sv_min – between 0. and 1.

void setPerformAbRegularization(int hierarchy_level, bool perform_A_b_regularization)

setPerformAbRegularization at a certain hierarchy level

Note

throw if asked hierarchy that does not exists

Parameters
  • hierarchy_level

  • perform_A_b_regularization – true or false (default is true for all levels)

void setPerformAbRegularization(bool perform_A_b_regularization)

setPerformAbRegularization to all leveles

Parameters

perform_A_b_regularization – true or false (default is true for all levels)

void setPerformSelectiveNullSpaceRegularization(int hierarchy_level, bool perform_selective_null_space_regularization)

setPerformSelectiveNullSpaceRegularization at a certain hierarchy level

Note

throw if asked hierarchy that does not exists

Parameters
  • hierarchy_level

  • perform_selective_null_space_regularization – true or false (default is true for all levels)

void setPerformSelectiveNullSpaceRegularization(bool perform_selective_null_space_regularization)

setPerformSelectiveNullSpaceRegularization to all leveles

Parameters

perform_selective_null_space_regularization – true or false (default is true for all levels)

Public Static Attributes

static constexpr double DEFAULT_MIN_SV_RATIO = 0.05