Go to the documentation of this file.
25 #include <SimoxUtility/algorithm/string/string_tools.h>
35 const std::string&
id,
36 const std::string& shape) :
50 armarx::Vector3BasePtr
53 return getAttributeValue(
"dimensionsOBB")->getClass<armarx::Vector3Base>();
60 putAttribute(
"dimensionsOBB", dimensions);
63 armarx::FramedPoseBasePtr
66 return getAttributeValue(
"pose")->getClass<armarx::FramedPoseBase>();
73 putAttribute(
"pose", pose);
79 auto entity = getAttribute(
"graspPoints");
80 if (!entity || entity->size() <= 0)
85 Eigen::MatrixXf m = armarx::VariantPtr::dynamicCast(entity->getValueAt(0))
90 result.reserve(m.cols());
92 for (
unsigned int i = 0; i < m.cols(); i++)
94 result.push_back(
new armarx::Vector3(Eigen::Vector3f(m.block<3, 1>(0, i))));
103 Eigen::MatrixXf m(3, graspPoints.size());
105 for (
unsigned int i = 0; i < graspPoints.size(); i++)
107 m.block<3, 1>(0, i) = armarx::Vector3Ptr::dynamicCast(graspPoints[i])->toEigen();
116 entity->addValue(variant);
123 auto entity = getAttribute(
"inliers");
124 if (!entity || entity->size() <= 0)
129 Eigen::MatrixXf m = armarx::VariantPtr::dynamicCast(entity->getValueAt(0))
134 result.reserve(m.cols());
136 for (
unsigned int i = 0; i < m.cols(); i++)
138 result.push_back(
new armarx::Vector3(Eigen::Vector3f(m.block<3, 1>(0, i))));
147 Eigen::MatrixXf m(3, inliers.size());
149 for (
unsigned int i = 0; i < inliers.size(); i++)
151 m.block<3, 1>(0, i) = armarx::Vector3Ptr::dynamicCast(inliers[i])->toEigen();
160 entity->addValue(variant);
167 return getAttributeValue(
"probability")->getFloat();
173 putAttribute(
"probability", probability);
179 return getAttributeValue(
"circularityprobability")->getFloat();
186 putAttribute(
"circularityprobability", probability);
192 return getAttributeValue(
"length")->getFloat();
198 putAttribute(
"length", length);
213 armarx::TimestampBasePtr
216 return getAttributeValue(
"time")->getClass<armarx::TimestampBase>();
223 putAttribute(
"time", time);
226 armarx::MatrixFloatBasePtr
230 if (!entity || entity->size() <= 0)
235 return armarx::VariantPtr::dynamicCast(entity->getValueAt(0))
241 const Ice::Current&
c)
247 entity->addValue(variant);
254 return this->
clone();
278 armarx::Vector3BasePtr planeNormal =
new armarx::Vector3(coeffs[0], coeffs[1], coeffs[2]);
283 armarx::Vector3BasePtr
286 return getAttributeValue(
"normal")->getClass<armarx::Vector3Base>();
293 putAttribute(
"normal", normal);
299 return getAttributeValue(
"distance")->getFloat();
311 return this->clone();
333 armarx::Vector3BasePtr
360 return this->clone();
378 Eigen::Vector3f base;
379 base << coeffs[0], coeffs[1], coeffs[2];
381 Eigen::Vector3f direction;
382 direction << coeffs[3], coeffs[4], coeffs[5];
390 armarx::Vector3BasePtr
402 armarx::Vector3BasePtr
410 const Ice::Current&
c)
430 return this->clone();
453 armarx::Vector3BasePtr
465 armarx::Vector3BasePtr
492 return this->
clone();
507 memoryx::EntityRefList
510 memoryx::EntityRefList result;
511 EntityAttributeBasePtr attribute =
getAttribute(
"sides");
512 for (
int i = 0; i < attribute->size(); i++)
515 result.push_back(
value->get<EntityRefBase>());
524 for (memoryx::EntityRefBasePtr ref : sides)
534 return this->
clone();
545 const std::string&
id) :
550 memoryx::EntityRefList
553 memoryx::EntityRefList result;
554 EntityAttributeBasePtr attribute =
getAttribute(
"primitives");
555 for (
int i = 0; i < attribute->size(); i++)
558 result.push_back(
value->get<EntityRefBase>());
565 const Ice::Current&
c)
568 for (memoryx::EntityRefBasePtr ref : primitives)
578 return putAttribute(
"labels", simox::alg::join(labels,
","));
585 std::vector<std::string> labels =
armarx::Split(attrValue,
",");
592 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
state::Type center(state::Type previous)
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