glove::devices::CyberGlove Class Reference

#include <CyberGlove.hpp>

Inheritance diagram for glove::devices::CyberGlove:

glove::devices::Device glove::devices::local::LocalCyberGlove glove::devices::remote::RemoteCyberGlove

List of all members.

Classes

class  Calibration
class  sensor_iterator

Public Types

enum  Finger {
  THUMB = 0, INDEX, MIDDLE, RING,
  PINKY
}
enum  Joint { METACARPAL = 0, PROXIMAL, DISTAL, ABDUCTION }
enum  Sensor {
  THUMB_METACARPAL = 0, THUMB_ROTATION = THUMB_METACARPAL, THUMB_OPPOSE = THUMB_METACARPAL, THUMB_PROXIMAL,
  THUMB_DISTAL, THUMB_ABDUCTION, INDEX_METACARPAL = 4, INDEX_PROXIMAL,
  INDEX_DISTAL, INDEX_ABDUCTION, MIDDLE_METACARPAL = 8, MIDDLE_PROXIMAL,
  MIDDLE_DISTAL, MIDDLE_ABDUCTION, RING_METACARPAL = 12, RING_PROXIMAL,
  RING_DISTAL, RING_ABDUCTION, PINKY_METACARPAL = 16, PINKY_PROXIMAL,
  PINKY_DISTAL, PINKY_ABDUCTION, PALM_ARCH = 20, WRIST_PITCH,
  WRIST_YAW
}

Public Member Functions

 CyberGlove ()
virtual ~CyberGlove ()
virtual const std::bitset< 24 > getEnabledSensors ()=0
virtual unsigned int numSensors ()=0
virtual bool isTipless ()
virtual bool isRightHanded ()=0
virtual bool isLeftHanded ()=0
virtual bool isStreaming ()=0
virtual void setCalibration (CyberGlove::Calibration *c)
virtual const std::vector< double > getValues ()=0
virtual double getValue (const Sensor s)=0
virtual double getValue (const Finger f, const Joint j)
virtual const std::vector< double > getAngles (const bool degree=false)
virtual double getAngle (const Sensor s, const bool degree=false)
virtual double getAngle (const Finger f, const Joint j, const bool degree=false)
virtual Sensor getSensorId (const Finger f, const Joint j)
virtual std::string info ()=0
virtual std::pair< int, int > version ()=0
virtual const std::string & getTypeIdentifier () const

Static Public Member Functions

static Sensor toSensorId (const Finger f, const Joint j)
static std::string toString (const Finger f, const Joint j)

Static Public Attributes

static const unsigned int numFingers
static const unsigned int maxNumberOfJointsPerFinger
static const unsigned int maxNumberOfSensorValues
static const unsigned int sensorRecordSize
static const std::string DEVICE_ID
static CyberGlove::CalibrationDEFAULT_CALIB

Protected Attributes

CyberGlove::Calibrationcalib


Detailed Description

This class implements an abstraction a CyberGlove(R) device by CyberGlove Systems, LLC.

Author:
Christian Wressnegger
Date:
2009-2010

Member Enumeration Documentation

Constants for the individual fingers of the CyberGlove(R)

Constants for the individual joints of the CyberGlove(R)

Constants for the sensor values provided by the CyberGlove(R) device. See getValues() function for more details on the structure of sensor records return ed by this object


Constructor & Destructor Documentation

glove::devices::CyberGlove::CyberGlove (  ) 

The default constructor.

virtual glove::devices::CyberGlove::~CyberGlove (  )  [virtual]

The desctructor.


Member Function Documentation

virtual double glove::devices::CyberGlove::getAngle ( const Finger  f,
const Joint  j,
const bool  degree = false 
) [virtual]

Returns the sensor value for given pair of CyberGlove::Finger and CyberGlove::Joint as radiant. These values are already calibrated.

Exceptions:
std::invalid_argument If the given CyberGlove::Finger/ CyberGlove::Joint pair is not available in this instance of the CyberGlove. See the documentation of the getValues() function for details on the sensor configuration. "Available" refers to "not implemented" or "disabled"
Parameters:
f The CyberGlove::Finger to retrieve the angle from.
j The CyberGlove::Finger's CyberGlove::Joint to retrieve the angle from.
degree Indicates if the return values should be converted to degrees or not.
Returns:
The sensor value for given pair of CyberGlove::Finger and CyberGlove::Joint.

virtual double glove::devices::CyberGlove::getAngle ( const Sensor  s,
const bool  degree = false 
) [virtual]

Returns the measured value for the sensor with the given identifier as radiant. These values are already calibrated.

Parameters:
s The CyberGlove::Sensor to retrieve the angle from.
degree Indicates if the return values should be converted to degrees or not.
Returns:
The measured value for the sensor with the given identifier.

virtual const std::vector<double> glove::devices::CyberGlove::getAngles ( const bool  degree = false  )  [virtual]

Returns the currently measured sensor values of this CyberGlove instance as radiant. These values are already calibrated. The order of the values is as described in the documentation of the getValues() function.

Parameters:
degree Indicates if the return values should be converted to degrees or not.
Returns:
An vector containing all calibrated sensor values. Not implemented sensors always return 0.0

virtual const std::bitset<24> glove::devices::CyberGlove::getEnabledSensors (  )  [pure virtual]

Indicates the sensors of the glove device that are currently enabled.

