Simox  2.3.74.0
GraspStudio::GraspQualityMeasureWrenchSpace Class Reference

An efficient implementation of the grasp wrench space algorithm for grasp quality evaluation. More...

Inheritance diagram for GraspStudio::GraspQualityMeasureWrenchSpace:
GraspStudio::GraspQualityMeasure VirtualRobot::BasicGraspQualityMeasure

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW GraspQualityMeasureWrenchSpace (VirtualRobot::SceneObjectPtr object, float unitForce=1.0f, float frictionConeCoeff=0.35f, int frictionConeSamples=8)
 
 ~GraspQualityMeasureWrenchSpace () override
 
virtual void preCalculatedOWS (float minDist, float volume)
 
float getGraspQuality () override
 
virtual float getVolumeGraspMeasure ()
 
bool isGraspForceClosure () override
 Indicate whether the grasp is in force closure. More...
 
virtual VirtualRobot::MathTools::ConvexHull6DPtr getConvexHullOWS ()
 
virtual VirtualRobot::MathTools::ConvexHull6DPtr getConvexHullGWS ()
 
void calculateOWS (int samplePoints=300)
 
void calculateGWS ()
 
bool OWSExists ()
 
bool GWSExists ()
 
VirtualRobot::MathTools::ContactPoint getCenterGWS ()
 
VirtualRobot::MathTools::ContactPoint getCenterOWS ()
 
void setContactPoints (const std::vector< VirtualRobot::MathTools::ContactPoint > &contactPoints) override
 
void setContactPoints (const VirtualRobot::EndEffector::ContactInfoVector &contactPoints) override
 
bool calculateGraspQuality () override
 Compute the grasp quality for the given contact points. More...
 
bool calculateObjectProperties () override
 This method is used to compute a reference value that describes a perfect grasp. More...
 
std::string getName () override
 Returns description of this object. More...
 
virtual float getOWSMinOffset ()
 
virtual float getOWSVolume ()
 
- Public Member Functions inherited from GraspStudio::GraspQualityMeasure
EIGEN_MAKE_ALIGNED_OPERATOR_NEW GraspQualityMeasure (VirtualRobot::SceneObjectPtr object, float unitForce=1.0f, float frictionConeCoeff=0.35f, int frictionConeSamples=8)
 Constructor. More...
 
virtual ~GraspQualityMeasure () override
 Destructor. More...
 
virtual VirtualRobot::MathTools::ContactPoint getSampledObjectPointsCenter ()
 
bool isValid () override
 
virtual ContactConeGeneratorPtr getConeGenerator ()
 
- Public Member Functions inherited from VirtualRobot::BasicGraspQualityMeasure
EIGEN_MAKE_ALIGNED_OPERATOR_NEW BasicGraspQualityMeasure (VirtualRobot::SceneObjectPtr object)
 
virtual ~BasicGraspQualityMeasure ()
 Destructor. More...
 
virtual Eigen::Vector3f getCoM ()
 
virtual VirtualRobot::MathTools::ContactPoint getContactPointsCenter ()
 
virtual void setVerbose (bool enable)
 
VirtualRobot::SceneObjectPtr getObject ()
 

Static Public Member Functions

static std::vector< VirtualRobot::MathTools::ContactPointcreateWrenchPoints (std::vector< VirtualRobot::MathTools::ContactPoint > &points, const Eigen::Vector3f &centerOfModel, float objectLengthMM)
 
static float minOffset (VirtualRobot::MathTools::ConvexHull6DPtr ch)
 Goes through all facets of convex hull and searches the minimum distance to it's center. More...
 

Protected Member Functions

VirtualRobot::MathTools::ConvexHull6DPtr calculateConvexHull (std::vector< VirtualRobot::MathTools::ContactPoint > &points)
 
VirtualRobot::MathTools::ContactPoint calculateHullCenter (VirtualRobot::MathTools::ConvexHull6DPtr hull)
 
float minDistanceToGWSHull (VirtualRobot::MathTools::ContactPoint &point)
 
bool isOriginInGWSHull ()
 
void printContacts (std::vector< VirtualRobot::MathTools::ContactPoint > &points)
 
- Protected Member Functions inherited from GraspStudio::GraspQualityMeasure
bool sampleObjectPoints (int nMaxFaces=400)
 

Static Protected Member Functions

static Eigen::Vector3f crossProductPosNormalInv (const VirtualRobot::MathTools::ContactPoint &v1)
 

Protected Attributes

bool OWSCalculated
 
bool GWSCalculated
 
VirtualRobot::MathTools::ConvexHull6DPtr convexHullOWS
 
VirtualRobot::MathTools::ConvexHull6DPtr convexHullGWS
 
VirtualRobot::MathTools::ContactPoint convexHullCenterGWS
 
