Nuitrack  1.11.2
3D Skeleton Tracking Middleware
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
tdv::nuitrack::HandTracker Class Reference

Represents the interface to the capabilities of the Nuitrack Hand Tracker module. More...

#include <HandTracker.h>

Inherits HeaderOnlyAPI_Module.

Public Types

typedef std::shared_ptr
< HandTracker
Ptr
 Smart pointer to access the SkeletonTracker instance. More...
 
typedef std::function< void(HandTrackerData::Ptr)> OnUpdate
 The callback type of the hand data update request. More...
 
typedef void(* OnUpdateRawFunctionPtr )(HandTrackerData *, HandTracker *)
 

Public Member Functions

 HandTracker (NuitrackModule *pimpl)
 
uint64_t connectOnUpdate (const OnUpdate &callback)
 Add a callback for the hand data update request. More...
 
void disconnectOnUpdate (uint64_t handler)
 Remove a callback of the hand data update request. More...
 
HandTrackerData::Ptr getData ()
 Returns smart pointer to the last avilable HandTrackerData.
 
float getProcessingTime () const
 Returns last hand data processing time in milliseconds.
 
bool canUpdate () const
 
virtual uint64_t getTimestamp ()
 Returns the last processed data timestamp in microseconds. More...
 

Static Public Member Functions

static HandTracker::Ptr create ()
 Create the HandTracker module object. More...
 

Protected Member Functions

void destroyHandTracker ()
 

Static Protected Member Functions

static void onUpdateCallback (HandTrackerDataInner *data, HandTracker *tracker)
 

Protected Attributes

NuitrackModule * _pimpl
 
HandTrackerCallbackWrapper _callbackWrapper
 
CallbackStruct
< HandTrackerData::Ptr > * 
_callbackStruct
 

Detailed Description

Represents the interface to the capabilities of the Nuitrack Hand Tracker module.

To enable the module, you must create an instance of this class. To create the instance, use a special named constructor HandTracker::create. This instance is called HandTracker module object. To receive the hand tracking data, add an HandTracker::OnUpdate callback to the module object with HandTracker::connectOnUpdate method.

Member Typedef Documentation

typedef std::function<void (HandTrackerData::Ptr)> tdv::nuitrack::HandTracker::OnUpdate

The callback type of the hand data update request.

This callback receive a smart pointer to SkeletonData, which contains Skeleton array.

See Also
tdv::nuitrack::HandTrackerData
tdv::nuitrack::Hand
connectOnUpdate
typedef std::shared_ptr<HandTracker> tdv::nuitrack::HandTracker::Ptr

Smart pointer to access the SkeletonTracker instance.

See Also
create

Constructor & Destructor Documentation

tdv::nuitrack::HandTracker::HandTracker ( NuitrackModule *  pimpl)
inline
Warning
For internal use only.

Member Function Documentation

uint64_t tdv::nuitrack::HandTracker::connectOnUpdate ( const OnUpdate callback)
inline

Add a callback for the hand data update request.

Parameters
[in]callbackCallback to be invoked after the hand data update request.
Returns
Callback ID. You can use it to remove the callback.
See Also
disconnectOnUpdate
static HandTracker::Ptr tdv::nuitrack::HandTracker::create ( )
inlinestatic

Create the HandTracker module object.

Returns
Smart pointer to a new HandTracker instance.
Note
Do not call this method twice. Instead, use the previously received HandTracker::Ptr.
void tdv::nuitrack::HandTracker::destroyHandTracker ( )
inlineprotected
Warning
For internal use only.
void tdv::nuitrack::HandTracker::disconnectOnUpdate ( uint64_t  handler)
inline

Remove a callback of the hand data update request.

Parameters
[in]handlerID of the previously added callback.
See Also
connectOnUpdate
virtual uint64_t tdv::nuitrack::HandTracker::getTimestamp ( )
inlinevirtual

Returns the last processed data timestamp in microseconds.

Returns timestamp corresponding to the last hand tracking data estimation.

Note
The exact meaning of this value depends on the depth provider.
static void tdv::nuitrack::HandTracker::onUpdateCallback ( HandTrackerDataInner *  data,
HandTracker tracker 
)
inlinestaticprotected
Warning
For internal use only.

Member Data Documentation

CallbackStruct<HandTrackerData::Ptr>* tdv::nuitrack::HandTracker::_callbackStruct
protected
Warning
For internal use only.
HandTrackerCallbackWrapper tdv::nuitrack::HandTracker::_callbackWrapper
protected
Warning
For internal use only.
NuitrackModule* tdv::nuitrack::HandTracker::_pimpl
protected
Warning
For internal use only.