Returns:
A std::bitset that contains 1s for enabled and 0s for disabled sensors. The order of the sensors is as described in the documentation for the getValues() function.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual Sensor glove::devices::CyberGlove::getSensorId ( const Finger  f,
const Joint  j 
) [virtual]

Equally to toSensorId(.,.), but throws exceptions for not implemented or disabled sensors.

Exceptions:
std::invalid_argument If the given CyberGlove::Finger/ CyberGlove::Joint pair is not available in this instance of the CyberGlove. See the documentation of the getValues() function for details on the sensor configuration. "Available" refers to "not implemented" or "disabled"
Parameters:
f The CyberGlove::Finger to map to.
j The CyberGlove::Finger's CyberGlove::Joint to map to.
Returns:
The sensor identifier.

virtual const std::string& glove::devices::CyberGlove::getTypeIdentifier (  )  const [virtual]

Returns the type identifier for this glove type.

Returns:
The type identifier for this glove type.

Implements glove::devices::Device.

Reimplemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual double glove::devices::CyberGlove::getValue ( const Finger  f,
const Joint  j 
) [virtual]

Returns the (raw, not calibrated) sensor value for given pair of CyberGlove::Finger and CyberGlove::Joint.

Exceptions:
std::invalid_argument If the given CyberGlove::Finger/ CyberGlove::Joint pair is not available in this instance of the CyberGlove. See the documentation of the getValues() function for details on the sensor configuration. "Available" refers to "not implemented" or "disabled"
Parameters:
f The CyberGlove::Finger to retrieve the value from.
j The CyberGlove::Finger's CyberGlove::Joint to retrieve the value from.
Returns:
The (raw, not calibrated) sensor value for given pair of CyberGlove::Finger and CyberGlove::Joint.

virtual double glove::devices::CyberGlove::getValue ( const Sensor  s  )  [pure virtual]

Returns the measured (raw, not calibrated) value for the sensor with the given identifier.

Parameters:
s The CyberGlove::Sensor to retrieve the valuefrom.
Returns:
The measured (raw, not calibrated) value for the sensor with the given identifier.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual const std::vector<double> glove::devices::CyberGlove::getValues (  )  [pure virtual]

Returns the currently measured (raw, not calibrated) sensor values of this CyberGlove instance. The order of the values is as follows:

0-19: f * CyberGlove::maxNumberOfJointsPerFinger + j 20: Palm arch 21: Wrist pitch 22: Wrist yaw

whereas 7 (index-abduction) isn't implemented at all and 6, 10, 14, 18 are only available for the 22-sensor CyberGlove

Returns:
An vector containing all sensor values. Not implemented sensors always return 0.0

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual std::string glove::devices::CyberGlove::info (  )  [pure virtual]

Returns the info string containing details on this glove (type, version, company, etc.)

Returns:
The info string containing details on this glove.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual bool glove::devices::CyberGlove::isLeftHanded (  )  [pure virtual]

Indicates if this glove is left handed.

Returns:
A boolean value that indicates if this glove is left handed.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual bool glove::devices::CyberGlove::isRightHanded (  )  [pure virtual]

Indicates if this glove is right handed.

Returns:
A boolean value that indicates if this glove is right handed.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual bool glove::devices::CyberGlove::isStreaming (  )  [pure virtual]

Indicates whether the Device is streaming or not.

Returns:
A boolean value that indicates whether the Device is streaming or not.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual bool glove::devices::CyberGlove::isTipless (  )  [virtual]

Indicates whether the connected glove has 18 (not measuring the finger tips) or 22 sensors.

Returns:
A boolean value that indicates whether the this instance of the glove has 18 or 22 sensors

virtual unsigned int glove::devices::CyberGlove::numSensors (  )  [pure virtual]

Returns the number of sensors that are available for the connected device.

Returns:
The number of sensors that are available for the connected device.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.

virtual void glove::devices::CyberGlove::setCalibration ( CyberGlove::Calibration c  )  [virtual]

Set the calibration to be used with this glove.
Attention! This class takes care of/ deletes the passed calibration object.

Parameters:
c A pointer to a CyberGlove::Calibration object.

static Sensor glove::devices::CyberGlove::toSensorId ( const Finger  f,
const Joint  j 
) [static]

Returns the sensor id for the given finger/joint pair according to the description given for the getValues() function.

Parameters:
f The CyberGlove::Finger to map to.
j The CyberGlove::Finger's CyberGlove::Joint to map to.
Returns:
The sensor identifier.

static std::string glove::devices::CyberGlove::toString ( const Finger  f,
const Joint  j 
) [static]

Returns a human readable description of this object.

Returns:
A human readable description of this object.

virtual std::pair<int, int> glove::devices::CyberGlove::version (  )  [pure virtual]

Returns the version of this glove as pair of major and minor version.

Returns:
The version of this device.

Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.


Member Data Documentation

The CyberGlove::Calibration object used by this instance of the CyberGlove.

The default calibration type of CyberGlove objects.

const std::string glove::devices::CyberGlove::DEVICE_ID [static]

The identifier of CyberGlove(R) devices as represented by this class.

The maximal number of joints per finger. This varies according to the type the CyberGlove(R) and the available abduction sensors.

The number of sensor values.

const unsigned int glove::devices::CyberGlove::numFingers [static]

The number of finger of the CyberGlove(R)

const unsigned int glove::devices::CyberGlove::sensorRecordSize [static]

The number of fields in the sensor record. Due to reserved values this size differens from the maximal available sensors.


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

Generated on Thu Feb 4 12:36:53 2010 for libglove by  doxygen 1.5.8