Fawkes API
Fawkes Development Version
|
23 #include <blackboard/blackboard.h>
24 #include <interfaces/HumanSkeletonInterface.h>
25 #include <interfaces/HumanSkeletonProjectionInterface.h>
26 #include <plugins/openni/utils/skel_if_observer.h>
46 queue_lock_ =
new Mutex();
49 std::list<HumanSkeletonInterface *> skels =
52 std::list<HumanSkeletonProjectionInterface *> projs;
54 std::list<HumanSkeletonInterface *>::iterator i;
55 for (i = skels.begin(); i != skels.end(); ++i) {
56 printf(
"Opened %s\n", (*i)->uid());
79 if (users_.find(
id) == users_.end()) {
81 queues_[active_queue_].push(
id);
82 queue_lock_->unlock();
93 unsigned int proc_queue = active_queue_;
94 active_queue_ = 1 - active_queue_;
96 while (!queues_[proc_queue].empty()) {
97 std::string
id = queues_[proc_queue].front();
101 printf(
"Opening %s\n",
id.c_str());
116 queues_[proc_queue].pop();
void lock()
Lock this mutex.
~SkelIfObserver()
Destructor.
virtual void bb_interface_created(const char *type, const char *id)
BlackBoard interface created notification.
Mutex mutual exclusion lock.
fawkes::HumanSkeletonProjectionInterface * proj_if
Projection interface.
SkelIfObserver(BlackBoard *bb, UserMap &users)
Constructor.
HumanSkeletonInterface Fawkes BlackBoard Interface.
The BlackBoard abstract class.
const char * id() const
Get identifier of interface.
void unlock()
Unlock the mutex.
void bbio_add_observed_create(const char *type_pattern, const char *id_pattern="*")
Add interface creation type to watch list.
HumanSkeletonProjectionInterface Fawkes BlackBoard Interface.
virtual void close(Interface *interface)=0
Close interface.
void process_queue()
Process internal queue.
Fawkes library namespace.
fawkes::HumanSkeletonInterface * skel_if
Skeleton interface.
virtual void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
void print_trace()
Prints trace to stderr.
User info to pass to draw_skeletons().
virtual void unregister_observer(BlackBoardInterfaceObserver *observer)
Unregister BB interface observer.
virtual Interface * open_for_reading(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for reading.
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.
Base class for exceptions in Fawkes.