1 #ifndef CONTACT_FEATURE_H 2 #define CONTACT_FEATURE_H 5 #include <KrisLibrary/math3d/Polygon3D.h> 6 #include <KrisLibrary/math3d/geometry3d.h> 11 struct Triangle3DSampler;
34 enum Type { Point, Edge, Face, MultipleFaces, Wheel };
38 virtual Type GetType()
const =0;
48 virtual Type GetType()
const {
return Point; }
54 void GetHold(
const Vector3& x,
Hold&)
const;
62 virtual Type GetType()
const {
return Edge; }
69 void GetHold(
const Vector3& x,
const Vector3& axis,
Hold&)
const;
77 void GetHold(
const Vector3& x,
const Vector3& n,Real theta,
Hold&)
const;
90 virtual Type GetType()
const {
return Face; }
93 void GetPlane(Plane3D& p)
const;
95 void GetCentroid(Vector3& p)
const;
105 void GetHold(
const Vector3& x,
const Vector3& n,Real theta,
Hold&)
const;
107 void GetHold(
const Vector3& localPos,
const Vector3& x,
const Vector3& n,Real theta,
Hold&)
const;
113 virtual Type GetType()
const {
return Wheel; }
116 Vector3
GetCenter()
const { Vector3 center; axis.closestPoint(p,center);
return center; }
128 void GetHold(
const Vector3& x,
const Vector3& n,Real theta,
Hold&)
const;
139 void GetFixedHold(
const Vector3& x,
const Vector3& n,Real theta,Real roll,
Hold&)
const;
154 virtual Type GetType()
const {
return MultipleFaces; }
158 vector<Polygon3D> faces;
165 bool LoadContactFeatures(
const char* fn,vector<ContactFeature>& ccs);
166 bool SaveContactFeatures(
const char* fn,
const vector<ContactFeature>& ccs);
169 void SampleHold(
const Vector3& x,
const Vector3& n,
const vector<ContactFeature>&,
Hold&);
Samples points in a list of 3d triangles.
Definition: TriangleSampler.h:39
A single contact between the robot and the environment.
Definition: Hold.h:28
Structures defining the finalized contacts used in stances.
Definition: ContactDistance.h:6