3Gear Systems SDK  v0.9.34
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Classes | Typedefs | Enumerations | Functions | Variables
HandTrackingClient Namespace Reference

Classes

class  HandState
 Structure holding the position, rotational frame and other information relevant to the state of the hand. More...
 
class  ParseException
 Exception thrown when parsing a message fails. More...
 
class  HandTrackingMessage
 
class  BasicMessage
 
class  PinchMessage
 Messages relating to pressing, releasing, dragging and moving of each hand. More...
 
class  BimanualPinchMessage
 Messages relating to simultaneous or individual pinching. More...
 
class  PointMessage
 
class  PoseMessage
 
class  WelcomeMessage
 
class  UserMessage
 Message that exposes the user name and skinning information for the user's calibrated hands. More...
 
class  CalibrationMessage
 Message that indicates the progress of calibrating the user's hand scale. More...
 
struct  OpenCVCamera
 A class representing the intrinsic/extrinsic parameters of the depth camera. More...
 
class  Vector3
 A minimal 3-vector class. More...
 
class  Quaternion
 A minimal quaternion class. More...
 
class  Transform
 
class  Matrix4
 

Typedefs

typedef JointFrameIndex JointIndex
 Included for backwards compatibility.
 
typedef Vector3< float > Vector3f
 
typedef Vector3< double > Vector3d
 
typedef Quaternion< float > Quaternionf
 
typedef Quaternion< double > Quaterniond
 
typedef Transform< float > Transformf
 
typedef Transform< double > Transformd
 
typedef Matrix4< float > Matrix4f
 
typedef Matrix4< double > Matrix4d
 

Enumerations

enum  JointFrameIndex {
  ROOT_JOINT = 0, WRIST_JOINT = 1, THUMB_PROXIMAL = 2, THUMB_INTERMEDIATE = 3,
  THUMB_DISTAL = 4, INDEX_PROXIMAL = 5, INDEX_INTERMEDIATE = 6, INDEX_DISTAL = 7,
  MIDDLE_PROXIMAL = 8, MIDDLE_INTERMEDIATE = 9, MIDDLE_DISTAL = 10, RING_PROXIMAL = 11,
  RING_INTERMEDIATE = 12, RING_DISTAL = 13, PINKY_PROXIMAL = 14, PINKY_INTERMEDIATE = 15,
  PINKY_DISTAL = 16
}
 Joint frames used for skinning. More...
 
enum  FingerDOF {
  THUMB_CMC_AA = 0, THUMB_CMC_FE = 1, THUMB_MCP = 2, THUMB_IP = 3,
  INDEX_MCP_AA = 4, INDEX_MCP_FE = 5, INDEX_PIP = 6, MIDDLE_MCP_AA = 7,
  MIDDLE_MCP_FE = 8, MIDDLE_PIP = 9, RING_MCP_AA = 10, RING_MCP_FE = 11,
  RING_PIP = 12, PINKY_MCP_AA = 13, PINKY_MCP_FE = 14, PINKY_PIP = 15
}
 Degrees of freedom of the hand model, as reported by the HandTrackingClient::PoseMessage::getFingerDOFs function. More...
 
enum  Hand { LEFT_HAND = 0, RIGHT_HAND = 1, BOTH_HANDS = 2, INVALID_HAND = 10000 }
 

Functions

std::string lastSocketError ()
 
const char * handToString (Hand hand)
 
Hand stringToHand (const std::string &str)
 
BasicMessageparseBasicMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
WelcomeMessageparseWelcomeMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
UserMessageparseUserMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
CalibrationMessageparseCalibrationMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
PoseMessageparsePoseMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
PinchMessageparsePinchMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
BimanualPinchMessageparseBimanualPinchMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
PointMessageparsePointMessage (TokenStream &stream, HandTrackingMessage::MessageType messageType)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Vector3< T > &rhs)
 Prints a vector to the output stream in the format "v.x v.y v.z".
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Quaternion< T > &rhs)
 Prints a quaternion to the output stream in the format "v.x v.y v.z w".
 
template std::ostream & operator<< (std::ostream &os, const Vector3< float > &rhs)
 
template std::ostream & operator<< (std::ostream &os, const Vector3< double > &rhs)
 
template std::ostream & operator<< (std::ostream &os, const Quaternion< float > &rhs)
 
template std::ostream & operator<< (std::ostream &os, const Quaternion< double > &rhs)
 
template<typename T >
Vector3< T > operator* (const T lhs, const Vector3< T > &rhs)
 Multiplies a vector by a scalar.
 
template<typename T >
Vector3< T > operator* (const Vector3< T > &lhs, const T rhs)
 Multiplies a vector by a scalar.
 
template<typename T >
Vector3< T > operator/ (const Vector3< T > &lhs, const T rhs)
 Divides a vector by a scalar.
 
template<typename T >
Vector3< T > operator+ (const Vector3< T > &lhs, const Vector3< T > &rhs)
 Adds two vectors together.
 
template<typename T >
Vector3< T > operator- (const Vector3< T > &lhs, const Vector3< T > &rhs)
 Subtracts the second vector from the first.
 
template<typename T >
Quaternion< T > operator* (const Quaternion< T > &a, const Quaternion< T > &b)
 Multiplies two quaternions.
 
template<typename T >
Transform< T > operator* (const Transform< T > &lhs, const Transform< T > &rhs)
 
