Public Member Functions | Public Attributes | List of all members
hpp::constraints::ConvexShape Class Reference

#include <hpp/constraints/convex-shape.hh>

Collaboration diagram for hpp::constraints::ConvexShape:
[legend]

Public Member Functions

 ConvexShape (const std::vector< vector3_t > &pts, JointPtr_t joint=JointPtr_t())
 Represent a convex shape. More...
 
 ConvexShape (const fcl::TriangleP &t, const JointPtr_t &joint=JointPtr_t())
 
 ConvexShape (const vector3_t &p0, const vector3_t &p1, const vector3_t &p2, const JointPtr_t &joint=JointPtr_t())
 This constructor is required for compatibility with deprecated Triangle constructor. More...
 
 ConvexShape (const ConvexShape &t)
 
void reverse ()
 
void updateToCurrentTransform () const
 
vector3_t intersection (const vector3_t &A, const vector3_t &u) const
 Intersection with a line defined by a point and a vector. More...
 
vector3_t intersectionLocal (const vector3_t &A, const vector3_t &u) const
 
bool isInside (const vector3_t &A, const vector3_t &u) const
 Check whether the intersection of the line defined by A and u onto the plane containing the triangle is inside the triangle. More...
 
bool isInside (const vector3_t &Ap) const
 
bool isInsideLocal (const vector3_t &Ap) const
 As isInside but consider A as expressed in joint frame. More...
 
value_type distance (vector3_t a) const
 Return the shortest distance from a point to the shape A negative value means the point is inside the shape. More...
 
const vector3_tplaneXaxis () const
 Return the X axis of the plane in the joint frame. More...
 
const vector3_tplaneYaxis () const
 Return the Y axis of the plane in the joint frame The Y axis is aligned with \( Pts_[1] - Pts_[0] \). More...
 
const vector3_tnormal () const
 Return the normal in world frame. More...
 
const vector3_tcenter () const
 Return the center in world frame. More...
 
const Transform3fpositionInJoint () const
 Transform of the shape in the joint frame. More...
 
void computeAlignedPosition (vector3_t yaxis) const
 
const Transform3falignedPositionInJoint () const
 

Public Attributes

std::vector< vector3_tPts_
 The points in the joint frame. It is constant. More...
 
size_t shapeDimension_
 
vector3_t C_
 the center in the joint frame. It is constant. More...
 
vector3_t N_
 the normal to the shape in the joint frame. It is constant. More...
 
std::vector< vector3_tNs_
 Ns_ and Us_ are unit vector, in the plane containing the shape, expressed in the joint frame. More...
 
std::vector< vector3_tUs_
 
vector_t Ls_
 
Transform3f MinJoint_
 
JointPtr_t joint_
 

Constructor & Destructor Documentation

◆ ConvexShape() [1/4]

hpp::constraints::ConvexShape::ConvexShape ( const std::vector< vector3_t > &  pts,
JointPtr_t  joint = JointPtr_t() 
)
inline

Represent a convex shape.

Parameters
ptsa sequence of points lying in a plane. The convex shape is obtained by connecting consecutive points (in a circular way)
Note
There is no convexity check yet. The order is important: The normal is parallel to (pts[1] - pts[0]).cross (pts[2] - pts[1]) The normal to the segment in the plane are directed outward. (pts[i+1] - pts[i]).cross (normalToConvexShape)

◆ ConvexShape() [2/4]

hpp::constraints::ConvexShape::ConvexShape ( const fcl::TriangleP &  t,
const JointPtr_t joint = JointPtr_t() 
)
inline

◆ ConvexShape() [3/4]

hpp::constraints::ConvexShape::ConvexShape ( const vector3_t p0,
const vector3_t p1,
const vector3_t p2,
const JointPtr_t joint = JointPtr_t() 
)
inline

This constructor is required for compatibility with deprecated Triangle constructor.

◆ ConvexShape() [4/4]

hpp::constraints::ConvexShape::ConvexShape ( const ConvexShape t)
inline

