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

Builds base of support and corresponding constraints based on the robot's feet location. More...

#include <BaseOfSupport.h>

Collaboration diagram for BaseOfSupport:
[legend]

List of all members.

Public Member Functions

 BaseOfSupport (std::shared_ptr< StepController > stepController, const Eigen::MatrixXd &Q, const Eigen::MatrixXd &T, MIQPParameters miqpParams)
virtual ~BaseOfSupport ()
bool update (const Eigen::VectorXd &xi_k)
void computeBoundingBox (const Eigen::MatrixXd &feetCorners, Eigen::Matrix2d &minMaxBoundingBox)
void getA (Eigen::MatrixXd &A)
void getrhs (Eigen::VectorXd &rhs)

Protected Member Functions

void buildAb ()
void buildb (const Eigen::Matrix2d &minMaxBoundingBox)
void buildCp (double cz, double g)
void buildCi (const Eigen::MatrixXd &Ab, const Eigen::MatrixXd &Cp)
void buildf ()
void buildfbar (const Eigen::VectorXd &f)
void buildB (const Eigen::MatrixXd &Ci, const Eigen::MatrixXd &Q)
void buildA (const Eigen::MatrixXd &Ci, const Eigen::MatrixXd &Q, const Eigen::MatrixXd &T)

Private Attributes

Eigen::MatrixXd _Ab
Eigen::VectorXd _b
Eigen::MatrixXd _Cp
Eigen::MatrixXd _Ci
Eigen::VectorXd _f
Eigen::MatrixXd _A
Eigen::VectorXd _fbar
Eigen::MatrixXd _B
Eigen::VectorXd _rhs
Polygon _poly
Box _bbox
std::shared_ptr< StepController_stepController
Eigen::MatrixXd _Q
Eigen::MatrixXd _T
MIQPParameters _miqpParams

Detailed Description

Builds base of support and corresponding constraints based on the robot's feet location.

Author:
Jorhabib Eljaik ibanezThesis2015
Warning:
Work in progress! This is still a barebone class in the process of being tested.

This class uses the Geometry Boost libraries in order to find the vertices of the bounding box defined by the location of the feet of the robot. Afterwards, it will build the inequality constraints in a preview window of size \(N\) delimiting the area of this polygon where the Center of Pressure is constrained to lie.

The bounding box of the Base of Support as the ones shown in the figure above writes as a set of intequality constraints, where \(\mathbf{p}\) is the horizonal Center of Pressure (CoP).

\[ \left[\begin{array}{cc} -1 & 0\\ 1 & 0\\ 0 & -1\\ 0 & 1 \end{array}\right] \mathbf{p} \leq \left[\begin{array}{c} -x_{\text{min}}\\ x_{\text{max}}\\ -y_{\text{min}}\\ y_{\text{max}} \end{array}\right] \]

or,

\[ \mathbf{A}_b\mathbf{p} \leq \mathbf{b} \]

Which in terms of the system state \(\xi\) writes:

\[ \left[\begin{array}{cc} \mathbf{0}_{10\times10} & \\ & \mathbf{A}_b \mathbf{C}_p \end{array}\right] \mathbf{\xi} \leq \left[\begin{array}{c} \mathbf{0} \\ \mathbf{b} \end{array}\right] \]

or:

\[ \mathbf{C}_i \mathbf{\xi} \leq \mathbf{f}_c \]

Where \(\mathbf{C}_p\) expresses the relationship between CoM and CoP, see buildCp() for more details.

For this type of constraint, in a preview window of size \(N\) we have:

\[ \left[\begin{array}{cccc} \mathbf{C}_i\mathbf{T} & 0 & \cdots & 0 \\ \mathbf{C}_i\mathbf{Q}\mathbf{T} & \mathbf{C}_i\mathbf{T} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{C}_i\mathbf{Q}^{N-1}\mathbf{T} & \mathbf{C}_i\mathbf{Q}^{N-2}\mathbf{T} & \cdots & \mathbf{C}_i\mathbf{T} \end{array}\right] \mathbf{\mathcal{X}}_{N,k} \leq \left[\begin{array}{c} \mathbf{f}_c\\ \mathbf{f}_c\\ \vdots\\ \mathbf{f}_c \end{array}\right] - \left[\begin{array}{c} \mathbf{C}_i\mathbf{Q}\\ \mathbf{C}_i\mathbf{Q}^2\\ \vdots\\ \mathbf{C}_i\mathbf{Q}^N \end{array}\right] \mathbf{\xi}_k \]

or:

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


Constructor & Destructor Documentation

