ChppGikSupportPolygon Class Reference

This is a support polygon class. More...

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

List of all members.

Public Member Functions

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

Detailed Description

This is a support polygon class.

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


Constructor & Destructor Documentation

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

Constructor for one-foot support polygon.

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

Constructor for two-foot support polygon.

ChppGikSupportPolygon::ChppGikSupportPolygon ( const ChppGikSupportPolygon sourceObject)

Deep copy constructor.

ChppGikSupportPolygon::~ChppGikSupportPolygon ( )

Member Function Documentation

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

Apply step.

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.

bool ChppGikSupportPolygon::isDoubleSupport ( ) const
Returns:
false if single support
bool ChppGikSupportPolygon::isLeftLegSupporting ( ) const
Returns:
false is left foot is not on the ground
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.

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

Get left footprint.

Returns:
0 if left foot is not on the ground
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
void ChppGikSupportPolygon::lfootTransformation ( const matrix4d inMatrix)

store matrix for the left foot.

Temporary method (until new version is ready):

Returns:
0 if nothing stored
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
vector3d ChppGikSupportPolygon::meanOrientation ( )

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

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.

void ChppGikSupportPolygon::print ( ) const

print the current support polygon

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
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
const ChppGikFootprint* ChppGikSupportPolygon::rightFootprint ( ) const

Get right footprint.

Returns:
0 if right foot is not on the ground