WorldModelObjPosMajorityFuser Class Reference

ObjectPositionInterface majority fuser. More...

#include <objpos_majority.h>

Inheritance diagram for WorldModelObjPosMajorityFuser:
Inheritance graph
[legend]

List of all members.

Classes

class  OpiWrapper
 Wrapper that compares by the Opi's id().

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.
 ~WorldModelObjPosMajorityFuser ()
 Destructor.
virtual void bb_interface_created (const char *type, const char *id) throw ()
 BlackBoard interface created notification.
virtual void fuse ()
 The single function that makes fusers work.

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:
blackboard BlackBoard.
logger Logger.
own_id The ID of the (single) own interface.
foreign_id_pattern The pattern of the (multiple) other interfaces.
output_id The ID of the destination interface.
self_confidence_radius radius 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::BBIO_FLAG_CREATED, 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:
type type 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
id ID 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().

void WorldModelObjPosMajorityFuser::fuse (  )  [virtual]

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

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1