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 static std::string GetDefaultName();
80 std::string getDefaultName() const override;
81
82 protected:
83 /**
84 * @see armarx::ManagedIceObject::onInitComponent()
85 */
86 void onInitComponent() override;
87
88 /**
89 * @see armarx::ManagedIceObject::onConnectComponent()
90 */
91 void onConnectComponent() override;
92
93 /**
94 * @see armarx::ManagedIceObject::onDisconnectComponent()
95 */
96 void onDisconnectComponent() override;
97
98 /**
99 * @see armarx::ManagedIceObject::onExitComponent()
100 */
101 void onExitComponent() override;
102
103 /**
104 * @see PropertyUser::createPropertyDefinitions()
105 */
107
108 private:
109 void update();
110
111 private:
112 std::string prop_WorkingMemoryName;
113 std::string prop_PriorKnowledgeName;
114 std::string prop_RobotStateComponentName;
115 std::string prop_DebugDrawerTopicName;
116 int prop_UpdatePeriodInMS = 10;
117 float prop_ContactMarginInMM = 5.0f;
118
119 memoryx::WorkingMemoryInterfacePrx workingMemory;
120 memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
121 memoryx::RelationMemorySegmentBasePrx relationSegment;
122 RobotStateComponentInterfacePrx robotStateComponent;
123 DebugDrawerInterfacePrx debugDrawer;
124
125 std::shared_ptr<armarx::semantic::JsonSimoxShapeSerializer> jsonSerializer;
126
128
129 std::mutex componentMutex;
130 memoryx::ObjectInstanceSegmentWrapper objectInstancesSegment_;
131 semrel::SupportAnalysis supportAnalysis;
132 };
133} // 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
Retrieve default name of component.
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