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