Go to the documentation of this file.
29 #include <SimoxUtility/algorithm/string/string_tools.h>
49 return getAttributeValue(
"dimensionsOBB")->getClass<armarx::Vector3Base>();
54 putAttribute(
"dimensionsOBB", dimensions);
59 return getAttributeValue(
"pose")->getClass<armarx::FramedPoseBase>();
64 putAttribute(
"pose", pose);
69 auto entity = getAttribute(
"graspPoints");
70 if (!entity || entity->size() <= 0)
78 result.reserve(m.cols());
80 for (
unsigned int i = 0; i < m.cols(); i++)
82 result.push_back(
new armarx::Vector3(Eigen::Vector3f(m.block<3, 1>(0, i))));
90 Eigen::MatrixXf m(3, graspPoints.size());
92 for (
unsigned int i = 0; i < graspPoints.size(); i++)
94 m.block<3, 1>(0, i) = armarx::Vector3Ptr::dynamicCast(graspPoints[i])->toEigen();
103 entity->addValue(variant);
111 auto entity = getAttribute(
"inliers");
112 if (!entity || entity->size() <= 0)
120 result.reserve(m.cols());
122 for (
unsigned int i = 0; i < m.cols(); i++)
124 result.push_back(
new armarx::Vector3(Eigen::Vector3f(m.block<3, 1>(0, i))));
132 Eigen::MatrixXf m(3, inliers.size());
134 for (
unsigned int i = 0; i < inliers.size(); i++)
136 m.block<3, 1>(0, i) = armarx::Vector3Ptr::dynamicCast(inliers[i])->toEigen();
145 entity->addValue(variant);
151 return getAttributeValue(
"probability")->getFloat();
156 putAttribute(
"probability", probability);
161 return getAttributeValue(
"circularityprobability")->getFloat();
166 putAttribute(
"circularityprobability", probability);
171 return getAttributeValue(
"length")->getFloat();
176 putAttribute(
"length", length);
191 return getAttributeValue(
"time")->getClass<armarx::TimestampBase>();
196 putAttribute(
"time", time);
202 if (!entity || entity->size() <= 0)
207 return armarx::VariantPtr::dynamicCast(entity->getValueAt(0))->getClass<
armarx::MatrixFloat>();
216 entity->addValue(variant);
222 return this->
clone();
245 armarx::Vector3BasePtr planeNormal =
new armarx::Vector3(coeffs[0], coeffs[1], coeffs[2]);
252 return getAttributeValue(
"normal")->getClass<armarx::Vector3Base>();
257 putAttribute(
"normal", normal);
262 return getAttributeValue(
"distance")->getFloat();
272 return this->clone();
317 return this->clone();
335 Eigen::Vector3f base;
336 base << coeffs[0], coeffs[1], coeffs[2];
338 Eigen::Vector3f direction;
339 direction << coeffs[3], coeffs[4], coeffs[5];
379 return this->clone();
434 return this->
clone();
453 memoryx::EntityRefList result;
454 EntityAttributeBasePtr attribute =
getAttribute(
"sides");
455 for (
int i = 0; i < attribute->size(); i++)
458 result.push_back(
value->get<EntityRefBase>());
466 for (memoryx::EntityRefBasePtr ref : sides)
478 return this->
clone();
497 memoryx::EntityRefList result;
498 EntityAttributeBasePtr attribute =
getAttribute(
"primitives");
499 for (
int i = 0; i < attribute->size(); i++)
502 result.push_back(
value->get<EntityRefBase>());
510 for (memoryx::EntityRefBasePtr ref : primitives)
521 return putAttribute(
"labels", simox::alg::join(labels,
","));
528 std::vector<std::string> labels =
armarx::Split(attrValue,
",");
535 return this->
clone();
CylinderPrimitive(const std::string &name="", const std::string &id="")
The Variant class is described here: Variants.
void setPose(const armarx::FramedPoseBasePtr &pose, const Ice::Current &c=Ice::emptyCurrent) override
PlanePrimitive(const std::string &name="", const std::string &id="")
ReaderT::InputType T & ret
std::string getShape(const Ice::Current &c=Ice::emptyCurrent) const override
EntityRefList getPrimitives(const Ice::Current &c=Ice::emptyCurrent) const override
void setTime(const armarx::TimestampBasePtr &time, const Ice::Current &c=Ice::emptyCurrent) override
const armarx::VariantTypeId PlanePrimitive
Ice::ObjectPtr ice_clone() const override
Eigen::Matrix4f toEigen(data::GlobalPose const &pose)
void putAttribute(const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
Store attribute in entity.
PlanePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
EntityAttributeBasePtr getAttribute(const ::std::string &attrName, const ::Ice::Current &=Ice::emptyCurrent) const override
Retrieve attribute from entity.
armarx::Vector3BasePtr getCylinderAxisDirection(const Ice::Current &c=Ice::emptyCurrent) const override
SpherePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
EnvironmentalPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
armarx::Vector3BasePtr getSphereCenter(const Ice::Current &c=Ice::emptyCurrent) const override
const armarx::VariantTypeId SpherePrimitive
void setPrimitives(const EntityRefList &primitives, const Ice::Current &c=Ice::emptyCurrent) override
float getCircularityProbability(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
void setSphereRadius(float radius, const Ice::Current &c=Ice::emptyCurrent) override
armarx::Vector3BasePtr getConeApex(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::Vector3BasePtr getConeAxisDirection(const Ice::Current &c=Ice::emptyCurrent) const override
EnvironmentalPrimitive(const std::string &name="", const std::string &id="", const std::string &shape="")
ConePrimitive(const std::string &name="", const std::string &id="")
armarx::TimestampBasePtr getTime(const Ice::Current &c=Ice::emptyCurrent) const override
float getConeOpeningAngle(const Ice::Current &) const override
void setConeApex(const armarx::Vector3BasePtr &apex, const Ice::Current &c=Ice::emptyCurrent) override
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
armarx::FramedPoseBasePtr getPose(const Ice::Current &c=Ice::emptyCurrent) const override
void setCylinderPoint(const armarx::Vector3BasePtr &point, const Ice::Current &c=Ice::emptyCurrent) override
const armarx::VariantTypeId CylinderPrimitive
Ice::ObjectPtr ice_clone() const override
void setBoxSides(const EntityRefList &sides, const Ice::Current &c=Ice::emptyCurrent) override
std::shared_ptr< Value > value()
void setCircularityProbability(float probability, const Ice::Current &c=Ice::emptyCurrent) override
void setPlaneNormal(const armarx::Vector3BasePtr &normal, const Ice::Current &c=Ice::emptyCurrent) override
int getLabel(const Ice::Current &c=Ice::emptyCurrent) const override
void setProbability(float probability, const Ice::Current &c=Ice::emptyCurrent) override
armarx::MatrixFloatBasePtr getSampling(const Ice::Current &c=Ice::emptyCurrent) const override
float getProbability(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
float getLength(const Ice::Current &c=Ice::emptyCurrent) const override
void setCylinderRadius(float radius, const Ice::Current &c=Ice::emptyCurrent) override
void setId(const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) override
Set id of this entity.
void setPlaneDistance(float distance, const Ice::Current &c=Ice::emptyCurrent) override
HigherSemanticStructurePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
SpherePrimitive(const std::string &name="", const std::string &id="")
armarx::Vector3BasePtr getPlaneNormal(const Ice::Current &c=Ice::emptyCurrent) const override
void setLabels(const Ice::StringSeq &labels, const Ice::Current &c=Ice::emptyCurrent) override
void setGraspPoints(const PointList &graspPoints, const Ice::Current &c=Ice::emptyCurrent) override
void setCylinderAxisDirection(const armarx::Vector3BasePtr &axis, const Ice::Current &c=Ice::emptyCurrent) override
BoxPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
float getSphereRadius(const Ice::Current &c=Ice::emptyCurrent) const override
float getCylinderRadius(const Ice::Current &c=Ice::emptyCurrent) const override
void setInliers(const PointList &inliers, const Ice::Current &c=Ice::emptyCurrent) override
HigherSemanticStructure(const std::string &name="", const std::string &id="")
Ice::StringSeq getLabels(const Ice::Current &c=Ice::emptyCurrent) const override
void setSphereCenter(const armarx::Vector3BasePtr ¢er, const Ice::Current &c=Ice::emptyCurrent) override
Attribute of MemoryX entities.
double angle(const Point &a, const Point &b, const Point &c)
void setConeAxisDirection(const armarx::Vector3BasePtr &axis, const Ice::Current &c=Ice::emptyCurrent) override
PointList getGraspPoints(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
double distance(const Point &a, const Point &b)
void setConeOpeningAngle(float angle, const Ice::Current &c=Ice::emptyCurrent) override
std::shared_ptr< Object > ObjectPtr
BoxPrimitive(const std::string &name="", const std::string &id="")
void setShape(const std::string &shape, const Ice::Current &c=Ice::emptyCurrent) override
void setOBBDimensions(const armarx::Vector3BasePtr &dimensions, const Ice::Current &c=Ice::emptyCurrent) override
CylinderPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
armarx::Vector3BasePtr getOBBDimensions(const Ice::Current &c=Ice::emptyCurrent) const override
PointList getInliers(const Ice::Current &c=Ice::emptyCurrent) const override
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
void setSampling(const armarx::MatrixFloatBasePtr &sampling, const Ice::Current &c=Ice::emptyCurrent) override
armarx::Vector3BasePtr getCylinderPoint(const Ice::Current &c=Ice::emptyCurrent) const override
EntityRefList getBoxSides(const Ice::Current &c=Ice::emptyCurrent) const override
ConePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Ice::ObjectPtr ice_clone() const override
void setLabel(int label, const Ice::Current &c=Ice::emptyCurrent) override
Ice::ObjectPtr ice_clone() const override
void setLength(float length, const Ice::Current &c=Ice::emptyCurrent) override
float getPlaneDistance(const Ice::Current &c=Ice::emptyCurrent) const override