Klamp't  0.8.1
Files | Classes | Typedefs | Functions
Contact

Files

file  ContactFeature.h
 Defines the ContactFeature structures and some routines for creating holds from features.
 
file  ContactFeatureMapping.h
 Defines the ContactFeatureMapping structure, load/save functions.
 
file  Hold.h
 Structures defining the finalized contacts used in stances.
 

Classes

struct  ContactFeatureBase
 A feature on the robot that can be used for contact. More...
 
struct  PointContactFeature
 A single point contact feature. More...
 
struct  EdgeContactFeature
 An edge contact feature. More...
 
struct  FaceContactFeature
 A (planar) face contact feature. More...
 
struct  WheelContactFeature
 A wheel contact feature. More...
 
struct  FacesContactFeature
 A contact feature consisting of multiple faces. More...
 
struct  ContactFeatureMapping
 A mapping from a ContactFeature to a point on the environment. More...
 
class  Grasp
 Slightly more sophisticated than a Stance, a Grasp allows some of the robot's degrees of freedom to be fixed. More...
 
struct  Hold
 A single contact between the robot and the environment. More...
 
struct  Stance
 A collection of holds. More...
 

Typedefs

typedef std::shared_ptr< ContactFeatureBaseContactFeature
 

Functions

bool LoadContactFeatures (const char *fn, vector< ContactFeature > &ccs)
 
bool SaveContactFeatures (const char *fn, const vector< ContactFeature > &ccs)
 
void SampleHold (const Vector3 &x, const Vector3 &n, const ContactFeatureBase *, Hold &)
 
void SampleHold (const Vector3 &x, const Vector3 &n, const vector< ContactFeature > &, Hold &)
 
void SampleHold (Triangle3DSampler &smp, const ContactFeatureBase *, Hold &)
 
void SampleHold (Triangle3DSampler &smp, const vector< ContactFeature > &, Hold &)
 
void HoldFromTransform (const ContactFeatureBase *f, const RigidTransform &T, Hold &h)
 Computes a hold that transforms the contact feature by T.
 
bool FeatureRayIntersection (const ContactFeatureBase *f, const Ray3D &ray, Real tol=0)
 Returns true if the ray intersects the contact feature.
 
Vector3 FeatureContactPoint (const ContactFeatureBase *f)
 Returns the centroid of the feature contact region.
 
Vector3 FeatureContactNormal (const ContactFeatureBase *f)
 
Vector3 SampleFeatureContactPoint (const ContactFeatureBase *f)
 Uniformly samples a contact point in the feature contact region.
 
bool LoadContactFeatureMapping (istream &in, const vector< ContactFeature > &features, ContactFeatureMapping &m)
 
void SaveContactFeatureMapping (ostream &out, ContactFeatureMapping &m)
 
bool FeatureMappingFromHold (const Hold &h, const vector< ContactFeature > &features, ContactFeatureMapping &m)
 Constructs a contact feature mapping from a hold by trying to match contact features to the hold. More...
 
Real BestFeatureMappingAngle (const ContactFeatureMapping &feature, const Matrix3 &Rdes)
 Returns the angle parameter that makes the feature map to Rdes.
 
void SetFeatureMappingOrientation (ContactFeatureMapping &feature, const Matrix3 &Rdes)
 Sets the angle parameters that make the feature map to Rdes.
 
bool operator== (const Hold &a, const Hold &b)
 
bool operator< (const Hold &a, const Hold &b)
 
bool operator> (const Hold &a, const Hold &b)
 
ostream & operator<< (ostream &, const Hold &)
 
istream & operator>> (istream &, Hold &)
 
const HoldDifferingHold (const Stance &a, const Stance &b)
 If b = a union {h}, returns h. More...
 
bool IsSimilarStance (const Stance &a, const Stance &b)
 Returns true if a and b share the same links.
 
bool IsSubset (const Stance &a, const Stance &b)
 Returns true if a is a subset of b.
 
void GetDifference (const Stance &a, const Stance &b, vector< Hold > &d)
 Returns the difference d = a-b.
 
void ToContactFormation (const Stance &stance, ContactFormation &contacts)
 
void ToIKProblem (const Stance &stance, vector< IKGoal > &constraints)
 
void GetFlatContacts (RobotWithGeometry &robot, Real tol, ContactFormation &contacts)
 Produces a list of contacts as though the robot were standing on a plane. More...
 
void GetFlatContacts (RobotWithGeometry &robot, int link, Real tol, vector< ContactPoint > &contacts)
 Produces a list of contacts as though the link were resting on a plane. More...
 
