23 #include <blackboard/blackboard.h>
24 #include <interfaces/ObjectPositionInterface.h>
25 #include <plugins/openni/utils/hand_if_observer.h>
43 queue_lock_ =
new Mutex();
46 std::list<ObjectPositionInterface *> hand_ifs =
49 std::list<ObjectPositionInterface *>::iterator i;
50 for (i = hand_ifs.begin(); i != hand_ifs.end(); ++i) {
70 if (hands_.find(
id) == hands_.end()) {
72 queues_[active_queue_].push(
id);
73 queue_lock_->unlock();
84 unsigned int proc_queue = active_queue_;
85 active_queue_ = 1 - active_queue_;
87 while (!queues_[proc_queue].empty()) {
88 std::string
id = queues_[proc_queue].front();
100 queues_[proc_queue].pop();
void bbio_add_observed_create(const char *type_pattern, const char *id_pattern="*")
Add interface creation type to watch list.
The BlackBoard abstract class.
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 void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
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.
void print_trace()
Prints trace to stderr.
const char * id() const
Get identifier of interface.
Mutex mutual exclusion lock.
void lock()
Lock this mutex.
void unlock()
Unlock the mutex.
ObjectPositionInterface Fawkes BlackBoard Interface.
~HandIfObserver()
Destructor.
HandIfObserver(BlackBoard *bb, HandMap &hands)
Constructor.
virtual void bb_interface_created(const char *type, const char *id)
BlackBoard interface created notification.
void process_queue()
Process internal queue.
Fawkes library namespace.
Hand info to pass to draw_skeletons().
fawkes::ObjectPositionInterface * hand_if
Hand pos interface.