Skip to content
Snippets Groups Projects

Feature/location graph export

Merged Fabian Reister requested to merge feature/location-graph-export into master
1 unresolved thread
1 file
+ 8
4
Compare changes
  • Side-by-side
  • Inline
@@ -529,11 +529,11 @@ namespace armarx::navigation
for (const auto& [memoryId, location] : locations)
{
auto& j = js[memoryId.coreSegmentName];
auto& j = js[memoryId.providerSegmentName];
if (j.count("locations") == 0)
{
j["locations"] = nlohmann::json::array();
j["locations"] = {};
}
nlohmann::json jLoc;
@@ -554,7 +554,7 @@ namespace armarx::navigation
jLoc["relativeToObject"] = "null";
}
j["locations"].push_back(jLoc);
j["locations"][memoryId.getEntityID().str()] = jLoc;
}
// save to disk
@@ -562,7 +562,11 @@ namespace armarx::navigation
{
const std::filesystem::path subDir = std::filesystem::path(providerId);
const std::filesystem::path dir = baseDirectory / subDir;
std::filesystem::create_directories(dir);
if(not std::filesystem::exists(dir))
{
std::filesystem::create_directories(dir);
}
const std::filesystem::path filename = dir / "locations.json";
ARMARX_VERBOSE << "Saving file `" << filename << "`.";
Loading