ocra-wbi-plugins
Doxygen documentation for the ocra-wbi-plugins repository
MIQPLinearConstraints Class Reference

#include <MIQPLinearConstraints.h>

Collaboration diagram for MIQPLinearConstraints:
[legend]

List of all members.

Public Member Functions

 MIQPLinearConstraints (std::shared_ptr< StepController > stepController, MIQPParameters &miqpParams)
virtual ~MIQPLinearConstraints ()
void updateRHS (const Eigen::VectorXd &xi_k)
void getConstraintsMatrixA (Eigen::MatrixXd &A)
unsigned int getTotalNumberOfConstraints ()
void getRHS (Eigen::VectorXd &rhs)

Protected Member Functions

void buildShapeAndAdmissibilityInPreviewWindow ()
void buildAShapeAdmiss ()
void buildBShapeAdmiss ()
void buildFcBarShapeAdmiss ()
void setMatrixAcr ()
void setMatrixAcl ()
void buildMatrixQ ()
void buildMatrixT ()
void buildBh ()
void buildAh ()

Private Attributes

std::shared_ptr< ShapeConstraints_shapeCnstr
std::shared_ptr
< AdmissibilityConstraints
_admissibilityCnstr
std::shared_ptr< StepController_stepController
Eigen::MatrixXd _AShapeAdmiss
Eigen::MatrixXd _BShapeAdmiss
Eigen::VectorXd _fcbarShapeAdmiss
Eigen::MatrixXd _A
Eigen::VectorXd _rhs
Eigen::MatrixXd _Acr
Eigen::MatrixXd _Acl
Eigen::MatrixXd _Q
Eigen::MatrixXd _T
Eigen::MatrixXd _Bh
Eigen::MatrixXd _Ah
bool _addShapeCtrs
bool _addAdmissibilityCtrs
bool _addCoPConstraints
bool _addWalkingCtrs
unsigned int _dt
unsigned int _N
unsigned int _nConstraints
std::shared_ptr< BaseOfSupport_baseOfSupport
MIQPParameters _miqpParams

Constructor & Destructor Documentation

MIQPLinearConstraints::MIQPLinearConstraints ( std::shared_ptr< StepController stepController,
MIQPParameters miqpParams 
)
Todo:
Once I add walking constraints this will change to include the rows added by walking constraints
Parameters:
[in]stepControllerPointer to StepController object which is instantiated by the hosting client.
[in]miqpParamsContainer of the MIQP parameters.

Default destructor


Member Function Documentation

void MIQPLinearConstraints::buildAh ( ) [protected]

Builds \(A_h\).

See also:
_Ah
void MIQPLinearConstraints::buildBh ( ) [protected]

Builds \(B_h\) (_Bh) called by the constructor of this class.

See also:
_Bh

Actually builds the vector \(\bar{\mathbf{f}}_c\) referred to in buildShapeAndAdmissibilityInPreviewWindow()

Builds matrix Q (_Q) from the preview model:

\[ \forall j \in \mathbb{N}^*, \xi_{k+j+1|k} = \mathbf{Q} \xi_{k+j|k} + \mathbf{T}\mathcal{X}_{k+j+1|k} \]

See also:
_Q

Builds matrix T (_T) from the preview model:

\[ \forall j \in \mathbb{N}^*, \xi_{k+j+1|k} = \mathbf{Q} \xi_{k+j|k} + \mathbf{T}\mathcal{X}_{k+j+1|k} \]

See also:
_T

Basically builds matrix \(\mathbf{A}\) (_AShapeAdmiss) in the partial expression for the MIQP linear constraints, containing only shape and admissibility constraints, such that:

\[ \mathbf{A} \mathcal{X}_{k,N} \leq \bar{\mathbf{f}}_c - \mathbf{B} \xi_k \]

\[ \begin{array}{cccccc} A_{\text{cr}} Q^0 T & 0 & 0 & 0 & \dots & 0\\ (A_{\text{cl}}Q^0 + A_{\text{cr}}Q^1)T & A_{\text{cr}}Q^0 T & 0 & 0 & \dots & 0 \\ (A_{\text{cl}}Q^1 + A_{\text{cr}}Q^2)T & (A_{\text{cl}}Q^0 + A_{\text{cr}}Q^1)T & A_{\text{cr}} Q^0 T & 0 & \dots & 0 \\ \vdots & \vdots & & & & \vdots \\ (A_{\text{cl}}Q^{N-2} + A_{\text{cr}}Q^{N-1})T & (A_{\text{cl}}Q^{N-3} + A_{\text{cr}}Q^{N-2})T & \dots & \dots & \dots & A_{\text{cr}}Q^0T \\ \end{array} \]

See also:
buildAShapeAdmiss()
Todo:
When walking constraints are added, matrix _A will be a stack of the two
void MIQPLinearConstraints::getConstraintsMatrixA ( Eigen::MatrixXd &  A)

Retrieves the constraints matrix \(\mathbf{A}\). Before passing a matrix to copy _A allocate the space for A by calling getTotalNumberOfConstraints() to know the number of rows, while INPUT_VECTOR_SIZE * SIZE_PREVIEW_WINDOW will be the number of columns.

Parameters:
AReference to matrix where the global constraints matrix _A will be copied.
void MIQPLinearConstraints::getRHS ( Eigen::VectorXd &  rhs)

Returns in rhs the right-hand size of the inequality constraints of the problem.

Parameters:
[out]rhsState-dependent right hand side.
See also:
updateRHS()

Returns the total number of constraints.

Returns:
_nConstraints

Stacks matrices \(C_{i}\) (Ci) from the shape and admissiblity constraints to set variable _Acl

Stacks matrices \(C_{i+1}\) (Cii) from the shape and admissibility constraints to set variable _Acr

void MIQPLinearConstraints::updateRHS ( const Eigen::VectorXd &  xi_k)

Updates the state-dependent RHS of the inequality constraints

Parameters:
[in]xi_kCurrent state.

FIXME: TEMPORARY!! Maybe it's best to have a more generic update method


Member Data Documentation

Eigen::MatrixXd MIQPLinearConstraints::_A [private]
Eigen::MatrixXd MIQPLinearConstraints::_Acl [private]
Eigen::MatrixXd MIQPLinearConstraints::_Acr [private]

Boolean to add admissibility constraints.

Boolean to add CoP constraints within the convex hull defined by the feet location

Boolean too add shape constraints.

Boolean to add walking constraints.

Eigen::MatrixXd MIQPLinearConstraints::_Ah [private]

State matrix \(A_h\) from the CoM jerk integration scheme.

\[ \mathbf{h}_{k+1} = \mathbf{A}_h \mathbf{h}_k + \mathbf{B}_h \mathbf{u}_k \]

It is a constant matrix of size \(6\times6\) equal to:

\[ \mathbf{A_h} = \left[ \begin{array}{ccc} \mathbf{I}_2 & \delta t \mathbf{I}_2 & \frac{\delta t^2}{2} \mathbf{I}_2 \\ 0 & \mathbf{I}_2 & \delta t \mathbf{I}_2 \\ 0 & 0 & \mathbf{I}_2 \end{array} \right] \]

Eigen::MatrixXd MIQPLinearConstraints::_AShapeAdmiss [private]

Base of support object to retrieve the corresponding inequality constraints

Eigen::MatrixXd MIQPLinearConstraints::_Bh [private]

Input matrix \(\mathbf{B}_h\) from the linear state process of the CoMstate \(\hat{\mathbf{h}}\). It is constant of size \(6\times2\) and equal to:

\[ \mathbf{B_h} = \left[ \begin{array}{c} \frac{\delta^3}{6}\mathbf{I}_2 \\ \frac{\delta t^2}{2} \mathbf{I}_2 \\ \delta t \mathbf{I}_2 \end{array} \right] \]

Eigen::MatrixXd MIQPLinearConstraints::_BShapeAdmiss [private]
unsigned int MIQPLinearConstraints::_dt [private]

Period in milliseconds

Eigen::VectorXd MIQPLinearConstraints::_fcbarShapeAdmiss [private]
unsigned int MIQPLinearConstraints::_N [private]

Length of preview window

unsigned int MIQPLinearConstraints::_nConstraints [private]

Total number of constraints

Eigen::MatrixXd MIQPLinearConstraints::_Q [private]

Matrix \(\mathbf{Q}\) from the preview model:

\[ \forall j \in \mathbb{N}^*, \xi_{k+j+1|k} = \mathbf{Q} \xi_{k+j|k} + \mathbf{T}\mathcal{X}_{k+j+1|k} \]

\[ \mathbf{Q} = \left[\begin{array}{cc} \mathbf{0}_{10\times10} & \mathbf{0}_{10\times6}\\ \mathbf{0}_{6\times10} & \mathbf{A_h}_{6\times6} \end{array}\right] \]

Eigen::VectorXd MIQPLinearConstraints::_rhs [private]
Eigen::MatrixXd MIQPLinearConstraints::_T [private]

Matrix \(\mathbf{T}\) from the preview model:

\[ \forall j \in \mathbb{N}^*, \xi_{k+j+1|k} = \mathbf{Q} \xi_{k+j|k} + \mathbf{T}\mathcal{X}_{k+j+1|k} \]

\[ \mathbf{T} = \left[\begin{array}{cc} \mathbf{I}_{10\times10} & \mathbf{0}_{10\times2}\\ \mathbf{0}_{6\times10} & \mathbf{B_h}_{6\times2} \end{array}\right] \]

See also:
_Bh

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines