3Gear Systems SDK  v0.9.34
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | List of all members
HandTrackingClient::PoseMessage Class Reference

#include <HandTrackingMessage.h>

Inheritance diagram for HandTrackingClient::PoseMessage:
HandTrackingClient::BasicMessage HandTrackingClient::HandTrackingMessage

Public Types

enum  HandPose {
  HAND_CURLED = 0, HAND_ELL = 1, HAND_OKAY = 2, HAND_PINCH = 3,
  HAND_POINTING = 4, HAND_RELAXEDOPEN = 5, HAND_SPREAD = 6
}
 

Public Member Functions

 PoseMessage (const Vector3f &positionLeft, const Quaternionf &rotationLeft, const int clickCountLeft, const Vector3f &positionRight, const Quaternionf &rotationRight, const int clickCountRight, const std::array< float, N_HANDS > &confidenceEstimates, const std::array< std::array< Quaternionf, N_JOINTS >, N_HANDS > &jointRotations, const std::array< std::array< Vector3f, N_JOINTS >, N_HANDS > &jointTranslations, const std::array< std::array< float, N_FINGER_DOFS_PER_HAND >, N_HANDS > &fingerDOFs, const std::array< std::array< Vector3f, N_FINGERS >, N_HANDS > &fingerTips, const std::array< std::array< float, N_POSES >, N_HANDS > &handPoseConfidences)
 Constructs a PoseMessage. Should not generally be called by users of the API.
 
std::string serialize () const
 
float getConfidenceEstimate (size_t hand) const
 How confident we are about the pose. More...
 
std::array< Matrix4f, N_JOINTS > getJointFrames (size_t hand) const
 
std::array< Transformf, N_JOINTS > getJointTransforms (size_t hand) const
 
const std::array< float,
N_FINGER_DOFS_PER_HAND > & 
getFingerDOFs (size_t hand) const
 Joint angles for the fingers. More...
 
const std::array< Vector3f,
N_FINGERS > & 
getFingerTips (size_t hand) const
 The points at the end of each of the fingers.
 
const std::array< float,
N_POSES > & 
getHandPoseConfidences (size_t hand) const
 Experimental function that returns how confident we are that the hand is in a given pose. More...
 
- Public Member Functions inherited from HandTrackingClient::BasicMessage
MessageType getType () const
 
const HandStategetHandState (int hand) const
 Returns the overall general hand state, excluding fingers. More...
 
 BasicMessage (const MessageType type, const Vector3f &positionLeft, const Quaternionf &rotationLeft, const int clickCountLeft, const Vector3f &positionRight, const Quaternionf &rotationRight, const int clickCountRight)
 Constructs a BasicMessage. Should not generally be called by users of the API.
 

Additional Inherited Members

- Static Public Member Functions inherited from HandTrackingClient::HandTrackingMessage
static const char * messageTypeToString (MessageType m)
 Convert from a MessageType to its string representation; used for serialization.
 
static MessageType stringToMessageType (const std::string &str)
 Convert from a string to a MessageType; used in deserialization.
 
static HandTrackingMessagedeserialize (const std::string &data)
 Given a line of text sent over the network connection, converts it to a valid hand message. More...
 
- Protected Member Functions inherited from HandTrackingClient::HandTrackingMessage
 HandTrackingMessage ()
 

Detailed Description

Messages giving the full hand pose (all joint angles)

Member Enumeration Documentation

An enum distinguishing between the seven current pose types that are recognized by the hand tracking.

Enumerator
HAND_CURLED 

The hand curled up, ready to pinch.

HAND_ELL 

The sign language "L" shape.

HAND_OKAY 

The "okay" symbol; thumb and index touching and other three fingers spread.

HAND_PINCH 

Thumb and forefinger touching.

HAND_POINTING 

Index finger point.

HAND_RELAXEDOPEN 

What we consider a "neutral" pose, with fingers slightly curled.

HAND_SPREAD 

All five fingers spread.

Member Function Documentation

float HandTrackingClient::PoseMessage::getConfidenceEstimate ( size_t  hand) const
inline

How confident we are about the pose.

This is a value between 0 and 1. Currently only values of zero (0) and one (1) are ever returned, but we expect this to change in future versions.

const std::array<float, N_FINGER_DOFS_PER_HAND>& HandTrackingClient::PoseMessage::getFingerDOFs ( size_t  hand) const
inline

Joint angles for the fingers.

These are the actual joint angles for each finger, which can be used to determine which fingers are bent for gesture recognition. Index this using the FingerDOF enum.

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

const std::array<float, N_POSES>& HandTrackingClient::PoseMessage::getHandPoseConfidences ( size_t  hand) const
inline

Experimental function that returns how confident we are that the hand is in a given pose.

Returns the confidence score for each pose. Each confidence score is a value between 0 and 1 and they sum to 1. Please use the the PoseMessage::HandPose enum to index into the array.

std::array< Matrix4f, N_JOINTS > HandTrackingClient::PoseMessage::getJointFrames ( size_t  hand) const

The joint frames of all the bones (as Matrix4); used for skinning.

These should be indexed using the JointFrameIndex enum.

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

std::array< Transformf, N_JOINTS > HandTrackingClient::PoseMessage::getJointTransforms ( size_t  hand) const

The joint frames of all the bones (as Transform); used for skinning.

These should be indexed using the JointFrameIndex enum.

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

std::string HandTrackingClient::PoseMessage::serialize ( ) const
virtual

Serializes the message to a string, which could then be output over the network.

Reimplemented from HandTrackingClient::BasicMessage.


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