Skip to content
Snippets Groups Projects
Commit 7d7a3907 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Allow ObjectMemory to load multiple scenes on startup

parent 71f14ac9
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@
#include <ArmarXCore/core/time/TimeUtil.h>
#include <SimoxUtility/algorithm/get_map_keys_values.h>
#include <SimoxUtility/algorithm/string.h>
#include <SimoxUtility/json.h>
#include <SimoxUtility/math/pose/pose.h>
......@@ -100,8 +101,9 @@ namespace armarx::armem::server::obj::instance
defs->optional(p.sceneSnapshotsDirectory, prefix + "scene.11_Directory",
"Directory in Package/data/Package/ containing the scene snapshots.");
defs->optional(p.sceneSnapshotToLoad, prefix + "scene.12_SnapshotToLoad",
"Scene snapshot to load on startup (e.g. 'Scene_2021-06-24_20-20-03').\n"
"You can also specify paths relative to 'Package/scenes/'.");
"Scene to load on startup (e.g. 'Scene_2021-06-24_20-20-03').\n"
"You can also specify paths relative to 'Package/scenes/'. \n"
"You can also specify a ; separated list of scenes.");
decay.defineProperties(defs, prefix + "decay.");
}
......@@ -113,8 +115,13 @@ namespace armarx::armem::server::obj::instance
if (not p.sceneSnapshotToLoad.empty())
{
bool lockMemory = false;
commitSceneSnapshotFromFilename(p.sceneSnapshotToLoad, lockMemory);
bool trim = true;
const std::vector<std::string> scenes = simox::alg::split(p.sceneSnapshotToLoad, ";", trim);
for (const std::string& scene : scenes)
{
const bool lockMemory = false;
commitSceneSnapshotFromFilename(scene, lockMemory);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment