libmove3d  3.13.0
Public Member Functions | Public Attributes
gpContact Class Reference

#include <gpContact.h>

List of all members.

Public Member Functions

 gpContact ()
 Default constructor of the class gpContact.
 gpContact (const gpContact &contact)
gpContactoperator= (const gpContact &contact)
 Copy operator of the class gpContact.
int draw (double cone_length, int cone_nb_slices=10)
int computeBarycentricCoordinates ()
int computeCurvature ()
double distanceToSharpEdge (double angleThreshold)

Public Attributes

unsigned int ID
p3d_polyhedre * surface
unsigned int face
unsigned int fingerID
p3d_vector3 position
p3d_vector3 normal
p3d_vector3 forceDirection
double mu
p3d_vector3 baryCoords
double curvature
double score

Detailed Description

This class is used to describe the characteristics of the contact points of a grasp. It is also used to describe the contact points of an object pose (class gpPose).


Member Function Documentation

int gpContact::computeBarycentricCoordinates ( )

Computes the barycentric coordinates of the contact. The barycentric coordinates are defined by the vertices of the triangle the contact belongs to. If the triangle points are p1, p2 and p3 and the contact is p, we have: p= a1*p1 + a2* p2 + a3*p3;

Returns:
GP_OK in case of success, GP_ERROR otherwise
int gpContact::computeCurvature ( )

Computes the curvature at the contact. The computation is based on the barycentric coordinates of the contact and the curvature at the mesh vertices (computed outside Move3D).

Returns:
GP_OK in case of success, GP_ERROR otherwise
double gpContact::distanceToSharpEdge ( double  angleThreshold)

Computes the distance from the contact to a sharp edge. The function considers the edges of the face the contact is on. If one of the edge is not too "flat", the distance from the contact to the edge is computed and returned

Parameters:
angleThresholdthe edge angle (in radians) above which an edge is regarded as not flat
Returns:
the distance to the closest sharp edge, P3D_HUGE if there is no such edge or in case of error
int gpContact::draw ( double  length,
int  nb_slices = 10 
)

Draws a contact (position and friction cone).

Parameters:
lengthlenght of the friction cone to draw
nb_slicesnumber of segments of the cone discretization
Returns:
GP_OK in case of success, GP_ERROR otherwise

Member Data Documentation

p3d_vector3 gpContact::baryCoords

barycentric coordinates (defined by the vertices of the triangle) of the contact

curvature of the object surface at the contact point

unsigned int gpContact::face

index of the face (that must be a triangle), in the structure p3d_polyhedre, where the contact is located (starts from 0)

unsigned int gpContact::fingerID

ID (starting from 1) of the finger that realizes the contact (finger 1, finger 2, etc.)

direction of the force exerted by the finger

unsigned int gpContact::ID

ID of the contact

double gpContact::mu

friction coefficient of the contact

p3d_vector3 gpContact::normal

surface normal at the contact point (directed outside the object)

p3d_vector3 gpContact::position

contact position given in the object's frame

a score that can be used for any ordering need

p3d_polyhedre* gpContact::surface

surface (object) of the contact


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines