24 Base(memoryToIceAdapter,
"MotionDatabase",
"Motion",
armarx::motion::mdb::arondto::MDBReference::ToAronType())
32 defs->optional(properties.motionsPackage, prefix +
"MotionsPackage",
"Name of the prior knowledge package to load from.");
33 defs->optional(properties.loadFromMotionsPackage, prefix +
"LoadFromMotionsPackage",
"If true, load the motions from the motions package on startup.");
40 if (properties.loadFromMotionsPackage)
42 loadByMotionFinder(properties.motionsPackage);
51 int MDBMotionSegment::loadByMotionFinder(
const std::string& packageName)
54 int loadedMotions = 0;
56 ARMARX_INFO <<
"Load Motions from package" << std::endl;
59 auto allMotions = motionFinder.findAll(
"mdb");
60 for (
const auto& motionFinderInfo : allMotions)
62 auto pathToInfoJson = motionFinderInfo.getFullPath() / motionFinderInfo.getID() / (motionFinderInfo.getID() +
".json");
66 ss <<
"Found valid instance at: " << pathToInfoJson <<
". The motionID is: ";
67 for (
const auto& [key, attachedFiles] : op->attachedFiles)
69 for (
const auto& attachedFile : attachedFiles)
71 ss <<
"\n" << attachedFile.fileName <<
" (" << key <<
")";
76 auto& snapshot = entity.
addSnapshot(op->createdDate);
83 instance.
data() = op->toAron();
87 ARMARX_WARNING <<
"Found an invalid path to a motion file: " << pathToInfoJson;
91 loadedMotions += allMotions.size();