A sparse MPC solver for walking motion generation.
Public Member Functions | Public Attributes | List of all members

Defines rectangular constraints (of the form D*z <= d) for the ZMP. More...

#include <rect_constraint.h>

Inheritance diagram for RectangularConstraint_ZMP:
footstep

Public Member Functions

 RectangularConstraint_ZMP (const double *)
 A constructor. More...
 
void rotate_translate (const double, const double, const double, const double)
 translates from [0;0] to "p" and rotates from 0 to "angle". The 0 initial angle implies that D = [eye(2); -eye(2)]. More...
 
void Constraints2Vert ()
 Computes the vertices of a polygon from the constraints (D*x <= d) More...
 

Public Attributes

double D [4 *2]
 Matrix of the constraints D*z <= d (where z is a 2D point). More...
 
double d [4]
 
double d_orig [4]
 Size of the support polygon for a single support (no rotation / translation). More...
 
MatrixXd vert
 Absolute coordinates of vertices. More...
 

Detailed Description

Defines rectangular constraints (of the form D*z <= d) for the ZMP.

Definition at line 30 of file rect_constraint.h.

Constructor & Destructor Documentation

◆ RectangularConstraint_ZMP()

RectangularConstraint_ZMP::RectangularConstraint_ZMP ( const double *  d_)

A constructor.

Parameters
[in]d_a [4x1] array of constraints.

The constraints are 4 positive numbers, their meaning is illustrated by the following picture:

  ----------------------------------
  |           |d(2)                |
  |  d(3)     |        d(1)        |
  |---------- p -------------------|
  |           |                    |
  |           |d(4)                |
  ----------------------------------

At creation p is assumed to be [0;0] and rotation angle = 0.

Definition at line 37 of file rect_constraint.cpp.

Member Function Documentation

◆ Constraints2Vert()

void RectangularConstraint_ZMP::Constraints2Vert ( )

Computes the vertices of a polygon from the constraints (D*x <= d)

The numbering of the vertices is

3---------2
|         |
|         |
4---------1

Definition at line 99 of file rect_constraint.cpp.

◆ rotate_translate()

void RectangularConstraint_ZMP::rotate_translate ( const double  ca,
const double  sa,
const double  x,
const double  y 
)

translates from [0;0] to "p" and rotates from 0 to "angle". The 0 initial angle implies that D = [eye(2); -eye(2)].

Parameters
[in]cacos(angle)
[in]sasin(angle)
[in]xx coordinate of the reference point
[in]yy coordinate of the reference point
Note
This is used when the constraints are initialized (only then the orientation can be set).

Definition at line 70 of file rect_constraint.cpp.

Member Data Documentation

◆ D

double RectangularConstraint_ZMP::D[4 *2]

Matrix of the constraints D*z <= d (where z is a 2D point).

Note
D is a [4 x 2] matrix stored column-wise (Fortran style). D is always initialized as (later it could be rotated using D*R'):
 D[0] =  1.0; D[4] =  0.0;
 D[1] =  0.0; D[5] =  1.0;
 D[2] = -1.0; D[6] =  0.0;
 D[3] =  0.0; D[7] = -1.0;

 D = [ 1  0;
       0  1;
      -1  0;
       0 -1] * [cos(a) -sin(a)
                sin(a)  cos(a)].

Definition at line 57 of file rect_constraint.h.

◆ d

double RectangularConstraint_ZMP::d[4]

Size of the support polygon for a single support. Vector d of the constraints D*z <= d (where z is a 2D point).

Definition at line 62 of file rect_constraint.h.

◆ d_orig

double RectangularConstraint_ZMP::d_orig[4]

Size of the support polygon for a single support (no rotation / translation).

Definition at line 65 of file rect_constraint.h.

◆ vert

MatrixXd RectangularConstraint_ZMP::vert

Absolute coordinates of vertices.

Definition at line 68 of file rect_constraint.h.


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