A sparse MPC solver for walking motion generation (old version).
Public Member Functions | Private Member Functions | Private Attributes
qp_as Class Reference

Solve a quadratic program with a specific structure. qp_as = Quadratic Programming / Active Set. More...

#include <qp_as.h>

Inheritance diagram for qp_as:
qp_solver problem_parameters

List of all members.

Public Member Functions

 qp_as (const int N_, const double, const double, const double, const double, const double)
 Constructor: initialization of the constant parameters.
 ~qp_as ()
void set_parameters (const double *, const double *, const double, const double *, const double *, const double *, const double *, const double *)
 Initializes quadratic problem.
int solve ()
 Solve QP problem.

Private Member Functions

void form_iHg (const double *, const double *)
 Forms inv(2*H) * g.
void form_bounds (const double *, const double *)
 Forms the upper and lower bounds.
int check_blocking_bounds ()
 Checks for blocking bounds.
int choose_excl_constr (const double *)
 Selects a constraint for removal from active set.

Private Attributes

chol_solve_as chol
 An instance of chol_solve_as class.
double * iHg
 inv(H) * g
int * W
int * W_sign
int nW
std::vector< boundBounds
 Vector of bounds.

Detailed Description

Solve a quadratic program with a specific structure. qp_as = Quadratic Programming / Active Set.

Definition at line 62 of file qp_as.h.


Constructor & Destructor Documentation

qp_as::qp_as ( const int  N_,
const double  Alpha,
const double  Beta,
const double  Gamma,
const double  regularization,
const double  tol_ 
)

Constructor: initialization of the constant parameters.

Parameters:
[in]N_Number of sampling times in a preview window
[in]AlphaVelocity gain
[in]BetaPosition gain
[in]GammaJerk gain
[in]regularizationregularization
[in]tol_tolerance

Definition at line 50 of file qp_as.cpp.

Destructor

Definition at line 71 of file qp_as.cpp.


Member Function Documentation

int qp_as::check_blocking_bounds ( ) [private]

Checks for blocking bounds.

Returns:
sequential number of constraint to be added, -1 if no constraints.

Definition at line 165 of file qp_as.cpp.

int qp_as::choose_excl_constr ( const double *  lambda) [private]

Selects a constraint for removal from active set.

Parameters:
[in]lambdavector of Lagrange multipliers corresponding to inequality constraints.
Returns:
index of constraint in the active set, -1 if no constraint can be removed.
Attention:
If a constraint for removal is selected, then it is removed from the active set (W) and the number of constraints in active set (nW) is decremented.

Definition at line 226 of file qp_as.cpp.

void qp_as::form_bounds ( const double *  lb,
const double *  ub 
) [private]

Forms the upper and lower bounds.

Parameters:
[in]lbarray of lower bounds for z
[in]ubarray of upper bounds for z

Definition at line 149 of file qp_as.cpp.

void qp_as::form_iHg ( const double *  zref_x,
const double *  zref_y 
) [private]

Forms inv(2*H) * g.

Parameters:
[in]zref_xreference values of z_x
[in]zref_yreference values of z_y

Definition at line 121 of file qp_as.cpp.

void qp_as::set_parameters ( const double *  T_,
const double *  h_,
const double  h_initial_,
const double *  angle,
const double *  zref_x,
const double *  zref_y,
const double *  lb,
const double *  ub 
) [virtual]

Initializes quadratic problem.

Parameters:
[in]T_Sampling time (for the moment it is assumed to be constant) [sec.]
[in]h_Height of the Center of Mass divided by gravity
[in]h_initial_current h
[in]angleRotation angle for each state in the preview window
[in]zref_xreference values of z_x
[in]zref_yreference values of z_y
[in]lbarray of lower bounds for z_x and z_y
[in]ubarray of upper bounds for z_x and z_y

Implements qp_solver.

Definition at line 95 of file qp_as.cpp.

int qp_as::solve ( ) [virtual]

Solve QP problem.

Returns:
number of activated constraints

Implements qp_solver.

Definition at line 261 of file qp_as.cpp.


Member Data Documentation

std::vector<bound> qp_as::Bounds [private]

Vector of bounds.

Definition at line 123 of file qp_as.h.

An instance of chol_solve_as class.

Definition at line 99 of file qp_as.h.

double* qp_as::iHg [private]

inv(H) * g

Definition at line 103 of file qp_as.h.

int qp_as::nW [private]

Number of inequality constraints already included in W. W(nW-1) is the index of the last inequality constraint added to W.

Definition at line 120 of file qp_as.h.

int* qp_as::W [private]

Working set (contains the indexes of only inequality constraints). It is assumed that the only inequality constraints are simple bounds. See also 'Implementing bounds'.

Definition at line 109 of file qp_as.h.

int* qp_as::W_sign [private]

Since we do not distinguish lower/upper bounds of active constraints (<= and => inequlities are treated in the same way), we have to adjust signs of lagrange multipliers before downdate. See also 'Implementing bounds'.

Definition at line 116 of file qp_as.h.


The documentation for this class was generated from the following files: