ShapesSupportRelations.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::ShapesSupportRelations
17 * @author Rainer Kartmann ( rainer dot kartmann 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#include <Eigen/Core>
26
27#include <VirtualRobot/VirtualRobot.h>
28
30#include <ArmarXCore/interface/observers/ObserverInterface.h>
31
34
35#include <VisionX/interface/components/ShapesSupportRelations.h>
36#include <VisionX/interface/libraries/SemanticObjectRelations/GraphStorage.h>
37#include <VisionX/interface/libraries/SemanticObjectRelations/ShapesTopic.h>
38
39#include <SemanticObjectRelations/SupportAnalysis/SupportAnalysis.h>
40
41namespace armarx::semantic
42{
43 /**
44 * @class ShapesSupportRelationsPropertyDefinitions
45 * @brief Property definitions of `ShapesSupportRelations`.
46 */
52
53 /**
54 * @defgroup Component-ShapesSupportRelations ShapesSupportRelations
55 * @ingroup VisionX-Components
56 * A description of the component ShapesSupportRelations.
57 *
58 * @class ShapesSupportRelations
59 * @ingroup Component-ShapesSupportRelations
60 * @brief Brief description of class ShapesSupportRelations.
61 *
62 * Detailed description of class ShapesSupportRelations.
63 */
65 virtual public armarx::Component,
66 virtual public ShapesSupportRelationsInterface
67 {
68 public:
69 /// @see armarx::ManagedIceObject::getDefaultName()
70 static std::string GetDefaultName();
71 std::string getDefaultName() const override;
72
73
74 // ShapesTopic interface
75 /// Topic/pipeline: Extract the support graph for `objects` and publish it to the graph topic.
76 void reportShapes(const std::string& name,
77 const data::ShapeList& objects,
78 const Ice::Current&) override;
79
80 // SupportRelationsFromShapesInterface interface
81 /// Service: Extract the support graph for `objects` and return it.
82 data::Graph extractSupportGraph(const data::ShapeList& objects,
83 const Ice::LongSeq& safeObjectIDs,
84 const Ice::Current& = Ice::emptyCurrent) override;
85
86 data::Graph extractSupportGraph(const semrel::ShapeMap& objects,
87 const std::set<semrel::ShapeID>& safeObjectIDs);
88
89
90 protected:
91 /// @see armarx::ManagedIceObject::onInitComponent()
92 void onInitComponent() override;
93
94 /// @see armarx::ManagedIceObject::onConnectComponent()
95 void onConnectComponent() override;
96
97 /// @see armarx::ManagedIceObject::onDisconnectComponent()
98 void onDisconnectComponent() override;
99
100 /// @see armarx::ManagedIceObject::onExitComponent()
101 void onExitComponent() override;
102
103 /// @see PropertyUser::createPropertyDefinitions()
105
106
107 private:
108 const Eigen::Vector3f gravityInGlobal = -Eigen::Vector3f::UnitZ();
109
110 Eigen::Vector3f getGravityFromRobotStateComponent();
111
112
113 private:
114 // ICE
115
116 /// The graph listener proxy.
117 GraphStorageTopicPrx graphTopic;
118 std::string graphName;
119
120 /// The robot state component.
121 RobotStateComponentInterfacePrx robotStateComponent;
122
123 /// Debug observer. Used to visualize e.g. time series.
125 /// Debug drawer. Used for 3D visualization.
126 armarx::DebugDrawerTopic debugDrawer;
127
128
129 // PROCESSING
130
131 /// The support analysis.
132 semrel::SupportAnalysis supportAnalysis;
133
134
135 // OPTIONS
136
137 std::string pointCloudFrameName;
138 };
139} // namespace armarx::semantic
Default component property definition container.
Definition Component.h:70
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
The DebugDrawerTopic wraps a DebugDrawerInterfacePrx and provides a more useful interface than the Ic...
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Brief description of class ShapesSupportRelations.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void reportShapes(const std::string &name, const data::ShapeList &objects, const Ice::Current &) override
Topic/pipeline: Extract the support graph for objects and publish it to the graph topic.
data::Graph extractSupportGraph(const data::ShapeList &objects, const Ice::LongSeq &safeObjectIDs, const Ice::Current &=Ice::emptyCurrent) override
Service: Extract the support graph for objects and return it.
std::string getDefaultName() const override
Retrieve default name of component.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx