27 #include <condition_variable>
36 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
39 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
40 #include <MemoryX/interface/memorytypes/MemorySegments.h>
41 #include <MemoryX/interface/workingmemory/AbstractWorkingMemoryInterface.h>
62 defineOptionalProperty<std::string>(
63 "RobotStateComponentName",
64 "RobotStateComponent",
65 "Name of the robot state component that should be used");
66 defineOptionalProperty<std::string>(
69 "Name of the head IK unit component that should be used");
70 defineOptionalProperty<std::string>(
73 "Name of the WorkingMemory component that should be used");
74 defineOptionalProperty<std::string>(
77 "Name of the PriorKnowledge component that should be used");
78 defineOptionalProperty<std::string>(
81 "Name of the ViewSelection component that should be used");
82 defineOptionalProperty<std::string>(
85 "Name of the frame of the head base in the robot model");
87 defineOptionalProperty<std::string>(
90 "Name of the frame of the head base in the robot model");
91 defineOptionalProperty<float>(
94 "Maximum for the random noise that will be added to the localization necessities");
95 defineOptionalProperty<float>(
"HalfCameraOpeningAngle",
97 "0.5 * minimal opening angles of the used cameras");
98 defineOptionalProperty<float>(
101 "Maximum distance of objects the head to be considered for observation");
102 defineOptionalProperty<float>(
103 "CentralHeadTiltAngle",
105 "Defines the height direction that will be considered 'central' in the reachable "
106 "area of the head (in degrees). Default is looking 20 degrees downwards");
107 defineOptionalProperty<float>(
108 "ProbabilityToLookForALostObject",
110 "Probability that one of the objects that have been seen but could later not been "
111 "localized again will be included in the view selection");
112 defineOptionalProperty<float>(
113 "UpdateFrequency", 10.0f,
"Frequency of the saliency update");
130 virtual public armarx::ViewSelectionObserver
139 return "ObjectLocalizationSaliency";
145 ARMARX_LOG <<
"enabling object saliency computation";
147 next = IceUtil::Time::seconds(0);
149 if (!(processorTask && processorTask->isRunning()))
151 processorTask->start();
163 ARMARX_LOG <<
"disabling object saliency computation";
164 if (processorTask && processorTask->isRunning())
166 processorTask->stop();
171 const Ice::Current&
c = Ice::emptyCurrent)
override;
204 void generateObjectLocalizationSaliency();
206 void addSaliencyRecursive(
const int currentNodeIndex,
207 const float saliency,
209 const int objectIndex,
210 const float maxDistanceOnArc);
212 void setRandomNoise(
const float centralAngleForVerticalDirection,
213 const float directionVariabilityFactor = 1.0f);
214 void generateRandomNoise(std::vector<memoryx::ObjectInstancePtr>& localizableObjects,
215 memoryx::EntityBaseList& objectInstances);
224 memoryx::WorkingMemoryInterfacePrx memoryProxy;
225 memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
226 memoryx::ObjectInstanceMemorySegmentBasePrx objectInstancesProxy;
227 memoryx::ObjectClassMemorySegmentBasePrx objectClassesProxy;
231 ViewSelectionInterfacePrx viewSelection;
236 std::map<std::string, memoryx::ObjectClassPtr> recognizableObjClasses;
242 std::vector<int> nodeVisitedForObject;
245 Eigen::Vector3f offsetToHeadCenter;
247 float centralHeadTiltAngle;
249 float halfCameraOpeningAngle;
250 float deviationFromCameraCenterFactor;
251 float randomNoiseLevel;
253 std::string headFrameName, cameraFrameName;