63 return EntityPtr::dynamicCast(
getEntity())
76 return EntityPtr::dynamicCast(
getEntity())
87 if (recognitionMethod !=
"")
89 EntityAttributeBasePtr recognitionMethodAttr =
91 recognitionMethodAttr->setValue(
new armarx::Variant(recognitionMethod));
92 getEntity()->putAttribute(recognitionMethodAttr);
99 if (defaultMotionModel !=
"")
103 getEntity()->putAttribute(motionModelAttr);
118 EntityAttributeBasePtr recognitionQueryAttr =
121 getEntity()->putAttribute(recognitionQueryAttr);
125 LocalizationQueryList
128 LocalizationQueryList resultList;
137 for (
int e = 0; e < numberElements; e++)
157 for (
int e = 0; e < numberElements; e++)
163 if (currentQueryName == queryName)
186 for (
int e = 0; e < numberElements; e++)
195 if (currentQuery->queryName != queryName)
197 newVar->setClass(LocalizationQueryPtr::dynamicCast(currentQuery->ice_clone()));
201 newVar->setClass(LocalizationQueryPtr::dynamicCast(query->ice_clone()));
204 updatedQueries->addValue(newVar);
208 getEntity()->putAttribute(updatedQueries);
228 return featureFileName;
236 const std::string& filesDBName)
238 if (featureFileName !=
"")
241 fileManager->storeFileToAttr(filesDBName, featureFileName, featureFileAttr);
243 getEntity()->putAttribute(featureFileAttr);
261 std::vector<std::string> fileNames;
269 if (fileNames.size() == 0)
275 std::filesystem::path path;
276 path = fileNames.at(0);
278 return path.parent_path().c_str();
283 const std::string& filesDBName)
291 fileManager->storeDirectoryToAttr(filesDBName, dataPath, featureFileAttr);
295 getEntity()->putAttribute(featureFileAttr);
304 return (ObjectColor)EntityPtr::dynamicCast(
getEntity())
317 getEntity()->putAttribute(objectColorAttr);
336 return (ObjectColor)EntityPtr::dynamicCast(
getEntity())
351 getEntity()->putAttribute(objectColorAttr);
367 std::vector<int> result;
374 for (
int i = 0; i < attr->size(); i++)
376 result.push_back(attr->getValueAt(i)->getInt());
392 for (
size_t i = 0; i < newMarkerIDs.size(); i++)
403 std::vector<float> result;
410 for (
int i = 0; i < attr->size(); i++)
412 result.push_back(attr->getValueAt(i)->getFloat());
429 for (
size_t i = 0; i < newMarkerSizes.size(); i++)
437 std::vector<Eigen::Vector3f>
440 std::vector<Eigen::Vector3f> result;
447 for (
int i = 0; i < attr->size(); i++)
449 armarx::Vector3BasePtr vecBase =
450 armarx::VariantPtr::dynamicCast(attr->getValueAt(i))
451 ->getClass<armarx::Vector3Base>();
456 result.push_back(vec);
470 const std::vector<Eigen::Vector3f>& newTranslations)
474 for (
size_t i = 0; i < newTranslations.size(); i++)
483 std::vector<Eigen::Vector3f>
486 std::vector<Eigen::Vector3f> result;
493 for (
int i = 0; i < attr->size(); i++)
495 armarx::Vector3BasePtr vecBase =
496 armarx::VariantPtr::dynamicCast(attr->getValueAt(i))
497 ->getClass<armarx::Vector3Base>();
502 result.push_back(vec);
516 const std::vector<Eigen::Vector3f>& newRotations)
520 for (
size_t i = 0; i < newRotations.size(); i++)
529 std::vector<Eigen::Matrix4f>
532 std::vector<Eigen::Matrix4f> result;
541 for (
int i = 0; i < attrTransl->size() && i < attrRot->size(); i++)
543 Eigen::Matrix4f newTrafo = Eigen::Matrix4f::Identity();
544 armarx::Vector3BasePtr vecBase =
545 armarx::VariantPtr::dynamicCast(attrTransl->getValueAt(i))
546 ->getClass<armarx::Vector3Base>();
547 newTrafo(0, 3) = vecBase->x;
548 newTrafo(1, 3) = vecBase->y;
549 newTrafo(2, 3) = vecBase->z;
550 vecBase = armarx::VariantPtr::dynamicCast(attrRot->getValueAt(i))
551 ->getClass<armarx::Vector3Base>();
552 newTrafo.block<3, 3>(0, 0) =
553 (Eigen::AngleAxisf(vecBase->x, Eigen::Vector3f::UnitX()) *
554 Eigen::AngleAxisf(vecBase->y, Eigen::Vector3f::UnitY()) *
555 Eigen::AngleAxisf(vecBase->z, Eigen::Vector3f::UnitZ()))
557 result.push_back(newTrafo);
594 const std::string& filesDBName)
599 fileManager->storeFileToAttr(filesDBName, fileName, fileAttr);
607 float& mismatchDistance)
621 expectedMatchDistance = 0;
622 mismatchDistance = 0;
628 const float mismatchDistance)
632 expectedMatchDistanceAttr->setValue(
new armarx::Variant(expectedMatchDistance));
633 getEntity()->putAttribute(expectedMatchDistanceAttr);
636 getEntity()->putAttribute(mismatchDistanceAttr);
The Variant class is described here: Variants.
Attribute of MemoryX entities.
EntityBasePtr getEntity() const
Get the stored name of the stored entity.
AbstractFileEntityWrapper(GridFileManagerPtr fileManager)
GridFileManagerPtr fileManager
std::string cacheAttributeFile(const std::string &attrName, bool preserveOriginalFName=false) const
void cleanUpAttributeFiles(EntityAttributeBasePtr oldAttr, EntityAttributeBasePtr newAttr)
cleanUpAttributeFiles compares the files attached to the two given attributes and removes the files o...
std::vector< int > getArMarkerIDs() const
std::vector< float > getArMarkerSizes() const
std::vector< Eigen::Matrix4f > getTransformationsToCenter() const
ArMarkerWrapper(const GridFileManagerPtr &gfm)
Constructs new ArMarkerWrapper.
std::vector< Eigen::Vector3f > getTransformationToCenterTranslations() const
void setTransformationToCenterRotationsRPY(const std::vector< Eigen::Vector3f > &newRotations)
void setArMarkerIDs(const std::vector< int > &newMarkerIDs)
std::vector< Eigen::Vector3f > getTransformationToCenterRotationsRPY() const
Ice::ObjectPtr ice_clone() const override
void setTransformationToCenterTranslations(const std::vector< Eigen::Vector3f > &newTranslations)
void setArMarkerSizes(const std::vector< float > &newMarkerSizes)
HandMarkerBallWrapper(const GridFileManagerPtr &gfm)
Constructs new HandMarkerBallWrapper.
void setObjectColor(const ObjectColor &color)
ObjectColor getObjectColor() const
Ice::ObjectPtr ice_clone() const override
std::string getRecognitionMethod() const
LocalizationQueryList getLocalizationQueries()
void setDefaultMotionModel(const std::string &defaultMotionModel)
void addLocalizationQuery(const LocalizationQueryPtr &query)
void removeLocalizationQuery(const std::string &queryName)
void updateLocalizationQuery(const std::string &queryName, const LocalizationQueryPtr &query)
void setRecognitionMethod(const std::string &recognitionMethod)
Ice::ObjectPtr ice_clone() const override
std::string getDefaultMotionModel() const
PointCloudLocalizerWrapper(const GridFileManagerPtr &gfm)
Constructs new PointCloudLocalizerWrapper.
std::string getPointCloudFileName() const
void setPointCloudFileName(const std::string &fileName, const std::string &filesDBName)
Ice::ObjectPtr ice_clone() const override
void getExpectedMatchingDistance(float &expectedMatchDistance, float &mismatchDistance)
void setExpectedMatchingDistance(const float expectedMatchDistance, const float mismatchDistance)
std::string getDataFiles() const
SegmentableRecognitionWrapper(const GridFileManagerPtr &gfm)
Constructs new SegmentableRecognitionWrapper.
void setObjectColor(const ObjectColor &color)
ObjectColor getObjectColor() const
Ice::ObjectPtr ice_clone() const override
void setDataFiles(const std::string &dataPath, const std::string &filesDBName)
std::string getFeatureFile() const
void setFeatureFile(const std::string &featureFileName, const std::string &filesDBName)
TexturedRecognitionWrapper(const GridFileManagerPtr &gfm)
Constructs new TexturedRecognitionWrapper.
Ice::ObjectPtr ice_clone() const override
The LocalizationQuery class is used to create LocalizationJob instances and provide an interface to q...
#define ARMARX_ERROR_S
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_IMPORTANT_S
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_WARNING_S
The logging level for unexpected behaviour, but not a serious problem.
const armarx::VariantTypeId LocalizationQuery
IceInternal::Handle< Variant > VariantPtr
const std::string ATTR_AR_MARKER_ROTATION
const std::string ATTR_RECOGNITION_METHOD
const std::string ATTR_SEGMENTABLE_DATA
const std::string ATTR_OBJECT_COLOR
const std::string ATTR_AR_MARKER_SIZE
const std::string ATTR_AR_MARKER_ID
const std::string ATTR_AR_MARKER_TRANSLATION
const std::string ATTR_MOTION_MODEL
const std::string ATTR_RECOGNITION_QUERIES
const std::string POINTCLOUD_MISMATCH_DIST
const std::string POINTCLOUD_EXP_MATCH_DIST
const std::string POINTCLOUD_FILE
const std::string ATTR_FEATURE_FILE
IceInternal::Handle< LocalizationQuery > LocalizationQueryPtr
IceInternal::Handle< EntityAttribute > EntityAttributePtr
Typedef of EntityAttributePtr as IceInternal::Handle<EntityAttribute> for convenience.
IceInternal::Handle< Entity > EntityPtr
Typedef of EntityPtr as IceInternal::Handle<Entity> for convenience.
std::shared_ptr< GridFileManager > GridFileManagerPtr