Klamp't  0.9.0
Utils.h
1 #ifndef CONTACT_UTILS_H
2 #define CONTACT_UTILS_H
3 
4 #include <KrisLibrary/robotics/Contact.h>
5 #include <KrisLibrary/robotics/RobotWithGeometry.h>
6 #include "Stance.h"
7 
8 namespace Klampt {
9 
10 class WorldModel;
11 
21 void GetFlatContacts(RobotWithGeometry& robot,Real tol,ContactFormation& contacts);
22 
23 
29 void GetFlatContacts(RobotWithGeometry& robot,int link,Real tol,vector<ContactPoint>& contacts);
30 
31 
37 void GetFlatStance(RobotWithGeometry& robot,Real tol,Stance& s,Real kFriction=0);
38 
39 
47 void GetNearbyContacts(RobotWithGeometry& robot,WorldModel& world,Real tol,ContactFormation& contacts);
48 
49 
56 void GetNearbyContacts(RobotWithGeometry& robot,int link,WorldModel& world,Real tol,vector<ContactPoint>& contacts);
57 
58 
62 void LocalContactsToHold(const vector<ContactPoint>& contacts,int link,const RobotKinematics3D& robot,Hold& hold);
63 
67 void LocalContactsToStance(const ContactFormation& contacts,const RobotKinematics3D& robot,Stance& stance);
68 
72 void ClusterContacts(vector<ContactPoint>& cps,int numClusters,Real clusterNormalScale=0.1,Real clusterFrictionScale=0.1);
73 
76 void CleanupContacts(vector<ContactPoint>& cp,Real tol);
77 
80 void CHContacts(vector<ContactPoint>& cp,Real ntol,Real xtol);
81 
86 int ClosestContact(const ContactPoint& p,const Meshing::TriMesh& mesh,ContactPoint& closest,Real normalScale=0.1);
87 
90 } //namespace Klampt
91 
92 #endif
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*...
void CHContacts(vector< ContactPoint > &cp, Real ntol, Real xtol)
Removes contact points in the convex hull interior of other cp&#39;s.
void GetFlatStance(RobotWithGeometry &robot, Real tol, Stance &s, Real kFriction=0)
Produces a stance as though the robot were standing on a plane.
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 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 makin...
void 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...
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.
Definition: ContactDistance.h:6
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 thos...