AgentAtPredicateProvider.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::
17* @author Valerij Wittenbeck ( valerij.wittenbeck at student dot kit dot edu)
18* @date 2014
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
26
29#include <MemoryX/interface/components/WorkingMemoryInterface.h>
30#include <MemoryX/interface/memorytypes/MemorySegments.h>
31
32namespace memoryx
33{
35 {
36 public:
39 {
41 "DistanceThreshold",
42 1000.f,
43 "Threshold below which the agent is considered to be close to a node");
44 defineOptionalProperty<float>("HumanDistanceThreshold",
45 2000.f,
46 "Threshold for the human below which the agent is "
47 "considered to be close to a node");
48 defineOptionalProperty<std::string>("PlatformGraphSceneName",
49 "XperienceDemoKitchenRM",
50 "Name of the scene in the graph segment");
51 }
52 };
53
55 {
56 public:
58
59 // ManagedIceObject interface
60 protected:
61 void onInitWorldStateUpdater() override;
62 void onConnectWorldStateUpdater() override;
63 std::string getDefaultName() const override;
64
71
72 // WorldStateUpdaterInterface interface
73 public:
74 PredicateInfoList getPredicateInfos(const Ice::Current& c = Ice::emptyCurrent) override;
75 PredicateInstanceList calcPredicates(const Ice::Current&) override;
76
77 private:
78 struct CachedNodeInfo
79 {
80 std::string nodeId;
81 std::vector<memoryx::EntityRefBasePtr> agentAtNodeRefs;
82 };
83
84 std::map<std::string, CachedNodeInfo> nodeInfoCache;
85 std::map<std::string, std::vector<std::string>> nodeParentsCache;
86
87 CachedNodeInfo getCacheEntry(const std::string& nodeId);
88
89 float distanceThreshold, humanDistanceThreshold;
90 std::string sceneName;
91
92 WorkingMemoryInterfacePrx wm;
93 PriorKnowledgeInterfacePrx prior;
94 GraphNodePoseResolverInterfacePrx psr;
95
96 AgentInstancesSegmentBasePrx agentInstances;
97 GraphMemorySegmentBasePrx graphSegment;
98 std::vector<GraphNodeBasePtr> graphNodes;
99
100 PredicateInfo agentAt;
101 };
102
103} // namespace memoryx
constexpr T c
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
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)
PredicateInstanceList calcPredicates(const Ice::Current &) override
PredicateInfoList getPredicateInfos(const Ice::Current &c=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
std::string getDefaultName() const override
Retrieve default name of component.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
VirtualRobot headers.