23 #ifndef __PLUGINS_WORLDMODEL_FUSER_OBJPOS_MAJORITY_H_
24 #define __PLUGINS_WORLDMODEL_FUSER_OBJPOS_MAJORITY_H_
31 #include <blackboard/interface_observer.h>
32 #include <core/utils/lock_set.h>
33 #include <interfaces/ObjectPositionInterface.h>
41 class ObjectPositionInterface;
51 const std::string& own_id,
52 const std::string& foreign_id_pattern,
53 const std::string& output_id,
54 float self_confidence_radius);
68 OpiWrapper(
Opi* opi) : opi_(opi) { assert(opi != NULL); }
71 operator Opi*()
const {
return opi_; }
77 bool operator == (
const OpiWrapper& o)
const {
return cmp(o) == 0; }
83 bool operator < (
const OpiWrapper& o)
const {
return cmp(o) < 0; }
87 Opi* opi() {
return opi_; }
91 const Opi* opi()
const {
return opi_; }
94 int cmp(
const OpiWrapper& o)
const {
return strcmp(opi_->id(),
100 typedef std::vector<Opi*> OpiBucket;
101 typedef std::vector<OpiBucket> OpiBuckets;
103 const static float GROUP_RADIUS = 1.0f;
107 void average(
const OpiBucket& input_ifs);
109 static float length(
float x,
float y,
float z);
110 static float rel_length(
const Opi* iface);
111 static float world_object_dist(
const Opi* from,
const Opi* to);
112 static bool same_contents(
const OpiBucket& left,
const OpiBucket& right);
118 std::string output_id_;
120 float self_confidence_radius_;