23 #ifndef _PLUGINS_OPENNI_HANDTRACKER_THREAD_H_
24 #define _PLUGINS_OPENNI_HANDTRACKER_THREAD_H_
26 #include <aspect/blackboard.h>
27 #include <aspect/blocked_timing.h>
28 #include <aspect/clock.h>
29 #include <aspect/configurable.h>
30 #include <aspect/logging.h>
31 #include <core/threading/thread.h>
32 #include <core/utils/lockptr.h>
33 #include <plugins/openni/aspect/openni.h>
35 #include <XnCppWrapper.h>
39 class ObjectPositionInterface;
57 void hand_create(XnUserID &user,
const XnPoint3D *position, XnFloat &time);
59 void hand_update(XnUserID &user,
const XnPoint3D *position, XnFloat &time);
62 const XnPoint3D *position,
63 const XnPoint3D *end_position);
64 void gesture_progress(
const XnChar *gesture_name,
const XnPoint3D *position, XnFloat progress);
75 void update_hand(XnUserID &user,
const XnPoint3D *position);
78 typedef std::map<XnUserID, fawkes::ObjectPositionInterface *> HandMap;
81 xn::HandsGenerator * hand_gen_;
82 xn::DepthGenerator * depth_gen_;
83 xn::GestureGenerator *gesture_gen_;
85 XnCallbackHandle hand_cb_handle_;
86 XnCallbackHandle gesture_cb_handle_;
88 std::map<std::string, bool> enabled_gesture_;
90 std::map<XnUserID, bool> needs_write_;
OpenNI Hand Tracker Thread.
void hand_create(XnUserID &user, const XnPoint3D *position, XnFloat &time)
Notify of new hand.
virtual void init()
Initialize the thread.
void hand_update(XnUserID &user, const XnPoint3D *position, XnFloat &time)
Notify of hand update.
void hand_destroy(XnUserID &user, XnFloat &time)
Notify of disappeared hand.
virtual void finalize()
Finalize the thread.
void gesture_recognized(const XnChar *gesture_name, const XnPoint3D *position, const XnPoint3D *end_position)
Notify of recognized gesture.
virtual ~OpenNiHandTrackerThread()
Destructor.
virtual void run()
Stub to see name in backtrace for easier debugging.
void gesture_progress(const XnChar *gesture_name, const XnPoint3D *position, XnFloat progress)
Notify of gesture progress.
OpenNiHandTrackerThread()
Constructor.
virtual void loop()
Code to execute in the thread.
Thread aspect to access to BlackBoard.
Thread aspect to use blocked timing.
Thread aspect that allows to obtain the current time from the clock.
Thread aspect to access configuration data.
Thread aspect to log output.
Thread aspect to get access to the OpenNI context.
Thread class encapsulation of pthreads.
Fawkes library namespace.