23 #include <plugins/openni/utils/skel_if_observer.h> 25 #include <blackboard/blackboard.h> 26 #include <interfaces/HumanSkeletonInterface.h> 27 #include <interfaces/HumanSkeletonProjectionInterface.h> 52 __queue_lock =
new Mutex();
55 std::list<HumanSkeletonInterface *> skels =
58 std::list<HumanSkeletonProjectionInterface *> projs;
60 std::list<HumanSkeletonInterface *>::iterator i;
61 for (i = skels.begin(); i != skels.end(); ++i) {
62 printf(
"Opened %s\n", (*i)->uid());
69 __users[user.skel_if->id()] = user;
87 if (__users.find(
id) == __users.end()) {
89 __queues[__active_queue].push(
id);
100 __queue_lock->
lock();
101 unsigned int proc_queue = __active_queue;
102 __active_queue = 1 - __active_queue;
104 while (! __queues[proc_queue].empty()) {
105 std::string
id = __queues[proc_queue].front();
109 printf(
"Opening %s\n",
id.c_str());
125 __queues[proc_queue].pop();
virtual void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
HumanSkeletonProjectionInterface Fawkes BlackBoard Interface.
Fawkes library namespace.
void unlock()
Unlock the mutex.
fawkes::HumanSkeletonProjectionInterface * proj_if
Projection interface.
void process_queue()
Process internal queue.
~SkelIfObserver()
Destructor.
void bbio_add_observed_create(const char *type_pattern, const char *id_pattern="*")
Add interface creation type to watch list.
Base class for exceptions in Fawkes.
virtual void unregister_observer(BlackBoardInterfaceObserver *observer)
Unregister BB interface observer.
fawkes::HumanSkeletonInterface * skel_if
Skeleton interface.
virtual std::list< Interface * > open_multiple_for_reading(const char *type_pattern, const char *id_pattern="*", const char *owner=NULL)=0
Open multiple interfaces for reading.
void print_trace()
Prints trace to stderr.
virtual Interface * open_for_reading(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for reading.
virtual void bb_interface_created(const char *type, const char *id)
BlackBoard interface created notification.
SkelIfObserver(BlackBoard *bb, UserMap &users)
Constructor.
HumanSkeletonInterface Fawkes BlackBoard Interface.
void lock()
Lock this mutex.
The BlackBoard abstract class.
Mutex mutual exclusion lock.
User info to pass to draw_skeletons().
virtual void close(Interface *interface)=0
Close interface.