class
#include <iDynTree/ConvexHullHelpers.h>
ConvexHullProjectionConstraint ConvexHullProjectionConstraint helper.
Public functions
- void setActive(const bool isActive)
- Set if the constraint is active or not.
- auto isActive() -> bool
- Get if the constraint is active or not.
- auto getNrOfConstraints() -> size_t
- Get the number of constraints (i.e.
-
auto buildConvexHull(const iDynTree::
Direction xAxisOfPlaneInWorld, const iDynTree:: Direction yAxisOfPlaneInWorld, const iDynTree:: Position originOfPlaneInWorld, const std::vector<Polygon>& supportPolygonsExpressedInSupportFrame, const std::vector<Transform>& absoluteFrame_X_supportFrame) -> bool - Build the projected convex hull.
-
auto project(iDynTree::
Position& posIn3dInAbsoluteFrame) -> Vector2 - Project a point in the plane of the convex hull.
- auto computeMargin(const Vector2& posIn2D) -> double
- Compute distance of a 2D point from the convex hull.
-
void setProjectionAlongDirection(const iDynTree::
Vector3& direction) -
auto projectAlongDirection(const iDynTree::
Position& posIn3dInAbsoluteFrame) -> Vector2
Public variables
- Polygon2D projectedConvexHull
- Convex hull expressed in the 2D project constraint plane.
- MatrixDynSize A
- A constraint matrix, such that Ax <= b iff the com projection x is in the convex hull.
- VectorDynSize b
- b vector, such that Ax <= b iff the com projection x is in the convex hull.
- Matrix2x3 P
- Projection matrix P, Note that x = P*(c-o), where x is the projection and c is the 3d COM .
- Matrix2x3 Pdirection
- Projection matrix 'Pdirection' defined by a given direction.
- MatrixDynSize AtimesP
- Matrix obtained multiplyng the matrix A for the matrix P.
-
iDynTree::
Position o - Plane offset o Note that x = P*(c-o), where x is the projection and c is the 3d COM .
- std::vector<int> supportFrameIndices
- List of support frames.
- std::vector<Transform> absoluteFrame_X_supportFrame
- List of absolue_X_supportFrames.
Function documentation
bool iDynTree:: ConvexHullProjectionConstraint:: isActive()
Get if the constraint is active or not.
Returns | true if the constraint is active, false otherwise. |
---|
size_t iDynTree:: ConvexHullProjectionConstraint:: getNrOfConstraints()
Get the number of constraints (i.e.
Returns | the number of constraints. |
---|
the number rows of the matrix A).
bool iDynTree:: ConvexHullProjectionConstraint:: buildConvexHull(const iDynTree:: Direction xAxisOfPlaneInWorld,
const iDynTree:: Direction yAxisOfPlaneInWorld,
const iDynTree:: Position originOfPlaneInWorld,
const std::vector<Polygon>& supportPolygonsExpressedInSupportFrame,
const std::vector<Transform>& absoluteFrame_X_supportFrame)
Build the projected convex hull.
Parameters | |
---|---|
xAxisOfPlaneInWorld | |
yAxisOfPlaneInWorld | |
originOfPlaneInWorld | |
supportPolygonsExpressedInSupportFrame | Vector of the support polygons, expressed in the support frames. |
absoluteFrame_X_supportFrame | Vector of the transform between each support frame and the absolute frame. |
Returns | true if all went well, false otherwise. |
Vector2 iDynTree:: ConvexHullProjectionConstraint:: project(iDynTree:: Position& posIn3dInAbsoluteFrame)
Project a point in the plane of the convex hull.
The point is expressed in the absolute frame of the constriant.
double iDynTree:: ConvexHullProjectionConstraint:: computeMargin(const Vector2& posIn2D)
Compute distance of a 2D point from the convex hull.
The distance is positive if the point is inside the convex hull, zero if the point is on the boundary of the convex hull, and negative if it is outside of the convex hull.
void iDynTree:: ConvexHullProjectionConstraint:: setProjectionAlongDirection(const iDynTree:: Vector3& direction)
Parameters | |
---|---|
direction | vector along which we want to project a point |
Set the projection matrix 'Pdirection' given a desired projection direction.
Vector2 iDynTree:: ConvexHullProjectionConstraint:: projectAlongDirection(const iDynTree:: Position& posIn3dInAbsoluteFrame)
Parameters | |
---|---|
posIn3dInAbsoluteFrame | a point we want to project |
Project a point along a direction defined by the projection matrix 'Pdirection'
Variable documentation
Polygon2D iDynTree:: ConvexHullProjectionConstraint:: projectedConvexHull
Convex hull expressed in the 2D project constraint plane.
This is computed by the buildConvexHull method.
Matrix2x3 iDynTree:: ConvexHullProjectionConstraint:: Pdirection
Projection matrix 'Pdirection' defined by a given direction.
The projection 'x' of a 3D point 'c' along a given vector is obtained as: x = Pdirection*(c-o).