BaseOfSupport::BaseOfSupport ( std::shared_ptr< StepController stepController,
const Eigen::MatrixXd &  Q,
const Eigen::MatrixXd &  T,
MIQPParameters  miqpParams 
)

Constructor.

Parameters:
[in]stepControllerPointer to the stepController object instantiated by `walking-client`
Warning:
Need to make this thread-safe as this class is running in a different thread from `walking-client`'s

Destructor


Member Function Documentation

void BaseOfSupport::buildA ( const Eigen::MatrixXd &  Ci,
const Eigen::MatrixXd &  Q,
const Eigen::MatrixXd &  T 
) [protected]

Builds constraints matrix \(\mathbf{A}\).

Parameters:
[in]CiSee _Ci
[in]QSee _Q
[in]TSee _T
See also:
_A
void BaseOfSupport::buildAb ( ) [protected]

Builds \(\mathbf{A}_b\).

See also:
_Ab
void BaseOfSupport::buildb ( const Eigen::Matrix2d &  minMaxBoundingBox) [protected]

Builds \(\mathbf{b}\).

Parameters:
[in]minMaxBoundingBoxMatrix containing minimum and maximum points of the current bounding box.
See also:
_b
void BaseOfSupport::buildB ( const Eigen::MatrixXd &  Ci,
const Eigen::MatrixXd &  Q 
) [protected]

Builds matrix \(\mathbf{B}\)

Parameters:
[in]CiSee _Ci
[in]QSee _Q
See also:
_B
void BaseOfSupport::buildCi ( const Eigen::MatrixXd &  Ab,
const Eigen::MatrixXd &  Cp 
) [protected]

Builds matrix \(\mathbf{C}_i\)

Parameters:
[in]AbSee _Ab
[in]CpSee _Cp
See also:
_Ci
void BaseOfSupport::buildCp ( double  cz,
double  g 
) [protected]

Builds matrix \(\mathbf{C}_p\).

Parameters:
[in]czConstant CoM height.
[in]gGravity acceleration [m/s^2].
See also:
_Cp.
void BaseOfSupport::buildf ( ) [protected]

Builds vector \(\mathbf{f}\).

See also:
_f
void BaseOfSupport::buildfbar ( const Eigen::VectorXd &  f) [protected]

Builds \(\bar{\mathbf{f}}\).

Parameters:
[in]fResulting \(\bar{\mathbf{f}}\) vector.
See also:
_fbar
void BaseOfSupport::computeBoundingBox ( const Eigen::MatrixXd &  feetCorners,
Eigen::Matrix2d &  minMaxBoundingBox 
)

Computes the bounding box points (minimum and maximum points of the box of the current support configuration) given the corners of the robot's feet in #feetCorners.

Parameters:
[in]feetCornersMatrix of 2D coordinates of the feet corners (or contact points).
[out]minMaxBoundingBoxTwo row-wise points corresponding to the minimum and maximum points and in the resulting bounding box.
See also:
StepController::getContact2DCoordinates()
void BaseOfSupport::getA ( Eigen::MatrixXd &  A)

Getter for the inequality matrix A

Parameters:
[out]Constraintmatrix \(\mathbf{A}\) in preview window.
See also:
_A
void BaseOfSupport::getrhs ( Eigen::VectorXd &  rhs)

Getter for the inequality vector b

Parameters:
[out]rhsRight-hand side vector \(\bar{\mathbf{f}} - \mathbf{B}\xi_k\)
See also:
_rhs, _B, _fbar
bool BaseOfSupport::update ( const Eigen::VectorXd &  xi_k)

To be called at every update cycle of the hosting client.

Parameters:
[in]xi_kCurrent system state.
See also:
_B

Member Data Documentation

Eigen::MatrixXd BaseOfSupport::_A [private]

Matrix \(\mathbf{A}\) in the bounding box constraints for a preview window of size \(N\)

\[ \mathbf{A} = \left[\begin{array}{cccc} \mathbf{C}_i\mathbf{T} & 0 & \cdots & 0 \\ \mathbf{C}_i\mathbf{Q}\mathbf{T} & \mathbf{C}_i\mathbf{T} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{C}_i\mathbf{Q}^{N-1}\mathbf{T} & \mathbf{C}_i\mathbf{Q}^{N-2}\mathbf{T} & \cdots & \mathbf{C}_i\mathbf{T} \end{array}\right] \]

See also:
_Ci, _Q, _T
Eigen::MatrixXd BaseOfSupport::_Ab [private]

Inequality matrix \(\mathbf{A}_b\) expressing the bounding box for the current contact configuration of the robot's feet

\[ \mathbf{A}_b = \left[\begin{array}{cc} -1 & 0\\ 1 & 0\\ 0 & -1\\ 0 & 1 \end{array}\right] \]

Eigen::VectorXd BaseOfSupport::_b [private]

Right-hand-side vector of the inequality expression the interior of the bounding box for the current contact configuration of the robot's feet. For the current bounding box defined by minimum and maximum points \(\mathbf{p}_{\text{min}}\) and \(\mathbf{p}_{\text{max}}\) we get:

\[ \mathbf{b} = \left[ \begin{array}{c} -x_{\text{min}}\\ x_{\text{max}}\\ -y_{\text{min}}\\ y_{\text{max}} \end{array} \right] \]

Eigen::MatrixXd BaseOfSupport::_B [private]

Matrix \(\mathbf{B}\) appearing in the bounding box constraints for a preview window of size \(N\):

\[ \left[\begin{array}{c} \mathbf{C}_i\mathbf{Q}\\ \mathbf{C}_i\mathbf{Q}^2\\ \vdots\\ \mathbf{C}_i\mathbf{Q}^N \end{array}\right] \]

See also:
_Ci, _Q

Polygon object representing the bounding box (envelope) delimiting _poly.

Eigen::MatrixXd BaseOfSupport::_Ci [private]

Matrix \(\mathbf{C}_i\) in the inequality expressing the CoP constraints of the system at the current time instant \(k\) and given by \(\mathbf{C}_i \xi_k \leq \mathbf{f}\). \(\mathbf{C}_i\) is a \(14 \times 16\) matrix, and \(\mathbf{f}_p\) a vector in \(\mathbb{R}^{n_p}\) or:

\[ \left[\begin{array}{cc} \mathbf{0}_{10\times10} & \\ & \mathbf{A}_b \mathbf{C}_p \end{array}\right] \mathbf{\xi} \leq \left[\begin{array}{c} \mathbf{0} \\ \mathbf{b} \end{array}\right] \]

Eigen::MatrixXd BaseOfSupport::_Cp [private]

State matrix \(\mathbf{G}_p\) from the preview horizon of ZMP outputs \(\mathbf{P}\). It is of size \(2N_p \times 6\) and equal to:

\[ \mathbf{G}_p = \left[\begin{array}{c} \mathbf{C}_p\mathbf{A}_h \\ \vdots \\ \mathbf{C}_p\mathbf{A}^{N_p}_h \end{array}\right] \]

Eigen::VectorXd BaseOfSupport::_f [private]

Right-hand side vector \(\mathbf{f}_c\) of the inequalities expressing the bounding box, when the latter is expressed in terms of the sytem state \(\xi_k\) and equal to:

\[ \left[ \begin{array}{c} \mathbf{0}\\ \mathbf{b} \end{array}\right] \]

Eigen::VectorXd BaseOfSupport::_fbar [private]

Vector \(\bar{\mathbf{f}}\) in the bounding box constraints for a preview window of size \(N\)

\[ \bar{\mathbf{f}} = \left[\begin{array}{c} \mathbf{f}_c\\ \mathbf{f}_c\\ \vdots\\ \mathbf{f}_c \end{array}\right] \]

See also:
_f

Copy of the parameters of the MIQP controller which instantiates MIQPLinearConstraints in which the BoundingBox object will be instantiated.

Polygon object holding the current points of contact.

Eigen::MatrixXd BaseOfSupport::_Q [private]

Matrix \(\mathbf{Q}\) in preview state model:

\[ \mathbf{\xi}_{k+1|k} = \mathbf{Q} \xi_{k|k} + \mathbf{T}\mathcal{X}_{k+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] \]

Size: \([16\times16]\)

See also:
MIQPController::_Ah
Eigen::VectorXd BaseOfSupport::_rhs [private]

Right-hand side of the constraints of the bounding box in a preview window of size \(N\) and equal to:

\[ \bar{\mathbf{f}} - \mathbf{B}\xi_k \]

See also:
_fbar, _B
std::shared_ptr<StepController> BaseOfSupport::_stepController [private]

Pointer to the stepController object instantiated by the `walking-client`. Since it contains all the contact tasks, it was easier to interface to it to requests the current contact state of the robot, i.e. contact points locations on the ground.

Warning:
This is not thread safe yet. It might be better to do this in a different way.
Eigen::MatrixXd BaseOfSupport::_T [private]

Matrix \(\mathbf{T}\) in preview state model:

\[ \mathbf{\xi}_{k+1|k} = \mathbf{Q} \xi_{k|k} + \mathbf{T}\mathcal{X}_{k+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] \]

Size: \([16\times12]\)

See also:
MIQPController::_Bh

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