23 #include <plugins/openni/utils/skel_if_observer.h>
25 #include <blackboard/blackboard.h>
26 #include <interfaces/HumanSkeletonInterface.h>
27 #include <interfaces/HumanSkeletonProjectionInterface.h>
49 SkelIfObserver::SkelIfObserver(
BlackBoard *bb, UserMap &users)
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);
90 __queue_lock->unlock();
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();