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>
63 "RobotStateComponentName",
64 "RobotStateComponent",
65 "Name of the robot state component that should be used");
69 "Name of the head IK unit component that should be used");
73 "Name of the WorkingMemory component that should be used");
77 "Name of the PriorKnowledge component that should be used");
81 "Name of the ViewSelection component that should be used");
85 "Name of the frame of the head base in the robot model");
90 "Name of the frame of the head base in the robot model");
94 "Maximum for the random noise that will be added to the localization necessities");
97 "0.5 * minimal opening angles of the used cameras");
101 "Maximum distance of objects the head to be considered for observation");
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");
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");
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);
220 IceUtil::Time lastDiff;
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;
Default component property definition container.
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Baseclass for all ArmarX ManagedIceObjects requiring properties.
ObjectLocalizationSaliencyPropertyDefinitions(std::string prefix)
Brief description of class ObjectLocalizationSaliency.
void onInitComponent() override
void onDeactivateAutomaticViewSelection(const Ice::Current &c=Ice::emptyCurrent) override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onActivateAutomaticViewSelection(const Ice::Current &c=Ice::emptyCurrent) override
void onConnectComponent() override
void nextViewTarget(Ice::Long timestamp, const Ice::Current &c=Ice::emptyCurrent) override
void onExitComponent() override
std::string getDefaultName() const override
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
#define ARMARX_INFO
The normal logging level.
std::shared_ptr< class Robot > RobotPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx