Skip to content
Snippets Groups Projects

Add Names to Locations

Merged Rainer Kartmann requested to merge names into master
1 file
+ 15
3
Compare changes
  • Side-by-side
  • Inline
@@ -6,6 +6,8 @@
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <ArmarXCore/core/logging/Logging.h>
#include <RobotAPI/libraries/core/json_conversions.h>
namespace armarx::priorknowledge::util
{
FramedLocationPtr
@@ -53,8 +55,18 @@ namespace armarx::priorknowledge::util
pose,
framedPose.at("pose").get<std::vector<std::vector<float>>>()); // load the 4x4 matrix
FramedLocationPtr loc(new FramedLocation(
LocationId(source, locationName), LocationType::FRAMED_LOCATION, frame, agent, pose));
std::optional<Names> names;
if (auto it = j.find("names"); it != j.end())
{
it->get_to(names.emplace());
}
FramedLocationPtr loc(new FramedLocation(LocationId(source, locationName),
LocationType::FRAMED_LOCATION,
frame,
agent,
pose,
names));
return loc;
}
@@ -133,7 +145,7 @@ namespace armarx::priorknowledge::util
}
for (const auto& [locationName, j] :
js["locations"].get<std::map<std::string, nlohmann::json>>())
js.at("locations").get<std::map<std::string, nlohmann::json>>())
{
if (j.find("framedPose") != j.end())
{
Loading