RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
GraspTable Class Reference

A table of grasp configurations that has been generated using a robot hand, a number of preshapes, and some grasp policy. More...

#include <GraspTable.hpp>

Classes

struct  GraspData
 data for describing a single grasp More...
 

Public Types

typedef rw::core::Ptr< GraspTablePtr
 

Public Member Functions

 GraspTable (const std::string &handName, const std::string &objectId)
 constructor More...
 
virtual ~GraspTable ()
 destructor
 
int getCalibForceIndex ()
 gets the index of the calibration force if its used. The calibration force is stored in the 'quality' list in the GraspData objects. More...
 
void setCalibForceIndex (int idx)
 set the index of the calibration force More...
 
void addGrasp (GraspData &data)
 add a grasp to this GraspTable More...
 
size_t size ()
 get the nr of grasps in this GraspTable More...
 
std::vector< GraspData > & getData ()
 get all grasp data More...
 
const std::string & getHandName ()
 get name of hand More...
 
const std::string & getObjectName ()
 get name of object More...
 
int nrTactileArrayGrasp ()
 get the number of tactile arrays on this hand More...
 
std::pair< int, int > getTactileArrayDim (int i)
 get the dimensions of the i'th tactile array More...
 
bool hasCalibForce ()
 check if this table has calib force data More...
 
void save (const std::string &filename)
 save this grasp table to file filename More...
 

Static Public Member Functions

static rw::core::Ptr< GraspTableload (const std::string &filename)
 load a grasp table from file More...
 

Static Public Attributes

static const unsigned int GTABLE_VERSION = 0x00001
 this version increase each time the file format is changed
 

Detailed Description

A table of grasp configurations that has been generated using a robot hand, a number of preshapes, and some grasp policy.

Constructor & Destructor Documentation

◆ GraspTable()

GraspTable ( const std::string &  handName,
const std::string &  objectId 
)

constructor

Parameters
handName[in] name of robot hand
objectId[in] name of object that is being grasped

Member Function Documentation

◆ addGrasp()

void addGrasp ( GraspData data)

add a grasp to this GraspTable

Parameters
data[in] Grasp data

◆ getCalibForceIndex()

int getCalibForceIndex ( )

gets the index of the calibration force if its used. The calibration force is stored in the 'quality' list in the GraspData objects.

Returns
index of calibration force if used, -1 otherwise

◆ getData()

std::vector<GraspData>& getData ( )
inline

get all grasp data

Returns
vector of grasps

◆ getHandName()

const std::string& getHandName ( )
inline

get name of hand

Returns
name of hand

◆ getObjectName()

const std::string& getObjectName ( )
inline

get name of object

Returns
name of object

◆ getTactileArrayDim()

std::pair<int, int> getTactileArrayDim ( int  i)

get the dimensions of the i'th tactile array

Parameters
i[in] the tactile array id
Returns

◆ hasCalibForce()

bool hasCalibForce ( )

check if this table has calib force data

Returns
true if this table has calib force data (equal to getCalibForceIndex()>=0), false otherwise

◆ load()

static rw::core::Ptr<GraspTable> load ( const std::string &  filename)
static

load a grasp table from file

Parameters
filename[in] name of file
Returns
GraspTable

◆ nrTactileArrayGrasp()

int nrTactileArrayGrasp ( )

get the number of tactile arrays on this hand

Returns

◆ save()

void save ( const std::string &  filename)

save this grasp table to file filename

Parameters
filename[in] name of file

◆ setCalibForceIndex()

void setCalibForceIndex ( int  idx)
inline

set the index of the calibration force

Parameters
idx[in] calibration force index

◆ size()

size_t size ( )
inline

get the nr of grasps in this GraspTable

Returns
nr of grasps in this GraspTable

The documentation for this class was generated from the following file: