SemanticRelationAnalyzer.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 VisionX::ArmarXObjects::SemanticRelationAnalyzer
17 * @author Fabian Paus ( fabian dot paus at kit dot edu )
18 * @date 2019
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25// Weird Eigen hacks from Simox require to be included first
26#include <mutex>
27
28#include <VirtualRobot/VirtualRobot.h>
29
32
33#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
34
35#include <VisionX/interface/components/SemanticRelationAnalyzer.h>
36#include <VisionX/interface/libraries/SemanticObjectRelations/GraphStorage.h>
39
40#include <MemoryX/interface/components/WorkingMemoryInterface.h>
42#include <SemanticObjectRelations/SupportAnalysis/SupportAnalysis.h>
43
44namespace armarx
45{
46 /**
47 * @class SemanticRelationAnalyzerPropertyDefinitions
48 * @brief
49 */
55
56 /**
57 * @defgroup Component-SemanticRelationAnalyzer SemanticRelationAnalyzer
58 * @ingroup VisionX-Components
59 * A description of the component SemanticRelationAnalyzer.
60 *
61 * @class SemanticRelationAnalyzer
62 * @ingroup Component-SemanticRelationAnalyzer
63 * @brief Brief description of class SemanticRelationAnalyzer.
64 *
65 * Detailed description of class SemanticRelationAnalyzer.
66 */
68 virtual public armarx::Component,
70 virtual public armarx::SemanticRelationAnalyzerInterface
71 {
72 public:
73 // SemanticRelationAnalyzerInterface interface
74 semantic::data::Graph extractSupportGraphFromWorkingMemory(const Ice::Current&) override;
75
76 /**
77 * @see armarx::ManagedIceObject::getDefaultName()
78 */
79 std::string
80 getDefaultName() const override
81 {
82 return "SemanticRelationAnalyzer";
83 }
84
85 protected:
86 /**
87 * @see armarx::ManagedIceObject::onInitComponent()
88 */
89 void onInitComponent() override;
90
91 /**
92 * @see armarx::ManagedIceObject::onConnectComponent()
93 */
94 void onConnectComponent() override;
95
96 /**
97 * @see armarx::ManagedIceObject::onDisconnectComponent()
98 */
99 void onDisconnectComponent() override;
100
101 /**
102 * @see armarx::ManagedIceObject::onExitComponent()
103 */
104 void onExitComponent() override;
105
106 /**
107 * @see PropertyUser::createPropertyDefinitions()
108 */
110
111 private:
112 void update();
113
114 private:
115 std::string prop_WorkingMemoryName;
116 std::string prop_PriorKnowledgeName;
117 std::string prop_RobotStateComponentName;
118 std::string prop_DebugDrawerTopicName;
119 int prop_UpdatePeriodInMS = 10;
120 float prop_ContactMarginInMM = 5.0f;
121
122 memoryx::WorkingMemoryInterfacePrx workingMemory;
123 memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
124 memoryx::RelationMemorySegmentBasePrx relationSegment;
125 RobotStateComponentInterfacePrx robotStateComponent;
126 DebugDrawerInterfacePrx debugDrawer;
127
128 std::shared_ptr<armarx::semantic::JsonSimoxShapeSerializer> jsonSerializer;
129
131
132 std::mutex componentMutex;
133 memoryx::ObjectInstanceSegmentWrapper objectInstancesSegment_;
134 semrel::SupportAnalysis supportAnalysis;
135 };
136} // namespace armarx
Default component property definition container.
Definition Component.h:70
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
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.
Brief description of class SemanticRelationAnalyzer.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
semantic::data::Graph extractSupportGraphFromWorkingMemory(const Ice::Current &) override
std::string getDefaultName() const override
Allows access to the objects in the working memory in form of Simox SceneObjects.
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
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx