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 
41 namespace armarx::semantic
42 {
43  /**
44  * @class ShapesSupportRelationsPropertyDefinitions
45  * @brief Property definitions of `ShapesSupportRelations`.
46  */
48  {
49  public:
51  };
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  std::string getDefaultName() const override;
71 
72 
73  // ShapesTopic interface
74  /// Topic/pipeline: Extract the support graph for `objects` and publish it to the graph topic.
75  void reportShapes(const std::string& name,
76  const data::ShapeList& objects,
77  const Ice::Current&) override;
78 
79  // SupportRelationsFromShapesInterface interface
80  /// Service: Extract the support graph for `objects` and return it.
81  data::Graph extractSupportGraph(const data::ShapeList& objects,
82  const Ice::LongSeq& safeObjectIDs,
83  const Ice::Current& = Ice::emptyCurrent) override;
84 
85  data::Graph extractSupportGraph(const semrel::ShapeMap& objects,
86  const std::set<semrel::ShapeID>& safeObjectIDs);
87 
88 
89  protected:
90  /// @see armarx::ManagedIceObject::onInitComponent()
91  void onInitComponent() override;
92 
93  /// @see armarx::ManagedIceObject::onConnectComponent()
94  void onConnectComponent() override;
95 
96  /// @see armarx::ManagedIceObject::onDisconnectComponent()
97  void onDisconnectComponent() override;
98 
99  /// @see armarx::ManagedIceObject::onExitComponent()
100  void onExitComponent() override;
101 
102  /// @see PropertyUser::createPropertyDefinitions()
104 
105 
106  private:
107  const Eigen::Vector3f gravityInGlobal = -Eigen::Vector3f::UnitZ();
108 
109  Eigen::Vector3f getGravityFromRobotStateComponent();
110 
111 
112  private:
113  // ICE
114 
115  /// The graph listener proxy.
116  GraphStorageTopicPrx graphTopic;
117  std::string graphName;
118 
119  /// The robot state component.
120  RobotStateComponentInterfacePrx robotStateComponent;
121 
122  /// Debug observer. Used to visualize e.g. time series.
123  armarx::DebugObserverInterfacePrx debugObserver;
124  /// Debug drawer. Used for 3D visualization.
125  armarx::DebugDrawerTopic debugDrawer;
126 
127 
128  // PROCESSING
129 
130  /// The support analysis.
131  semrel::SupportAnalysis supportAnalysis;
132 
133 
134  // OPTIONS
135 
136  std::string pointCloudFrameName;
137  };
138 } // namespace armarx::semantic
RemoteRobot.h
armarx::DebugDrawerTopic
The DebugDrawerTopic wraps a DebugDrawerInterfacePrx and provides a more useful interface than the Ic...
Definition: DebugDrawerTopic.h:151
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::semantic::ShapesSupportRelations::extractSupportGraph
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.
Definition: ShapesSupportRelations.cpp:186
DebugDrawerTopic.h
armarx::semantic::ShapesSupportRelationsPropertyDefinitions
Property definitions of ShapesSupportRelations.
Definition: ShapesSupportRelations.h:47
armarx::semantic::ShapesSupportRelations::onInitComponent
void onInitComponent() override
Definition: ShapesSupportRelations.cpp:111
armarx::semantic::ShapesSupportRelations::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ShapesSupportRelations.cpp:238
armarx::Graph
boost::subgraph< CloudGraph > Graph
Definition: Common.h:58
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:91
armarx::semantic::ShapesSupportRelationsPropertyDefinitions::ShapesSupportRelationsPropertyDefinitions
ShapesSupportRelationsPropertyDefinitions(std::string prefix)
Definition: ShapesSupportRelations.cpp:34
armarx::semantic::ShapesSupportRelations::onExitComponent
void onExitComponent() override
Definition: ShapesSupportRelations.cpp:163
armarx::semantic::ShapesSupportRelations::onDisconnectComponent
void onDisconnectComponent() override
Definition: ShapesSupportRelations.cpp:157
armarx::semantic
Definition: ShapesSupportRelations.cpp:32
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
armarx::semantic::ShapesSupportRelations
Brief description of class ShapesSupportRelations.
Definition: ShapesSupportRelations.h:64
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::semantic::ShapesSupportRelations::reportShapes
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.
Definition: ShapesSupportRelations.cpp:168
armarx::semantic::ShapesSupportRelations::getDefaultName
std::string getDefaultName() const override
Definition: ShapesSupportRelations.cpp:105
armarx::semantic::ShapesSupportRelations::onConnectComponent
void onConnectComponent() override
Definition: ShapesSupportRelations.cpp:136