Klamp't  0.8.1
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 class RobotWorld;
7 #include "Stance.h"
8 
18 void GetFlatContacts(RobotWithGeometry& robot,Real tol,ContactFormation& contacts);
19 
20 
26 void GetFlatContacts(RobotWithGeometry& robot,int link,Real tol,vector<ContactPoint>& contacts);
27 
28 
34 void GetFlatStance(RobotWithGeometry& robot,Real tol,Stance& s,Real kFriction=0);
35 
36 
44 void GetNearbyContacts(RobotWithGeometry& robot,RobotWorld& world,Real tol,ContactFormation& contacts);
45 
46 
53 void GetNearbyContacts(RobotWithGeometry& robot,int link,RobotWorld& world,Real tol,vector<ContactPoint>& contacts);
54 
55 
59 void LocalContactsToHold(const vector<ContactPoint>& contacts,int link,const RobotKinematics3D& robot,Hold& hold);
60 
64 void LocalContactsToStance(const ContactFormation& contacts,const RobotKinematics3D& robot,Stance& stance);
65 
69 void ClusterContacts(vector<ContactPoint>& cps,int numClusters,Real clusterNormalScale=0.1,Real clusterFrictionScale=0.1);
70 
73 void CleanupContacts(vector<ContactPoint>& cp,Real tol);
74 
77 void CHContacts(vector<ContactPoint>& cp,Real ntol,Real xtol);
78 
83 int ClosestContact(const ContactPoint& p,const Meshing::TriMesh& mesh,ContactPoint& closest,Real normalScale=0.1);
84 
85 
86 
89 #endif
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...
A single contact between the robot and the environment.
Definition: Hold.h:26
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 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...
A collection of holds.
Definition: Stance.h:19
void GetFlatContacts(RobotWithGeometry &robot, Real tol, ContactFormation &contacts)
Produces a list of contacts as though the robot were standing on a plane.
The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here.
Definition: World.h:20
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...
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 CleanupContacts(vector< ContactPoint > &cp, Real tol)
Merges contact points within tol distance of each other.
void GetFlatStance(RobotWithGeometry &robot, Real tol, Stance &s, Real kFriction=0)
Produces a stance as though the robot were standing on a plane.