Go to the documentation of this file.
31 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
32 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
47 defineOptionalProperty<std::string>(
"objectToGrasp",
"",
"the object for which the grasp should be planned");
67 return "GraspingManagerTest";
86 srand(IceUtil::Time::now().toMicroSeconds());
94 std::string objectName = getProperty<std::string>(
"objectToGrasp").getValue();
95 wm = getProxy<memoryx::WorkingMemoryInterfacePrx>(
"WorkingMemory");
99 auto object = wm->getObjectInstancesSegment()->getEntityByName(objectName);
123 prior = getProxy<memoryx::PriorKnowledgeInterfacePrx>(
"PriorKnowledge");
127 object = wm->getObjectInstancesSegment()->getEntityByName(objectName);
130 ARMARX_INFO <<
"object initialized, generating grasping trajectory";
131 auto result = gm->generateGraspingTrajectory(object->getId());
137 poseTraj->setVariant(
"posetrajectory",
new Variant(result.poseTrajectory));
138 ARMARX_INFO <<
"Pose Trajectory: " << poseTraj->asString(
true);
148 jointTraj->setVariant(
"jointtrajectory",
new Variant(result.poseTrajectory));
149 ARMARX_INFO <<
"Joint Trajectory: " << jointTraj->asString(
true);
176 memoryx::PriorKnowledgeInterfacePrx prior;
177 memoryx::WorkingMemoryInterfacePrx wm;
178 GraspingManagerInterfacePrx gm;
The Variant class is described here: Variants.
The JSONObject class is used to represent and (de)serialize JSON objects.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
void onConnectComponent() override
void onDisconnectComponent() override
void onExitComponent() override
std::string getDefaultName() const override
Baseclass for all ArmarX ManagedIceObjects requiring properties.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
The ManagedIceObject is the base class for all ArmarX objects.
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Default component property definition container.
GraspingManagerTestPropertyDefinitions(std::string prefix)
void onInitComponent() override
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
This file offers overloads of toIce() and fromIce() functions for STL container types.