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

Typedefs

typedef std::shared_ptr< ContactFeatureBase > Klampt::ContactFeature
 

Functions

bool Klampt::LoadContactFeatures (const char *fn, vector< ContactFeature > &ccs)
 
bool Klampt::SaveContactFeatures (const char *fn, const vector< ContactFeature > &ccs)
 
void Klampt::SampleHold (const Vector3 &x, const Vector3 &n, const ContactFeatureBase *, Hold &)
 
void Klampt::SampleHold (const Vector3 &x, const Vector3 &n, const vector< ContactFeature > &, Hold &)
 
void Klampt::SampleHold (Triangle3DSampler &smp, const ContactFeatureBase *, Hold &)
 
void Klampt::SampleHold (Triangle3DSampler &smp, const vector< ContactFeature > &, Hold &)
 
void Klampt::HoldFromTransform (const ContactFeatureBase *f, const RigidTransform &T, Hold &h)
 Computes a hold that transforms the contact feature by T.
 
bool Klampt::FeatureRayIntersection (const ContactFeatureBase *f, const Ray3D &ray, Real tol=0)
 Returns true if the ray intersects the contact feature.
 
Vector3 Klampt::FeatureContactPoint (const ContactFeatureBase *f)
 Returns the centroid of the feature contact region.
 
Vector3 Klampt::FeatureContactNormal (const ContactFeatureBase *f)
 
Vector3 Klampt::SampleFeatureContactPoint (const ContactFeatureBase *f)
 Uniformly samples a contact point in the feature contact region.
 
bool Klampt::LoadContactFeatureMapping (istream &in, const vector< ContactFeature > &features, ContactFeatureMapping &m)
 
void Klampt::SaveContactFeatureMapping (ostream &out, ContactFeatureMapping &m)
 
bool Klampt::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 Klampt::BestFeatureMappingAngle (const ContactFeatureMapping &feature, const Matrix3 &Rdes)
 Returns the angle parameter that makes the feature map to Rdes.
 
void Klampt::SetFeatureMappingOrientation (ContactFeatureMapping &feature, const Matrix3 &Rdes)
 Sets the angle parameters that make the feature map to Rdes.
 
bool Klampt::operator== (const Hold &a, const Hold &b)
 
bool Klampt::operator< (const Hold &a, const Hold &b)
 
bool Klampt::operator> (const Hold &a, const Hold &b)
 
ostream & Klampt::operator<< (ostream &, const Hold &)
 
istream & Klampt::operator>> (istream &, Hold &)
 
const Hold & Klampt::DifferingHold (const Stance &a, const Stance &b)
 If b = a union {h}, returns h. More...
 
bool Klampt::IsSimilarStance (const Stance &a, const Stance &b)
 Returns true if a and b share the same links.
 
bool Klampt::IsSubset (const Stance &a, const Stance &b)
 Returns true if a is a subset of b.
 
void Klampt::GetDifference (const Stance &a, const Stance &b, vector< Hold > &d)
 Returns the difference d = a-b.
 
void Klampt::ToContactFormation (const Stance &stance, ContactFormation &contacts)
 
void Klampt::ToIKProblem (const Stance &stance, vector< IKGoal > &constraints)
 
void Klampt::GetFlatContacts (RobotWithGeometry &robot, Real tol, ContactFormation &contacts)
 Produces a list of contacts as though the robot were standing on a plane. More...
 
void Klampt::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 Klampt::GetFlatStance (RobotWithGeometry &robot, Real tol, Stance &s, Real kFriction=0)
 Produces a stance as though the robot were standing on a plane. More...
 
void Klampt::GetNearbyContacts (RobotWithGeometry &robot, WorldModel &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 Klampt::GetNearbyContacts (RobotWithGeometry &robot, int link, WorldModel &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 Klampt::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 Klampt::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 Klampt::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 Klampt::CleanupContacts (vector< ContactPoint > &cp, Real tol)
 Merges contact points within tol distance of each other.
 
void Klampt::CHContacts (vector< ContactPoint > &cp, Real ntol, Real xtol)
 Removes contact points in the convex hull interior of other cp's.
 
int Klampt::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> Klampt::ContactFeature

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

Function Documentation

const Hold& Klampt::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 Klampt::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 Klampt::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 Klampt::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 Klampt::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 Klampt::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 Klampt::GetNearbyContacts ( RobotWithGeometry &  robot,
WorldModel 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 Klampt::GetNearbyContacts ( RobotWithGeometry &  robot,
int  link,
WorldModel 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 Klampt::ToContactFormation ( const Stance stance,
ContactFormation &  contacts 
)

converts a stance to a contact formation

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

extracts the IK goals from the stance