template<typename T >
Vector3< T > operator* (const Transform< T > &lhs, const Vector3< T > &rhs)
 

Variables

const int INVALID_SOCKET = -1
 
const int SOCKET_ERROR = -1
 
const size_t QVGA_WIDTH = 320
 
const size_t QVGA_HEIGHT = 240
 
const double KINECT_FOCAL_LENGTH = 575.815753
 

Detailed Description

The HandTrackingClient has been namespaced to avoid conflicts with other libraries.

Enumeration Type Documentation

Degrees of freedom of the hand model, as reported by the HandTrackingClient::PoseMessage::getFingerDOFs function.

Each of these is a rotation in radians that measures how far the corresponding finger is bent from its rest pose. For flexion/extension joints, positive angles indicate flexion while negative angles indicate extension.

We recommend using these joint angles for detecting gestures of the form "finger X is bending." If you need to know the global position/orientation of the hand, you'll need to use the joint frames returned by HandTrackingClient::PoseMessage::getJointFrames instead.

For more details on the hand model, consult the hand model docs.

Enumerator
THUMB_CMC_AA 

Thumb carpal-metacarpal joint, adduction/abduction.

THUMB_CMC_FE 

Thumb carpal-metacarpal joint, flexion/extension.

THUMB_MCP 

Thumb metacarpal-phalangeal joint, flexion/extension.

THUMB_IP 

Thumb interphalangeal joint, flexion/extension.

INDEX_MCP_AA 

Index finger metacarpal-phalangeal joint, adduction/abduction.

INDEX_MCP_FE 

Index finger metacarpal-phalangeal joint, flexion/extension.

INDEX_PIP 

Index finger proximal interphalangeal joint, flexion/extension.

MIDDLE_MCP_AA 

Middle finger metacarpal-phalangeal joint, adduction/abduction.

MIDDLE_MCP_FE 

Middle finger metacarpal-phalangeal joint, flexion/extension.

MIDDLE_PIP 

Middle finger proximal interphalangeal joint, flexion/extension.

RING_MCP_AA 

Ring finger metacarpal-phalangeal joint, adduction/abduction.

RING_MCP_FE 

Ring finger metacarpal-phalangeal joint, flexion/extension.

RING_PIP 

Ring finger proximal interphalangeal joint, flexion/extension.

PINKY_MCP_AA 

Pinky finger metacarpal-phalangeal joint, adduction/abduction.

PINKY_MCP_FE 

Pinky finger metacarpal-phalangeal joint, flexion/extension.

PINKY_PIP 

Pinky finger proximal interphalangeal joint, flexion/extension.

Most events (like click events) only apply to one hand at a time, but simultaneous click and release events will have the BOTH_HANDS identifier set.

Enumerator
LEFT_HAND 

Message applies only to the left hand.

RIGHT_HAND 

Message applies only to the right hand.

BOTH_HANDS 

Message applies to both hands (e.g. a simultaneous click).

INVALID_HAND 

You should never see this in callback messages; it is used internally when network deserialization fails.

Joint frames used for skinning.

These are the frames returned by PoseMessage::getJointFrames, and used for skinning. We recommend using these if you need to locate points in 3D space or define 3D frames; if you want to recognize gestures of the form "finger X is bending" we recommend using the FingerDOF instead.

The most stable frame is the one defined by the metacarpals (here, the WRIST_JOINT). If you need a 3D frame for something, we recommend using this one.

For more details on the hand model, consult the hand model docs.

Enumerator
ROOT_JOINT 

The frame of the user's forearm (this is where the hand model is rooted).

WRIST_JOINT 

The frame of the back of the hand (anatomically, this is the frame of the carpals).

THUMB_PROXIMAL 

Thumb proximal frame, refers to the thumb metacarpal bone.

THUMB_INTERMEDIATE 

Thumb intermediate frame, refers to the thumb proximal phalange.

THUMB_DISTAL 

Thumb distal frame, refers to the thumb distal phalange.

INDEX_PROXIMAL 

Index finger proximal frame, refers to the proximal phalange.

INDEX_INTERMEDIATE 

Index finger intermediate frame, refers to the intermediate phalange.

INDEX_DISTAL 

Index finger distal frame, refers to the distal phalange.

MIDDLE_PROXIMAL 

Middle finger proximal frame, refers to the proximal phalange.

MIDDLE_INTERMEDIATE 

Middle finger intermediate frame, refers to the intermediate phalange.

MIDDLE_DISTAL 

Middle finger distal frame, refers to the distal phalange.

RING_PROXIMAL 

Ring finger proximal frame, refers to the proximal phalange.

RING_INTERMEDIATE 

Ring finger intermediate frame, refers to the intermediate phalange.

RING_DISTAL 

Ring finger distal frame, refers to the distal phalange.

PINKY_PROXIMAL 

Pinky finger proximal frame, refers to the proximal phalange.

PINKY_INTERMEDIATE 

Pinky finger intermediate frame, refers to the intermediate phalange.

PINKY_DISTAL 

Pinky finger distal frame, refers to the distal phalange.

Function Documentation

const char * HandTrackingClient::handToString ( Hand  hand)

Returns a string representation for the Hand enum. Used for serializing and deserializing from the network.

Hand HandTrackingClient::stringToHand ( const std::string &  str)

Given a string ("left" or "right"), returns the correct Hand. Used for serializing and deserializing from the network.