Member Function Documentation

◆ alignedPositionInJoint()

const Transform3f& hpp::constraints::ConvexShape::alignedPositionInJoint ( ) const
inline

◆ center()

const vector3_t& hpp::constraints::ConvexShape::center ( ) const
inline

Return the center in world frame.

◆ computeAlignedPosition()

void hpp::constraints::ConvexShape::computeAlignedPosition ( vector3_t  yaxis) const
inline

References Eigen::assert().

◆ distance()

value_type hpp::constraints::ConvexShape::distance ( vector3_t  a) const
inline

Return the shortest distance from a point to the shape A negative value means the point is inside the shape.

Parameters
Aa point already in the plane containing the convex shape, and expressed in the global frame.

References Eigen::assert(), and Eigen::d.

◆ intersection()

vector3_t hpp::constraints::ConvexShape::intersection ( const vector3_t A,
const vector3_t u 
) const
inline

Intersection with a line defined by a point and a vector.

updateToCurrentTransform() should be called before.

References Eigen::assert().

◆ intersectionLocal()

vector3_t hpp::constraints::ConvexShape::intersectionLocal ( const vector3_t A,
const vector3_t u 
) const
inline

References Eigen::assert().

◆ isInside() [1/2]

bool hpp::constraints::ConvexShape::isInside ( const vector3_t A,
const vector3_t u 
) const
inline

Check whether the intersection of the line defined by A and u onto the plane containing the triangle is inside the triangle.

References Eigen::assert().

◆ isInside() [2/2]

bool hpp::constraints::ConvexShape::isInside ( const vector3_t Ap) const
inline

References Eigen::assert().

◆ isInsideLocal()

bool hpp::constraints::ConvexShape::isInsideLocal ( const vector3_t Ap) const
inline

As isInside but consider A as expressed in joint frame.

References Eigen::assert().

◆ normal()

const vector3_t& hpp::constraints::ConvexShape::normal ( ) const
inline

Return the normal in world frame.

References Eigen::assert().

◆ planeXaxis()

const vector3_t& hpp::constraints::ConvexShape::planeXaxis ( ) const
inline

Return the X axis of the plane in the joint frame.

References Eigen::assert().

◆ planeYaxis()

const vector3_t& hpp::constraints::ConvexShape::planeYaxis ( ) const
inline

Return the Y axis of the plane in the joint frame The Y axis is aligned with \( Pts_[1] - Pts_[0] \).

References Eigen::assert().

◆ positionInJoint()

const Transform3f& hpp::constraints::ConvexShape::positionInJoint ( ) const
inline

Transform of the shape in the joint frame.

◆ reverse()

void hpp::constraints::ConvexShape::reverse ( )
inline

◆ updateToCurrentTransform()

void hpp::constraints::ConvexShape::updateToCurrentTransform ( ) const
inline

Member Data Documentation

◆ C_

vector3_t hpp::constraints::ConvexShape::C_

the center in the joint frame. It is constant.

◆ joint_

JointPtr_t hpp::constraints::ConvexShape::joint_

◆ Ls_

vector_t hpp::constraints::ConvexShape::Ls_

◆ MinJoint_

Transform3f hpp::constraints::ConvexShape::MinJoint_

◆ N_

vector3_t hpp::constraints::ConvexShape::N_

the normal to the shape in the joint frame. It is constant.

◆ Ns_

std::vector<vector3_t> hpp::constraints::ConvexShape::Ns_

Ns_ and Us_ are unit vector, in the plane containing the shape, expressed in the joint frame.

Ns_[i] is normal to edge i, pointing inside. Ns_[i] is a vector director of edge i.

◆ Pts_

std::vector<vector3_t> hpp::constraints::ConvexShape::Pts_

The points in the joint frame. It is constant.

◆ shapeDimension_

size_t hpp::constraints::ConvexShape::shapeDimension_

◆ Us_

std::vector<vector3_t> hpp::constraints::ConvexShape::Us_