32 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
37 #include <MemoryX/interface/memorytypes/MemorySegments.h>
38 #include <MemoryX/interface/workingmemory/AbstractWorkingMemoryInterface.h>
39 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
51 #include <condition_variable>
67 defineOptionalProperty<std::string>(
"RobotStateComponentName",
"RobotStateComponent",
"Name of the robot state component that should be used");
68 defineOptionalProperty<std::string>(
"HeadIKUnitName",
"HeadIKUnit",
"Name of the head IK unit component that should be used");
69 defineOptionalProperty<std::string>(
"WorkingMemoryName",
"WorkingMemory",
"Name of the WorkingMemory component that should be used");
70 defineOptionalProperty<std::string>(
"PriorKnowledgeName",
"PriorKnowledge",
"Name of the PriorKnowledge component that should be used");
71 defineOptionalProperty<std::string>(
"ViewSelectionName",
"ViewSelection",
"Name of the ViewSelection component that should be used");
72 defineOptionalProperty<std::string>(
"CameraFrameName",
"VirtualCentralGaze",
"Name of the frame of the head base in the robot model");
74 defineOptionalProperty<std::string>(
"HeadFrameName",
"Head Base",
"Name of the frame of the head base in the robot model");
75 defineOptionalProperty<float>(
"RandomNoiseLevel", 1.0f,
"Maximum for the random noise that will be added to the localization necessities");
76 defineOptionalProperty<float>(
"HalfCameraOpeningAngle", 12.0 *
M_PI / 180.0,
"0.5 * minimal opening angles of the used cameras");
77 defineOptionalProperty<float>(
"MaxObjectDistance", 1500.f,
"Maximum distance of objects the head to be considered for observation");
78 defineOptionalProperty<float>(
"CentralHeadTiltAngle", 110.0f,
"Defines the height direction that will be considered 'central' in the reachable area of the head (in degrees). Default is looking 20 degrees downwards");
79 defineOptionalProperty<float>(
"ProbabilityToLookForALostObject", 0.03f,
"Probability that one of the objects that have been seen but could later not been localized again will be included in the view selection");
80 defineOptionalProperty<float>(
"UpdateFrequency", 10.0f,
"Frequency of the saliency update");
98 virtual public armarx::ViewSelectionObserver
106 return "ObjectLocalizationSaliency";
111 ARMARX_LOG <<
"enabling object saliency computation";
113 next = IceUtil::Time::seconds(0);
115 if (!(processorTask && processorTask->isRunning()))
117 processorTask->start();
130 ARMARX_LOG <<
"disabling object saliency computation";
131 if (processorTask && processorTask->isRunning())
133 processorTask->stop();
171 void generateObjectLocalizationSaliency();
173 void addSaliencyRecursive(
const int currentNodeIndex,
const float saliency,
const TSphereCoord objectSphereCoord,
const int objectIndex,
const float maxDistanceOnArc);
175 void setRandomNoise(
const float centralAngleForVerticalDirection,
const float directionVariabilityFactor = 1.0f);
176 void generateRandomNoise(std::vector<memoryx::ObjectInstancePtr>& localizableObjects, memoryx::EntityBaseList& objectInstances);
186 memoryx::WorkingMemoryInterfacePrx memoryProxy;
187 memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
188 memoryx::ObjectInstanceMemorySegmentBasePrx objectInstancesProxy;
189 memoryx::ObjectClassMemorySegmentBasePrx objectClassesProxy;
193 ViewSelectionInterfacePrx viewSelection;
198 std::map<std::string, memoryx::ObjectClassPtr> recognizableObjClasses;
204 std::vector<int> nodeVisitedForObject;
207 Eigen::Vector3f offsetToHeadCenter;
209 float centralHeadTiltAngle;
211 float halfCameraOpeningAngle;
212 float deviationFromCameraCenterFactor;
213 float randomNoiseLevel;
215 std::string headFrameName, cameraFrameName;