GWS Class Reference

An abstract base class for 6D grasp wrench spaces. More...

#include <gws.h>

Inheritance diagram for GWS:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual int build (std::vector< int > useDimensions=ALL_DIMENSIONS)=0
GraspgetGrasp () const
int getRefCount ()
virtual const char * getType ()=0
 GWS (Grasp *g)
 Initializes grasp to g. Zeros hyperplanes and refCount.
bool hasPositiveVolume ()
bool isForceClosure ()
virtual int projectTo3D (double *projCoords, std::set< int > fixedCoordSet, std::vector< position > &hullCoords, std::vector< int > &hullIndices)
 Creates a 3D projection of the 6D wrench space.
void ref ()
void setGravity (bool use, vec3 gd=vec3(0, 0, 0))
 Tells is wether to use gravity, and if yes it's direction and magnitude.
void unref ()
virtual ~GWS ()

Static Public Member Functions

static GWScreateInstance (const char *type, Grasp *g)

Public Attributes

bool forceClosure
 If GWS contains the origin, the grasp has force closure.
Graspgrasp
 A pointer to the associated grasp.
double hullArea
 Surface area of 6D hull (returned by qhull).
double hullVolume
 Volume of 6D hull (returned by qhull).
double ** hyperPlanes
 7 x numHyperPlanes matrix of plane coefficients
std::vector< int > mUsedDimensions
 Keeps track of the dimensions used to build this gws.
int numHyperPlanes
 number of 6D hyperplanes bounding this GWS
int refCount
 Number of reference to this GWS. When it is 0, GWS may be deleted.

Static Public Attributes

static const std::vector< int > ALL_DIMENSIONS = std::vector<int>(6, 1)
 Default option for building a GWS on all 6 dimensions.
static const char * TYPE_LIST [] = {"L1 Norm","LInfinity Norm",NULL}
 Array of strings of possible GWS types.

Protected Member Functions

int buildHyperplanesFromWrenches (void *wr, int numWrenches, std::vector< int > useDimensions)
 Calls QHull to build from an array of pre-specified wrenches.
void clearGWS ()
 Deletes the hyperplanes of the currently computed GWS.
void computeHyperplaneMetrics ()
 After the hyperplanes are computed we can look at other metrics.

Protected Attributes

vec3 gravDirection
 The direction and magnitude of gravity along each GWS axis.
bool useGravity
 Consider the effects of gravity on the object.

Detailed Description

An abstract base class for 6D grasp wrench spaces.

Specific grasp wrench spaces should be defined as subclasses of this class.

Definition at line 43 of file gws.h.


Constructor & Destructor Documentation

GWS::GWS ( Grasp g  )  [inline]

Initializes grasp to g. Zeros hyperplanes and refCount.

Definition at line 94 of file gws.h.

GWS::~GWS (  )  [virtual]

Deletes all the GWS hyperplanes.

Definition at line 69 of file gws.cpp.


Member Function Documentation

virtual int GWS::build ( std::vector< int >  useDimensions = ALL_DIMENSIONS  )  [pure virtual]

Builds the GWS from the contact wrenches.

Implemented in L1GWS, and LInfGWS.

int GWS::buildHyperplanesFromWrenches ( void *  wr,
int  numWrenches,
std::vector< int >  useDimensions 
) [protected]

Calls QHull to build from an array of pre-specified wrenches.

Encapsulates the qhull calls to build the convex hull of a set of wrenches. wr is a set of numWrenches wrenches, each of them having dimensions dimensions. The convex hull is computed as the intersection of a number of halfspaces, each defined by a hyperplane. The hyperplanes are computed using qhull and stored internally in the GWS class.

useDimensions tells us which dimensions we use when building the hull. The wrenches themselves are tightly packed, i.e. only contain the values for those dimensions. As far as qhull is concerned, it does not matter which those directions are, only how many of them we have. But we need to know which the dimensions are so we can store that information in the hyperplanes.

Definition at line 445 of file gws.cpp.

void GWS::clearGWS (  )  [protected]

Deletes the hyperplanes of the currently computed GWS.

Definition at line 76 of file gws.cpp.

