diff --git a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp index 1102b72cf1efaebb4a3d82d0273244dec69bc686..8253755604e04e1d65c4f7a67e6c04857eb52669 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp +++ b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp @@ -428,15 +428,23 @@ namespace armarx::armem::gui for (auto& [path, memory] : data) { std::string name = memory.id().memoryName; + auto commit = armem::toCommit(memory); if (memoryWriters.count(name) > 0) { - auto commit = armem::toCommit(memory); memoryWriters.at(name).commit(commit); } else { - ARMARX_WARNING << "No memory with name " << name << " available for commit."; + ARMARX_INFO << "No memory with name " << name << " available for commit. Create new virtual memory."; + + // Please note: Here we assume that a memory server with the same name does not exist. + // I think this assumption is ok, since nobody should use filepaths as memory name. + // Nontheless, we did not restrict the user to do so... + std::string virtualMemoryName = name + " (at " + path.string() + ")"; + wm::Memory virtualMemory(virtualMemoryName); + virtualMemory.update(commit, true, false); + memoryData[virtualMemoryName] = virtualMemory; } }