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 (" << source
16 << ") has the wrong structure. Missing key '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
static std::vector< CommonPlace > LoadCommonPlaces(const std::string &source, const nlohmann::json &)
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193