void GWS::computeHyperplaneMetrics (  )  [protected]

After the hyperplanes are computed we can look at other metrics.

Given a set of hyperplanes that have already been computed and stored internally in hyperPlanes, this will compute the metrics that we care about: for now, the only computation is the min offset of a hyperplane from the origin. The other metric, the volume of the hull, is computed when a quality metric actually asks for it.

This also uses the min offset to tell the grasp to display the min wrench that will break it.

Definition at line 401 of file gws.cpp.

GWS * GWS::createInstance ( const char *  desiredType,
Grasp g 
) [static]

Creates a GWS whose type string matches desiredType.

Definition at line 93 of file gws.cpp.

Grasp* GWS::getGrasp (  )  const [inline]

Returns a pointer to the grasp associated with this GWS

Definition at line 99 of file gws.h.

int GWS::getRefCount (  )  [inline]

Returns the current number of references to this GWS

Definition at line 108 of file gws.h.

virtual const char* GWS::getType (  )  [pure virtual]

Returns a string that is the name of the type of GWS.

Implemented in L1GWS, and LInfGWS.

bool GWS::hasPositiveVolume (  )  [inline]

Returns whether the 6D GWS has non-zero volume.

Definition at line 114 of file gws.h.

bool GWS::isForceClosure (  )  [inline]

Returns whether this grasp has force closure.

Definition at line 111 of file gws.h.

int GWS::projectTo3D ( double *  projCoords,
std::set< int >  fixedCoordSet,
std::vector< position > &  hullCoords,
std::vector< int > &  hullIndices 
) [virtual]

Creates a 3D projection of the 6D wrench space.

Uses the projCoords and fixedCoordSet (which identifies the indices of the fixed coordinates) to project the 6D hyperplanes of the Grasp Wrench Space into 3D. The projCoords is an array of 6 values, but only 3 are used. It then calls qhull to perform a halfspace intersection to get the vertices of the 3D volume. These vertices are stored in hullCoords, and indices of the individual faces that make up the volume are stored in hullIndices (an Indexed Face Set).

Definition at line 114 of file gws.cpp.

void GWS::ref (  )  [inline]

Adds one reference to this GWS

Definition at line 102 of file gws.h.

void GWS::setGravity ( bool  use,
vec3  gd = vec3(0,0,0) 
)

Tells is wether to use gravity, and if yes it's direction and magnitude.

Definition at line 384 of file gws.cpp.

void GWS::unref (  )  [inline]

Removes one reference to this GWS

Definition at line 105 of file gws.h.


Member Data Documentation

const std::vector< int > GWS::ALL_DIMENSIONS = std::vector<int>(6, 1) [static]

Default option for building a GWS on all 6 dimensions.

WARNING: this is replicated in Grasp::ALL_DIMENSIONS

Definition at line 46 of file gws.h.

If GWS contains the origin, the grasp has force closure.

Definition at line 88 of file gws.h.

A pointer to the associated grasp.

Definition at line 70 of file gws.h.

vec3 GWS::gravDirection [protected]

The direction and magnitude of gravity along each GWS axis.

Definition at line 52 of file gws.h.

double GWS::hullArea

Surface area of 6D hull (returned by qhull).

Definition at line 82 of file gws.h.

Volume of 6D hull (returned by qhull).

Definition at line 85 of file gws.h.

double** GWS::hyperPlanes

7 x numHyperPlanes matrix of plane coefficients

Definition at line 76 of file gws.h.

std::vector<int> GWS::mUsedDimensions

Keeps track of the dimensions used to build this gws.

Definition at line 79 of file gws.h.

number of 6D hyperplanes bounding this GWS

Definition at line 73 of file gws.h.

Number of reference to this GWS. When it is 0, GWS may be deleted.

Definition at line 91 of file gws.h.

const char * GWS::TYPE_LIST = {"L1 Norm","LInfinity Norm",NULL} [static]

Array of strings of possible GWS types.

Definition at line 128 of file gws.h.

bool GWS::useGravity [protected]

Consider the effects of gravity on the object.

Definition at line 49 of file gws.h.


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


graspit
Author(s):
autogenerated on Wed Jan 25 11:00:22 2012