32#include <SemanticObjectRelations/SupportAnalysis/json.h>
44 "Name of the topic on which shapes are reported.");
47 "ice.SemanticGraphName",
49 "Name of the graph when reported to the SemanticGraphStorage topic.");
52 "Name of SemanticGraphStorage topic.");
55 "RobotStateComponent",
56 "Name of the robot state component.");
60 "Name of the frame of the point cloud coordinates. \n"
61 "Used to determine the gravity vector.");
65 "Name of the topic the DebugObserver listens to.");
73 "Distance by which objects are increased for contact computation [mm].")
77 "GR.VerticalSepPlaneAngleMax",
79 "Maximal angle [degree] between gravity and separating plane for \n"
80 "separating plane to be considered vertical.")
84 "GR.VerticalSepPlaneAssumeSupport",
86 "If true, edges are added if the separating plane is vertical.");
90 "UD.enabled",
true,
"Enable or disble uncertainty detection (UD).");
93 "UD.SupportAreaRatioMin",
95 "Minimal support area ratio of an object to consider it safe.")
109 return "ShapesSupportRelations";
129 debugDrawer.offeringTopic(*
this);
132 getProperty(pointCloudFrameName,
"pc.PointCloudFrameName");
135 supportAnalysis.setVertSepPlaneAngleMax(
getProperty<float>(
"GR.VerticalSepPlaneAngleMax"));
136 supportAnalysis.setVertSepPlaneAssumeSupport(
151 if (!robotStateComponent)
153 ARMARX_INFO <<
"RobotStateComponent is not available. Global gravity vector "
154 << gravityInGlobal.transpose() <<
" will be used.";
158 debugDrawer.getTopic(*
this);
167 robotStateComponent =
nullptr;
177 const data::ShapeList& objectsIce,
181 const semrel::ShapeMap objectsMap = semrel::toShapeMap(
objects);
183 std::set<semrel::ShapeID> safeObjectsIDs;
188 std::stringstream graphName;
189 graphName << this->graphName <<
" (" << name <<
")";
190 graphTopic->reportGraph(graphName.str(), graph);
195 const Ice::LongSeq& safeObjectIDsIce,
199 const semrel::ShapeMap objectsMap = semrel::toShapeMap(
objects);
201 std::set<semrel::ShapeID> safeObjectIDs;
202 for (
long id : safeObjectIDsIce)
204 safeObjectIDs.insert(semrel::ShapeID{
id});
213 const std::set<semrel::ShapeID>& safeObjectIDs)
216 supportAnalysis.setGravityVector(getGravityFromRobotStateComponent());
219 const semrel::SupportGraph supportGraph =
220 supportAnalysis.performSupportAnalysis(
objects, safeObjectIDs);
221 ARMARX_INFO <<
"Support Graph: " << supportGraph.str();
228 ShapesSupportRelations::getGravityFromRobotStateComponent()
232 return gravityInGlobal;
237 robotStateComponent,
"", {}, VirtualRobot::RobotIO::eStructure);
240 dir.changeFrame(robot, pointCloudFrameName);
241 return dir.toEigen();
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
TopicProxyType getTopicFromProperty(const std::string &propertyName)
Get a topic proxy whose name is specified by the given property.
void offeringTopicFromProperty(const std::string &propertyName)
Offer a topic whose name is specified by the given property.
void usingTopicFromProperty(const std::string &propertyName, bool orderedPublishing=false)
Use a topic whose name is specified by the given property.
ProxyType getProxyFromProperty(const std::string &propertyName, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true)
Get a proxy whose name is specified by the given property.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
std::string getName() const
Retrieve name of object.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
Property definitions of ShapesSupportRelations.
ShapesSupportRelationsPropertyDefinitions(std::string prefix)
Brief description of class ShapesSupportRelations.
void onInitComponent() override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onConnectComponent() 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.
static std::string GetDefaultName()
void onExitComponent() override
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.
#define ARMARX_INFO
The normal logging level.
std::string const GlobalFrame
Variable of the global coordinate system.
std::shared_ptr< class Robot > RobotPtr
const std::string visualizationLevelName
void defineVisualizationLevel(armarx::ComponentPropertyDefinitions &defs, const std::string &propertyName=defaults::visualizationLevelName, semrel::VisuLevel defaultLevel=semrel::VisuLevel::RESULT, const std::string &description=defaults::visualizationLevelDescription)
void setMinimumVisuLevel(armarx::PropertyUser &defs, const std::string &propertyName=defaults::visualizationLevelName)
void setArmarXHooksAsImplementation(const DebugDrawerInterfacePrx &debugDrawer, const std::string &logTag="SemanticObjectRelations")
semrel::AttributedGraph fromIce(const semantic::data::Graph &graph)
data::Graph toIce(const semrel::AttributedGraph &input)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.