void GetFlatStance (RobotWithGeometry &robot, Real tol, Stance &s, Real kFriction=0)
 Produces a stance as though the robot were standing on a plane. More...
 
void GetNearbyContacts (RobotWithGeometry &robot, RobotWorld &world, Real tol, ContactFormation &contacts)
 Produces a list of contacts for all points on the robot within tol of the other objects in world. More...
 
void GetNearbyContacts (RobotWithGeometry &robot, int link, RobotWorld &world, Real tol, vector< ContactPoint > &contacts)
 Produces a list of contacts for all points on the link within tol of other objects in world. More...
 
void LocalContactsToHold (const vector< ContactPoint > &contacts, int link, const RobotKinematics3D &robot, Hold &hold)
 For a set of local contacts on a link, returns a hold for the given robot. Assumes the robot is making those contacts in its current config.
 
void LocalContactsToStance (const ContactFormation &contacts, const RobotKinematics3D &robot, Stance &stance)
 For a local contact formation, returns a stance for the given robot. Assumes the robot is making those contacts in its current config.
 
void ClusterContacts (vector< ContactPoint > &cps, int numClusters, Real clusterNormalScale=0.1, Real clusterFrictionScale=0.1)
 Reduces a complex set of contacts to a set of representative clusters through kmeans clustering.
 
void CleanupContacts (vector< ContactPoint > &cp, Real tol)
 Merges contact points within tol distance of each other.
 
void CHContacts (vector< ContactPoint > &cp, Real ntol, Real xtol)
 Removes contact points in the convex hull interior of other cp's.
 
int ClosestContact (const ContactPoint &p, const Meshing::TriMesh &mesh, ContactPoint &closest, Real normalScale=0.1)
 Finds the closest point/normal on the mesh to p. Metric distance is sqrt(||p.x - x||^2 + normalScale*||p.n - n||^2) where x and n are the points on the mesh. Returns the triangle.
 

Detailed Description

Contact points, holds, stances, and grasps

Typedef Documentation

typedef std::shared_ptr<ContactFeatureBase> ContactFeature

A smart pointer to a ContactFeatureBase – use GetType() to cast to the right subtype.

Function Documentation

const Hold& DifferingHold ( const Stance a,
const Stance b 
)

If b = a union {h}, returns h.

Unexpected results may occur if the precondition b = a union {h} is not fulfilled.

Vector3 FeatureContactNormal ( const ContactFeatureBase f)

Returns the local normal that is mapped to the environment contact normal. The zero vector is returned if there is no such normal defined (e.g. point and edge features)

bool FeatureMappingFromHold ( const Hold h,
const vector< ContactFeature > &  features,
ContactFeatureMapping m 
)

Constructs a contact feature mapping from a hold by trying to match contact features to the hold.

The matching criterion is that the hold IK constraint matches the contact feature's, and the hold contact points are approximately within in the contact feature. Returns true if successful.

void GetFlatContacts ( RobotWithGeometry &  robot,
Real  tol,
ContactFormation &  contacts 
)

Produces a list of contacts as though the robot were standing on a plane.

tol is the tolerance with which minimum-distance points are generated. All contacts are given zero friction and in the local frame of the robot's links.

void GetFlatContacts ( RobotWithGeometry &  robot,
int  link,
Real  tol,
vector< ContactPoint > &  contacts 
)

Produces a list of contacts as though the link were resting on a plane.

tol is the tolerance with which minimum-distance points are generated. All contacts are given zero friction and in the local frame of the link.

void GetFlatStance ( RobotWithGeometry &  robot,
Real  tol,
Stance s,
Real  kFriction = 0 
)

Produces a stance as though the robot were standing on a plane.

tol is the tolerance with which minimum-distance points are generated. All contacts are given friction kFriction.

void GetNearbyContacts ( RobotWithGeometry &  robot,
RobotWorld world,
Real  tol,
ContactFormation &  contacts 
)

Produces a list of contacts for all points on the robot within tol of the other objects in world.

tol is the tolerance with which minimum-distance points are generated. All contacts are given zero friction and in the local frame of the robot's links.

void GetNearbyContacts ( RobotWithGeometry &  robot,
int  link,
RobotWorld world,
Real  tol,
vector< ContactPoint > &  contacts 
)

Produces a list of contacts for all points on the link within tol of other objects in world.

tol is the tolerance with which minimum-distance points are generated. All contacts are given zero friction and in the local frame of the link.

void ToContactFormation ( const Stance stance,
ContactFormation &  contacts 
)

converts a stance to a contact formation

void ToIKProblem ( const Stance stance,
vector< IKGoal > &  constraints 
)

extracts the IK goals from the stance