VirtualRobot::MathTools::ContactPoint convexHullCenterOWS
 
float minOffsetOWS
 
float volumeOWS
 
- Protected Attributes inherited from GraspStudio::GraspQualityMeasure
float unitForce
 
float frictionCoeff
 
int frictionConeSamples
 
ContactConeGeneratorPtr coneGenerator
 
std::vector< VirtualRobot::MathTools::ContactPointsampledObjectPoints
 
std::vector< VirtualRobot::MathTools::ContactPointsampledObjectPointsM
 
- Protected Attributes inherited from VirtualRobot::BasicGraspQualityMeasure
Eigen::Vector3f centerOfModel
 
float objectLength
 
float graspQuality
 
int maxContacts
 
VirtualRobot::SceneObjectPtr object
 
std::vector< VirtualRobot::MathTools::ContactPointcontactPoints
 
std::vector< VirtualRobot::MathTools::ContactPointcontactPointsM
 
bool verbose
 

Detailed Description

An efficient implementation of the grasp wrench space algorithm for grasp quality evaluation.

the grasp wrench space algorithm is widely used in the context of grasp planning. By analyzing the grasp wrench space (GWS) of a given set of contact points, a quality score of a grasp can be evaluated. In this implementation, additionally an object specific wrench space (WS) is calculated, which approximatevly represents a "perfect" grasp. This object is used to normalize the quality score.

Constructor & Destructor Documentation

◆ GraspQualityMeasureWrenchSpace()

GraspStudio::GraspQualityMeasureWrenchSpace::GraspQualityMeasureWrenchSpace ( VirtualRobot::SceneObjectPtr  object,
float  unitForce = 1.0f,
float  frictionConeCoeff = 0.35f,
int  frictionConeSamples = 8 
)

◆ ~GraspQualityMeasureWrenchSpace()

GraspStudio::GraspQualityMeasureWrenchSpace::~GraspQualityMeasureWrenchSpace ( )
overridedefault

Member Function Documentation

◆ calculateConvexHull()

VirtualRobot::MathTools::ConvexHull6DPtr GraspStudio::GraspQualityMeasureWrenchSpace::calculateConvexHull ( std::vector< VirtualRobot::MathTools::ContactPoint > &  points)
protected

◆ calculateGraspQuality()

bool GraspStudio::GraspQualityMeasureWrenchSpace::calculateGraspQuality ( )
overridevirtual

Compute the grasp quality for the given contact points.

Reimplemented from VirtualRobot::BasicGraspQualityMeasure.

◆ calculateGWS()

void GraspStudio::GraspQualityMeasureWrenchSpace::calculateGWS ( )

◆ calculateHullCenter()

VirtualRobot::MathTools::ContactPoint GraspStudio::GraspQualityMeasureWrenchSpace::calculateHullCenter ( VirtualRobot::MathTools::ConvexHull6DPtr  hull)
protected

◆ calculateObjectProperties()

bool GraspStudio::GraspQualityMeasureWrenchSpace::calculateObjectProperties ( )
overridevirtual

This method is used to compute a reference value that describes a perfect grasp.

Implements GraspStudio::GraspQualityMeasure.

◆ calculateOWS()

void GraspStudio::GraspQualityMeasureWrenchSpace::calculateOWS ( int  samplePoints = 300)

◆ createWrenchPoints()

std::vector< VirtualRobot::MathTools::ContactPoint > GraspStudio::GraspQualityMeasureWrenchSpace::createWrenchPoints ( std::vector< VirtualRobot::MathTools::ContactPoint > &  points,
const Eigen::Vector3f &  centerOfModel,
float  objectLengthMM 
)
static

◆ crossProductPosNormalInv()

Eigen::Vector3f GraspStudio::GraspQualityMeasureWrenchSpace::crossProductPosNormalInv ( const VirtualRobot::MathTools::ContactPoint v1)
staticprotected

◆ getCenterGWS()

VirtualRobot::MathTools::ContactPoint GraspStudio::GraspQualityMeasureWrenchSpace::getCenterGWS ( )
inline

◆ getCenterOWS()

VirtualRobot::MathTools::ContactPoint GraspStudio::GraspQualityMeasureWrenchSpace::getCenterOWS ( )
inline

◆ getConvexHullGWS()

virtual VirtualRobot::MathTools::ConvexHull6DPtr GraspStudio::GraspQualityMeasureWrenchSpace::getConvexHullGWS ( )
inlinevirtual

◆ getConvexHullOWS()

virtual VirtualRobot::MathTools::ConvexHull6DPtr GraspStudio::GraspQualityMeasureWrenchSpace::getConvexHullOWS ( )
inlinevirtual

◆ getGraspQuality()

float GraspStudio::GraspQualityMeasureWrenchSpace::getGraspQuality ( )
overridevirtual

Returns f_max_gws / f_max_OWS with f_max_gws = max distance of GWS hull center to one of its facets with f_max_ows = max distance of OWS hull center to one of its facets -> also known as "epsilon" quality == radius of larges enclosing 6D ball

Reimplemented from VirtualRobot::BasicGraspQualityMeasure.

◆ getName()

std::string GraspStudio::GraspQualityMeasureWrenchSpace::getName ( )
overridevirtual

Returns description of this object.

Reimplemented from GraspStudio::GraspQualityMeasure.

◆ getOWSMinOffset()

virtual float GraspStudio::GraspQualityMeasureWrenchSpace::getOWSMinOffset ( )
inlinevirtual

◆ getOWSVolume()

virtual float GraspStudio::GraspQualityMeasureWrenchSpace::getOWSVolume ( )
inlinevirtual

◆ getVolumeGraspMeasure()

float GraspStudio::GraspQualityMeasureWrenchSpace::getVolumeGraspMeasure ( )
virtual

Volume grasp quality ratio of GWS volume / OWS volume -> also known as "v" quality

◆ GWSExists()

bool GraspStudio::GraspQualityMeasureWrenchSpace::GWSExists ( )
inline

◆ isGraspForceClosure()

bool GraspStudio::GraspQualityMeasureWrenchSpace::isGraspForceClosure ( )
overridevirtual

Indicate whether the grasp is in force closure.

Implements GraspStudio::GraspQualityMeasure.

◆ isOriginInGWSHull()

bool GraspStudio::GraspQualityMeasureWrenchSpace::isOriginInGWSHull ( )
protected

◆ minDistanceToGWSHull()

float GraspStudio::GraspQualityMeasureWrenchSpace::minDistanceToGWSHull ( VirtualRobot::MathTools::ContactPoint point)
protected

◆ minOffset()

float GraspStudio::GraspQualityMeasureWrenchSpace::minOffset ( VirtualRobot::MathTools::ConvexHull6DPtr  ch)
static

Goes through all facets of convex hull and searches the minimum distance to it's center.

◆ OWSExists()

bool GraspStudio::GraspQualityMeasureWrenchSpace::OWSExists ( )
inline

◆ preCalculatedOWS()

void GraspStudio::GraspQualityMeasureWrenchSpace::preCalculatedOWS ( float  minDist,
float  volume 
)
virtual

The OWS should not change for an object, so if you have the data calculated once, you can set them here (The values for the OWS can change slightly, since the facets used for generation of the OWS are sampled randomly, in case there are more than 400 of them)

◆ printContacts()

void GraspStudio::GraspQualityMeasureWrenchSpace::printContacts ( std::vector< VirtualRobot::MathTools::ContactPoint > &  points)
protected

◆ setContactPoints() [1/2]

void GraspStudio::GraspQualityMeasureWrenchSpace::setContactPoints ( const std::vector< VirtualRobot::MathTools::ContactPoint > &  contactPoints)
overridevirtual

setup contact information the contact points are normalized by subtracting the COM the contact normals are normalize to unit length

Reimplemented from VirtualRobot::BasicGraspQualityMeasure.

◆ setContactPoints() [2/2]

void GraspStudio::GraspQualityMeasureWrenchSpace::setContactPoints ( const VirtualRobot::EndEffector::ContactInfoVector contactPoints)
overridevirtual

setup contact information the contact points are normalized by subtracting the COM the contact normals are normalize to unit length

Reimplemented from VirtualRobot::BasicGraspQualityMeasure.

Field Documentation

◆ convexHullCenterGWS

VirtualRobot::MathTools::ContactPoint GraspStudio::GraspQualityMeasureWrenchSpace::convexHullCenterGWS
protected

◆ convexHullCenterOWS

VirtualRobot::MathTools::ContactPoint GraspStudio::GraspQualityMeasureWrenchSpace::convexHullCenterOWS
protected

◆ convexHullGWS

VirtualRobot::MathTools::ConvexHull6DPtr GraspStudio::GraspQualityMeasureWrenchSpace::convexHullGWS
protected

◆ convexHullOWS

VirtualRobot::MathTools::ConvexHull6DPtr GraspStudio::GraspQualityMeasureWrenchSpace::convexHullOWS
protected

◆ GWSCalculated

bool GraspStudio::GraspQualityMeasureWrenchSpace::GWSCalculated
protected

◆ minOffsetOWS

float GraspStudio::GraspQualityMeasureWrenchSpace::minOffsetOWS
protected

◆ OWSCalculated

bool GraspStudio::GraspQualityMeasureWrenchSpace::OWSCalculated
protected

◆ volumeOWS

float GraspStudio::GraspQualityMeasureWrenchSpace::volumeOWS
protected