Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
WorldModelObjPosMajorityFuser Class Reference

ObjectPositionInterface majority fuser. More...

#include "objpos_majority.h"

Inheritance diagram for WorldModelObjPosMajorityFuser:

Public Member Functions

 WorldModelObjPosMajorityFuser (fawkes::Logger *logger, fawkes::BlackBoard *blackboard, const std::string &own_id, const std::string &foreign_id_pattern, const std::string &output_id, float self_confidence_radius)
 Constructor. More...
 
 ~WorldModelObjPosMajorityFuser ()
 Destructor. More...
 
virtual void bb_interface_created (const char *type, const char *id) throw ()
 BlackBoard interface created notification. More...
 
virtual void fuse ()
 The single function that makes fusers work. More...
 
- Public Member Functions inherited from WorldModelFuser
virtual ~WorldModelFuser ()
 Virtual empty destructor. More...
 
- Public Member Functions inherited from fawkes::BlackBoardInterfaceObserver
 BlackBoardInterfaceObserver ()
 Empty constructor. More...
 
virtual ~BlackBoardInterfaceObserver ()
 Destructor. More...
 
virtual void bb_interface_destroyed (const char *type, const char *id) throw ()
 BlackBoard interface destroyed notification. More...
 

Additional Inherited Members

- Protected Types inherited from fawkes::BlackBoardInterfaceObserver
typedef LockMap< std::string,
std::list< std::string > > 
ObservedInterfaceLockMap
 Type for lockable interface type hash sets. More...
 
typedef
ObservedInterfaceLockMap::iterator 
ObservedInterfaceLockMapIterator
 Type for iterator of lockable interface type hash sets. More...
 
- Protected Member Functions inherited from fawkes::BlackBoardInterfaceObserver
void bbio_add_observed_create (const char *type_pattern, const char *id_pattern="*") throw ()
 Add interface creation type to watch list. More...
 
void bbio_add_observed_destroy (const char *type_pattern, const char *id_pattern="*") throw ()
 Add interface destruction type to watch list. More...
 
ObservedInterfaceLockMapbbio_get_observed_create () throw ()
 Get interface creation type watch list. More...
 
ObservedInterfaceLockMapbbio_get_observed_destroy () throw ()
 Get interface destriction type watch list. More...
 

Detailed Description

ObjectPositionInterface majority fuser.

The parameters are (1) the ID of the own ObjectPositionInterface, (2) the pattern ID of the other robots' ObjectPositionInterfaces and (3) the maximum-self-confidence-distance.

(1) If the own ObjectPositionInterface thinks the object is not further away than self_confidence_radius, then the own interface's data is copied to the output interface. (2) If there is an unambiguous majority of interfaces that say the object is somewhere else and this majority is averaged and the average values are copied to the output interface. Since the other interfaces probably won't agree on one exact position, they are grouped: for each interface A its group is the set of interfaces that claim the object is not further away from the position claimed by A than GROUP_RADIUS. GROUP_RADIUS is currently hard-coded to 1.0 meters. (3) If the other interfaces "cannot settle" on some position of the object, the own interface's data is considered as at least as reliable as theirs and therefore the own interface's data is copied to the output interface.

Like the WorldModelObjPosMajorityFuser, it registers as an observer and opens any newly created interface that matches the ID of the own ObjectPositionInterface or the pattern of the foreign ObjectPositionInterfaces.

Author
Christoph Schwering

Definition at line 44 of file objpos_majority.h.

Constructor & Destructor Documentation

WorldModelObjPosMajorityFuser::WorldModelObjPosMajorityFuser ( fawkes::Logger logger,
fawkes::BlackBoard blackboard,
const std::string &  own_id,
const std::string &  foreign_id_pattern,
const std::string &  output_id,
float  self_confidence_radius 
)

Constructor.

Parameters
blackboardBlackBoard.
loggerLogger.
own_idThe ID of the (single) own interface.
foreign_id_patternThe pattern of the (multiple) other interfaces.
output_idThe ID of the destination interface.
self_confidence_radiusradius in which to consider our perception the best

Definition at line 70 of file objpos_majority.cpp.

References fawkes::BlackBoardInterfaceObserver::bbio_add_observed_create(), fawkes::BlackBoard::close(), fawkes::BlackBoard::open_for_reading(), fawkes::BlackBoard::open_for_writing(), fawkes::BlackBoard::open_multiple_for_reading(), and fawkes::BlackBoard::register_observer().

WorldModelObjPosMajorityFuser::~WorldModelObjPosMajorityFuser ( )

Member Function Documentation

void WorldModelObjPosMajorityFuser::bb_interface_created ( const char *  type,
const char *  id 
) throw ()
virtual

BlackBoard interface created notification.

This is called whenever an interface is created for a type that you registered for.

Parameters
typetype of the interface. If you want to store this make a copy as it is not guaranteed that the supplied string exists for longer than the duration of the method call
idID of the newly created interface. If you want to store this make a copy as it is not guaranteed that the supplied string exists for longer than the duration of the method call

Reimplemented from fawkes::BlackBoardInterfaceObserver.

Definition at line 153 of file objpos_majority.cpp.

References fawkes::Interface::id(), and fawkes::Exception::print_trace().


The documentation for this class was generated from the following files: