#include <CyberGlove.hpp>
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::Calibration * | DEFAULT_CALIB |
Protected Attributes | |
CyberGlove::Calibration * | calib |
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
glove::devices::CyberGlove::CyberGlove | ( | ) |
The default constructor.
virtual glove::devices::CyberGlove::~CyberGlove | ( | ) | [virtual] |
The desctructor.
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.
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" |
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. |
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.
s | The CyberGlove::Sensor to retrieve the angle from. | |
degree | Indicates if the return values should be converted to degrees or not. |
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.
degree | Indicates if the return values should be converted to degrees or not. |
virtual const std::bitset<24> glove::devices::CyberGlove::getEnabledSensors | ( | ) | [pure virtual] |
Indicates the sensors of the glove device that are currently enabled.
Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.
Equally to toSensorId(.,.), but throws exceptions for not implemented or disabled sensors.
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" |
f | The CyberGlove::Finger to map to. | |
j | The CyberGlove::Finger's CyberGlove::Joint to map to. |
virtual const std::string& glove::devices::CyberGlove::getTypeIdentifier | ( | ) | const [virtual] |
Returns the type identifier for this glove type.
Implements glove::devices::Device.
Reimplemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.
Returns the (raw, not calibrated) sensor value for given pair of CyberGlove::Finger and CyberGlove::Joint.
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" |
f | The CyberGlove::Finger to retrieve the value from. | |
j | The CyberGlove::Finger's CyberGlove::Joint to retrieve the value from. |
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.
s | The CyberGlove::Sensor to retrieve the valuefrom. |
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
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.)
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.
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.
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.
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.
virtual unsigned int glove::devices::CyberGlove::numSensors | ( | ) | [pure virtual] |
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.
c | A pointer to a CyberGlove::Calibration object. |
Returns the sensor id for the given finger/joint pair according to the description given for the getValues() function.
f | The CyberGlove::Finger to map to. | |
j | The CyberGlove::Finger's CyberGlove::Joint to map to. |
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.
Implemented in glove::devices::local::LocalCyberGlove, and glove::devices::remote::RemoteCyberGlove.
CyberGlove::Calibration* glove::devices::CyberGlove::calib [protected] |
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.
const unsigned int glove::devices::CyberGlove::maxNumberOfJointsPerFinger [static] |
The maximal number of joints per finger. This varies according to the type the CyberGlove(R) and the available abduction sensors.
const unsigned int glove::devices::CyberGlove::maxNumberOfSensorValues [static] |
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.