25#include <SimoxUtility/algorithm/string/string_tools.h>
35 const std::string&
id,
36 const std::string& shape) :
50 armarx::Vector3BasePtr
63 armarx::FramedPoseBasePtr
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);
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);
213 armarx::TimestampBasePtr
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
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();
The Variant class is described here: Variants.
BoxPrimitive(const std::string &name="", const std::string &id="")
BoxPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Ice::ObjectPtr ice_clone() const override
EntityRefList getBoxSides(const Ice::Current &c=Ice::emptyCurrent) const override
void setBoxSides(const EntityRefList &sides, const Ice::Current &c=Ice::emptyCurrent) override
ConePrimitive(const std::string &name="", const std::string &id="")
armarx::Vector3BasePtr getConeApex(const Ice::Current &c=Ice::emptyCurrent) const override
void setConeApex(const armarx::Vector3BasePtr &apex, const Ice::Current &c=Ice::emptyCurrent) override
void setConeOpeningAngle(float angle, const Ice::Current &c=Ice::emptyCurrent) override
armarx::Vector3BasePtr getConeAxisDirection(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
float getConeOpeningAngle(const Ice::Current &) const override
ConePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setConeAxisDirection(const armarx::Vector3BasePtr &axis, const Ice::Current &c=Ice::emptyCurrent) override
CylinderPrimitive(const std::string &name="", const std::string &id="")
void setCylinderPoint(const armarx::Vector3BasePtr &point, const Ice::Current &c=Ice::emptyCurrent) override
CylinderPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
float getCylinderRadius(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::Vector3BasePtr getCylinderAxisDirection(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
armarx::Vector3BasePtr getCylinderPoint(const Ice::Current &c=Ice::emptyCurrent) const override
void setCylinderAxisDirection(const armarx::Vector3BasePtr &axis, const Ice::Current &c=Ice::emptyCurrent) override
void setCylinderRadius(float radius, const Ice::Current &c=Ice::emptyCurrent) override
Attribute of MemoryX entities.
void setId(const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) override
Set id of this entity.
EntityAttributeBasePtr getAttribute(const ::std::string &attrName, const ::Ice::Current &=Ice::emptyCurrent) const override
Retrieve attribute from entity.
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
Entity(const Entity &source)
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
void putAttribute(const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
Store attribute in entity.
void setTime(const armarx::TimestampBasePtr &time, const Ice::Current &c=Ice::emptyCurrent) override
PointList getGraspPoints(const Ice::Current &c=Ice::emptyCurrent) const override
void setLabel(int label, const Ice::Current &c=Ice::emptyCurrent) override
PointList getInliers(const Ice::Current &c=Ice::emptyCurrent) const override
void setOBBDimensions(const armarx::Vector3BasePtr &dimensions, const Ice::Current &c=Ice::emptyCurrent) override
void setGraspPoints(const PointList &graspPoints, const Ice::Current &c=Ice::emptyCurrent) override
void setSampling(const armarx::MatrixFloatBasePtr &sampling, const Ice::Current &c=Ice::emptyCurrent) override
void setInliers(const PointList &inliers, const Ice::Current &c=Ice::emptyCurrent) override
void setCircularityProbability(float probability, const Ice::Current &c=Ice::emptyCurrent) override
EnvironmentalPrimitive(const std::string &name="", const std::string &id="", const std::string &shape="")
void setLength(float length, const Ice::Current &c=Ice::emptyCurrent) override
float getCircularityProbability(const Ice::Current &c=Ice::emptyCurrent) const override
std::string getShape(const Ice::Current &c=Ice::emptyCurrent) const override
void setShape(const std::string &shape, const Ice::Current &c=Ice::emptyCurrent) override
float getProbability(const Ice::Current &c=Ice::emptyCurrent) const override
int getLabel(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::FramedPoseBasePtr getPose(const Ice::Current &c=Ice::emptyCurrent) const override
EnvironmentalPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setProbability(float probability, const Ice::Current &c=Ice::emptyCurrent) override
Ice::ObjectPtr ice_clone() const override
float getLength(const Ice::Current &c=Ice::emptyCurrent) const override
void setPose(const armarx::FramedPoseBasePtr &pose, const Ice::Current &c=Ice::emptyCurrent) override
armarx::TimestampBasePtr getTime(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::MatrixFloatBasePtr getSampling(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::Vector3BasePtr getOBBDimensions(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::StringSeq getLabels(const Ice::Current &c=Ice::emptyCurrent) const override
EntityRefList getPrimitives(const Ice::Current &c=Ice::emptyCurrent) const override
void setPrimitives(const EntityRefList &primitives, const Ice::Current &c=Ice::emptyCurrent) override
void setLabels(const Ice::StringSeq &labels, const Ice::Current &c=Ice::emptyCurrent) override
Ice::ObjectPtr ice_clone() const override
HigherSemanticStructurePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
HigherSemanticStructure(const std::string &name="", const std::string &id="")
PlanePrimitive(const std::string &name="", const std::string &id="")
armarx::Vector3BasePtr getPlaneNormal(const Ice::Current &c=Ice::emptyCurrent) const override
void setPlaneDistance(float distance, const Ice::Current &c=Ice::emptyCurrent) override
PlanePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Ice::ObjectPtr ice_clone() const override
float getPlaneDistance(const Ice::Current &c=Ice::emptyCurrent) const override
void setPlaneNormal(const armarx::Vector3BasePtr &normal, const Ice::Current &c=Ice::emptyCurrent) override
SpherePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setSphereRadius(float radius, const Ice::Current &c=Ice::emptyCurrent) override
armarx::Vector3BasePtr getSphereCenter(const Ice::Current &c=Ice::emptyCurrent) const override
SpherePrimitive(const std::string &name="", const std::string &id="")
Ice::ObjectPtr ice_clone() const override
void setSphereCenter(const armarx::Vector3BasePtr ¢er, const Ice::Current &c=Ice::emptyCurrent) override
float getSphereRadius(const Ice::Current &c=Ice::emptyCurrent) const override
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
IceInternal::Handle< Variant > VariantPtr
IceInternal::Handle< SpherePrimitive > SpherePrimitivePtr
IceInternal::Handle< EntityAttribute > EntityAttributePtr
Typedef of EntityAttributePtr as IceInternal::Handle<EntityAttribute> for convenience.
IceInternal::Handle< HigherSemanticStructure > HigherSemanticStructurePtr
IceInternal::Handle< PlanePrimitive > PlanePrimitivePtr
IceInternal::Handle< ConePrimitive > ConePrimitivePtr
IceInternal::Handle< EnvironmentalPrimitive > EnvironmentalPrimitivePtr
IceInternal::Handle< BoxPrimitive > BoxPrimitivePtr
IceInternal::Handle< CylinderPrimitive > CylinderPrimitivePtr
double distance(const Point &a, const Point &b)
double angle(const Point &a, const Point &b, const Point &c)