The function returns a relative transformation between the two "closest" convex shapes it contains. More...
#include <hpp/constraints/convex-shape-contact.hh>
Classes | |
struct | ForceData |
Represents a contact When supportJoint is NULL, the contact is with the environment. More... | |
Public Types | |
enum | ContactType { POINT_ON_PLANE, LINE_ON_PLANE, PLANE_ON_PLANE } |
The type of contact between each pair (object shape, floor shape). More... | |
Public Member Functions | |
ConvexShapeContact (const std::string &name, const DevicePtr_t &robot) | |
Constructor. More... | |
void | addObjectTriangle (const fcl::TriangleP &t, const JointPtr_t &joint) HPP_CONSTRAINTS_DEPRECATED |
Use addObject(const ConvexShape&) instead. More... | |
void | addFloorTriangle (const fcl::TriangleP &t, const JointPtr_t &joint) HPP_CONSTRAINTS_DEPRECATED |
Use addFloor(const ConvexShape&) instead. More... | |
void | addObject (const ConvexShape &t) |
Add a ConvexShape as an object. More... | |
void | addFloor (const ConvexShape &t) |
Add a ConvexShape as a floor. More... | |
void | setNormalMargin (const value_type &margin) |
Set the normal margin, i.e. More... | |
std::vector< ForceData > | computeContactPoints (ConfigurationIn_t q, const value_type &normalMargin) const |
Compute the contact points. More... | |
std::ostream & | print (std::ostream &o) const |
Display object in a stream. More... | |
![]() | |
virtual | ~DifferentiableFunction () |
LiegroupElement | operator() (vectorIn_t argument) const |
Evaluate the function at a given parameter. More... | |
void | value (LiegroupElementRef result, vectorIn_t argument) const |
Evaluate the function at a given parameter. More... | |
void | jacobian (matrixOut_t jacobian, vectorIn_t argument) const |
Computes the jacobian. More... | |
const ArrayXb & | activeParameters () const |
Returns a vector of booleans that indicates whether the corresponding configuration parameter influences this constraints. More... | |
const ArrayXb & | activeDerivativeParameters () const |
Returns a vector of booleans that indicates whether the corresponding velocity parameter influences this constraints. More... | |
size_type | inputSize () const |
Get dimension of input vector. More... | |
size_type | inputDerivativeSize () const |
Get dimension of input derivative vector. More... | |
LiegroupSpacePtr_t | outputSpace () const |
Get output element. More... | |
size_type | outputSize () const |
Get dimension of output vector. More... | |
size_type | outputDerivativeSize () const |
Get dimension of output derivative vector. More... | |
const std::string & | name () const |
Get function name. More... | |
std::string | context () const |
void | context (const std::string &c) |
void | finiteDifferenceForward (matrixOut_t jacobian, vectorIn_t arg, DevicePtr_t robot=DevicePtr_t(), value_type eps=std::sqrt(Eigen::NumTraits< value_type >::epsilon())) const |
Approximate the jacobian using forward finite difference. More... | |
void | finiteDifferenceCentral (matrixOut_t jacobian, vectorIn_t arg, DevicePtr_t robot=DevicePtr_t(), value_type eps=std::sqrt(Eigen::NumTraits< value_type >::epsilon())) const |
Approximate the jacobian using forward finite difference. More... | |
Static Public Member Functions | |
static ConvexShapeContactPtr_t | create (const std::string &name, const DevicePtr_t &robot) |
static ConvexShapeContactPtr_t | create (const DevicePtr_t &robot) |
Friends | |
class | ConvexShapeContactComplement |
Additional Inherited Members | |
![]() | |
DifferentiableFunction (size_type sizeInput, size_type sizeInputDerivative, size_type sizeOutput, std::string name=std::string()) | |
Concrete class constructor should call this constructor. More... | |
DifferentiableFunction (size_type sizeInput, size_type sizeInputDerivative, const LiegroupSpacePtr_t &outputSpace, std::string name=std::string()) | |
Concrete class constructor should call this constructor. More... | |
virtual void | impl_compute (LiegroupElementRef result, vectorIn_t argument) const =0 |
User implementation of function evaluation. More... | |
virtual void | impl_jacobian (matrixOut_t jacobian, vectorIn_t arg) const =0 |
![]() | |
size_type | inputSize_ |
Dimension of input vector. More... | |
size_type | inputDerivativeSize_ |
Dimension of input derivative. More... | |
LiegroupSpacePtr_t | outputSpace_ |
Dimension of output vector. More... | |
ArrayXb | activeParameters_ |
Initialized to true by this class. More... | |
ArrayXb | activeDerivativeParameters_ |
Initialized to true by this class. More... | |
The function returns a relative transformation between the two "closest" convex shapes it contains.
Two set of convex shapes can be given to this class:
The distance \( d_{i,j} = d (o_i, f_j) \) between object surface \(o_i\) and environment surface \( f_j \) is defined by:
\begin{equation*} d(i,j)^2 = \left\lbrace \begin{array}{cl} d_{\parallel}^2 + d_{\perp}^2 &, \text{ if } d_{\parallel} > 0 \\ d_{\perp}^2 &, \text{ otherwise} \end{array} \right. \end{equation*}
where
The function first selects the pair \((o_i,f_j)\) with shortest distance. \(o_i\) is inside \(f_j\) if \(d(i,j) < 0\). It returns a value that depends on the contact types:
Contact type | Inside | Outside |
---|---|---|
ConvexShapeContact::POINT_ON_PLANE | \((x+m,0,0,0,0)\) | \((x+m,y,z,0,0)\) |
ConvexShapeContact::LINE_ON_PLANE (Unsupported) | \((x+m,0,0,0,rz)\) | \((x+m,y,z,0,rz)\) |
ConvexShapeContact::PLANE_ON_PLANE | \((x+m,0,0,ry,rz)\) | \((x+m,y,z,ry,rz)\) |
where
hpp::constraints::ConvexShapeContact::ConvexShapeContact | ( | const std::string & | name, |
const DevicePtr_t & | robot | ||
) |
Constructor.
name | name of the ConvexShapeContact constraint, |
robot | the robot the constraints is applied to, |
void hpp::constraints::ConvexShapeContact::addFloor | ( | const ConvexShape & | t | ) |
Add a ConvexShape as a floor.
The convex shape will be reverted using ConvexShape::reverse so that the normal points inside the floor object.
void hpp::constraints::ConvexShapeContact::addFloorTriangle | ( | const fcl::TriangleP & | t, |
const JointPtr_t & | joint | ||
) |
Use addFloor(const ConvexShape&) instead.
Add a triangle to the floor contact surface
t | triangle, joint Joint to which the triangle is attached if the contact surface belongs to a robot. |
void hpp::constraints::ConvexShapeContact::addObject | ( | const ConvexShape & | t | ) |
Add a ConvexShape as an object.
void hpp::constraints::ConvexShapeContact::addObjectTriangle | ( | const fcl::TriangleP & | t, |
const JointPtr_t & | joint | ||
) |
Use addObject(const ConvexShape&) instead.
Add a triangle to the object contact surface
t | triangle, |
joint | Joint to which the triangle is attached. |
std::vector<ForceData> hpp::constraints::ConvexShapeContact::computeContactPoints | ( | ConfigurationIn_t | q, |
const value_type & | normalMargin | ||
) | const |
Compute the contact points.
|
static |
|
static |
|
virtual |
Display object in a stream.
Reimplemented from hpp::constraints::DifferentiableFunction.
void hpp::constraints::ConvexShapeContact::setNormalMargin | ( | const value_type & | margin | ) |
Set the normal margin, i.e.
the desired distance between matching object and nd floor shapes. Default to 0
|
friend |