23 Base(memoryToIceAdapter,
26 armarx::motion::mdb::arondto::MDBReference::ToAronType())
32 const std::string& prefix)
36 defs->optional(properties.motionsPackage,
37 prefix +
"MotionsPackage",
38 "Name of the prior knowledge package to load from.");
39 defs->optional(properties.loadFromMotionsPackage,
40 prefix +
"LoadFromMotionsPackage",
41 "If true, load the motions from the motions package on startup.");
49 if (properties.loadFromMotionsPackage)
51 loadByMotionFinder(properties.motionsPackage);
61 MDBMotionSegment::loadByMotionFinder(
const std::string& packageName)
64 int loadedMotions = 0;
66 ARMARX_INFO <<
"Load Motions from package" << std::endl;
69 auto allMotions = motionFinder.findAll(
"mdb");
70 for (
const auto& motionFinderInfo : allMotions)
72 auto pathToInfoJson = motionFinderInfo.getFullPath() / motionFinderInfo.getID() /
73 (motionFinderInfo.getID() +
".json");
77 ss <<
"Found valid instance at: " << pathToInfoJson <<
". The motionID is: ";
78 for (
const auto& [key, attachedFiles] : op->attachedFiles)
80 for (
const auto& attachedFile : attachedFiles)
82 ss <<
"\n" << attachedFile.fileName <<
" (" << key <<
")";
87 auto& snapshot = entity.
addSnapshot(op->createdDate);
94 instance.
data() = op->toAron();
98 ARMARX_WARNING <<
"Found an invalid path to a motion file: " << pathToInfoJson;
102 loadedMotions += allMotions.size();
105 return loadedMotions;