CommonPlaceLoader.cpp
Go to the documentation of this file.
1 #include "CommonPlaceLoader.h"
2 
5 
7 {
8 
9  std::vector<CommonPlace>
10  CommonPlaceLoader::LoadCommonPlaces(const std::string& source, const nlohmann::json& js)
11  {
12  std::vector<CommonPlace> ret;
13  if (not js.contains("common_places"))
14  {
15  ARMARX_WARNING << "The common_places file has the wrong structure. Missing key "
16  "'common_places'.";
17  return ret;
18  }
19 
20  for (const auto& [locationName, priority] :
21  js["common_places"].get<std::map<std::string, int>>())
22  {
23  CommonPlace a{source, locationName, priority};
24  ret.push_back(a);
25  }
26  return ret;
27  }
28 } // namespace armarx::priorknowledge::util
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
ice_conversions.h
CommonPlaceLoader.h
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
armarx::priorknowledge::util::CommonPlace
Definition: CommonPlace.h:7
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
Logging.h
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::priorknowledge::util
Definition: AffordanceLoader.cpp:6
armarx::priorknowledge::util::CommonPlaceLoader::LoadCommonPlaces
static std::vector< CommonPlace > LoadCommonPlaces(const std::string &source, const nlohmann::json &)
Definition: CommonPlaceLoader.cpp:10