diff --git a/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h b/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h index 99df8e2e6177be8f39f019342352762724fa7bf1..e085590fe495449d9f5b1893ce6eb5f6e6f87662 100644 --- a/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h +++ b/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h @@ -52,6 +52,8 @@ namespace armarx::armem::server::ltm::detail configure() { bool en = p.enabled_on_startup; + ARMARX_INFO << VAROUT(p.import_name); + ARMARX_INFO << VAROUT(p.import_path); ARMARX_INFO << VAROUT(p.configuration_on_startup); ARMARX_INFO << VAROUT(p.export_name); this->setExportName(p.export_name); @@ -75,6 +77,12 @@ namespace armarx::armem::server::ltm::detail { this->startRecording(); } + + std::string importPath = p.import_path; + + if (importPath.length() > 0){ + this->loadOnStartup(); + } } /// enable this LTM @@ -203,6 +211,8 @@ namespace armarx::armem::server::ltm::detail defs->optional(p.enabled_on_startup, prefix + "enabled"); defs->optional(p.configuration_on_startup, prefix + "configuration"); defs->optional(p.export_name, prefix + "exportName"); + defs->optional(p.import_name, prefix + "importName"); + defs->optional(p.import_path, prefix + "importPath"); } /// enable/disable @@ -270,6 +280,16 @@ namespace armarx::armem::server::ltm::detail return "LT-Memory"; } + void loadOnStartup(){ + ARMARX_INFO << "Loading on startup from " << p.import_path << "/" << p.import_name; + try{ + this->loadAllAndResolve(); + } + catch(...){ + ARMARX_INFO << "Could not load memory " << this->name() << " on startup"; + } + } + protected: /// configuration virtual void @@ -307,6 +327,8 @@ namespace armarx::armem::server::ltm::detail "\"PngConverter\": {}, \"ExrConverter\": {}}"; //record with 20 fps as standard std::string export_name = "MemoryExport"; std::string export_path = "/tmp/ltm"; + std::string import_path = "/tmp/ltm"; + std::string import_name = "MemoryExport"; } p; protected: