ChppGikSupportPolygon Class Reference

This is a support polygon class. More...

#include <hpp/gik/robot/foot-print-related.hh>

Public Member Functions

 ChppGikSupportPolygon (const ChppGikFootprint &inFootprint, bool isRight)
 Constructor for one-foot support polygon. More...
 
 ChppGikSupportPolygon (const ChppGikFootprint &inLeftFootprint, const ChppGikFootprint &inRightFootprint)
 Constructor for two-foot support polygon. More...
 
 ChppGikSupportPolygon (const ChppGikSupportPolygon &sourceObject)
 Deep copy constructor. More...
 
void applyStep (const ChppGikFootprint *inTargetFootprint, bool isRight)
 Apply step. More...
 
const ChppGikFootprintleftFootprint () const
 Get left footprint. More...
 
const ChppGikFootprintrightFootprint () const
 Get right footprint. More...
 
bool isLeftLegSupporting () const
 
bool isRightLegSupporting () const
 
bool isDoubleSupport () const
 
void print () const
 print the current support polygon More...
 
void center (double &outX, double &outY)
 Get the center of the support polygon: single support: ankle projection, double support: middle point of ankle projections. More...
 
vector3d meanOrientation ()
 Get the "mean orientation vector" defined by (xf1 (+ xf2) )/2 where xfi is the x axis of foot i. More...
 
bool isPointInsideSafeZone (double x, double y) const
 Tell if the given 2D point is inside this support polygon's safe zone. More...
 
vector3d nearestCenterPointTo (const vector3d &inPoint)
 Compute a point on the line segment linking the projections of the ankles on the ground such as M is the nearest to the parameter point inPoint. More...
 
const matrix4drfootTransformation () const
 Get a pointer to a stored transformation matrix for the right foot. More...
 
const matrix4dlfootTransformation () const
 Get a pointer to a stored transformation matrix for the left foot. More...
 
void rfootTransformation (const matrix4d &inMatrix)
 store a transformation matrix for the right foot. More...
 
void lfootTransformation (const matrix4d &inMatrix)
 store matrix for the left foot. More...
 
 ~ChppGikSupportPolygon ()
 

Static Public Member Functions

static ChppGikSupportPolygonmakeSupportPolygon (const matrix4d &leftFootH, const matrix4d &rightFootH, double normalAnkleHeight)
 try to construct the support polygon from the given transformation. More...
 

Detailed Description

This is a support polygon class.

A support polygon is defined by at least one foot print.

Constructor & Destructor Documentation

◆ ChppGikSupportPolygon() [1/3]

ChppGikSupportPolygon::ChppGikSupportPolygon ( const ChppGikFootprint inFootprint,
bool  isRight 
)

Constructor for one-foot support polygon.

◆ ChppGikSupportPolygon() [2/3]

ChppGikSupportPolygon::ChppGikSupportPolygon ( const ChppGikFootprint inLeftFootprint,
const ChppGikFootprint inRightFootprint 
)

Constructor for two-foot support polygon.

◆ ChppGikSupportPolygon() [3/3]

ChppGikSupportPolygon::ChppGikSupportPolygon ( const ChppGikSupportPolygon sourceObject)

Deep copy constructor.

◆ ~ChppGikSupportPolygon()

ChppGikSupportPolygon::~ChppGikSupportPolygon ( )

Member Function Documentation

◆ applyStep()

void ChppGikSupportPolygon::applyStep ( const ChppGikFootprint inTargetFootprint,
bool  isRight 
)

Apply step.

◆ center()

void ChppGikSupportPolygon::center ( double &  outX,
double &  outY 
)

Get the center of the support polygon: single support: ankle projection, double support: middle point of ankle projections.

◆ isDoubleSupport()

bool ChppGikSupportPolygon::isDoubleSupport ( ) const
Returns
false if single support

◆ isLeftLegSupporting()

bool ChppGikSupportPolygon::isLeftLegSupporting ( ) const
Returns
false is left foot is not on the ground

◆ isPointInsideSafeZone()

bool ChppGikSupportPolygon::isPointInsideSafeZone ( double  x,
double  y 
) const

Tell if the given 2D point is inside this support polygon's safe zone.

if the support polygon is simple, check wether the given point is in the disc centered on the orthogonal projection of the foot ankle on the ground. The radius is arbitrarily set to 4 cm. If the support is double, see if the point is in the area covered by the continuous translation of the same disc from one ankle projection to the other.

◆ isRightLegSupporting()

bool ChppGikSupportPolygon::isRightLegSupporting ( ) const
Returns
false is right foot is not on the ground

◆ leftFootprint()

const ChppGikFootprint* ChppGikSupportPolygon::leftFootprint ( ) const

Get left footprint.

Returns
0 if left foot is not on the ground

◆ lfootTransformation() [1/2]

const matrix4d* ChppGikSupportPolygon::lfootTransformation ( ) const

Get a pointer to a stored transformation matrix for the left foot.

Temporary method (until new version is ready):

Returns
0 if nothing stored

◆ lfootTransformation() [2/2]

void ChppGikSupportPolygon::lfootTransformation ( const matrix4d inMatrix)

store matrix for the left foot.

Temporary method (until new version is ready):

Returns
0 if nothing stored

◆ makeSupportPolygon()

static ChppGikSupportPolygon* ChppGikSupportPolygon::makeSupportPolygon ( const matrix4d leftFootH,
const matrix4d rightFootH,
double  normalAnkleHeight 
)
static

try to construct the support polygon from the given transformation.

Returns
0 if no foot is found on ground

◆ meanOrientation()

vector3d ChppGikSupportPolygon::meanOrientation ( )

Get the "mean orientation vector" defined by (xf1 (+ xf2) )/2 where xfi is the x axis of foot i.

◆ nearestCenterPointTo()

vector3d ChppGikSupportPolygon::nearestCenterPointTo ( const vector3d inPoint)

Compute a point on the line segment linking the projections of the ankles on the ground such as M is the nearest to the parameter point inPoint.

◆ print()

void ChppGikSupportPolygon::print ( ) const

print the current support polygon

◆ rfootTransformation() [1/2]

const matrix4d* ChppGikSupportPolygon::rfootTransformation ( ) const

Get a pointer to a stored transformation matrix for the right foot.

Temporary method (until new version is ready):

Returns
0 if nothing stored

◆ rfootTransformation() [2/2]

void ChppGikSupportPolygon::rfootTransformation ( const matrix4d inMatrix)

store a transformation matrix for the right foot.

Temporary method (until new version is ready):

Returns
0 if nothing stored

◆ rightFootprint()

const ChppGikFootprint* ChppGikSupportPolygon::rightFootprint ( ) const

Get right footprint.

Returns
0 if right foot is not on the ground