blob: 2075d30378cc9158fbbc8657307f2acf8184136a [file] [log] [blame]
Patrick Ventureeeeb8672019-02-08 11:47:42 -08001#pragma once
2
3#include "conf.hpp"
4
Patrick Ventureeeeb8672019-02-08 11:47:42 -08005#include <nlohmann/json.hpp>
Patrick Venturea83a3ec2020-08-04 09:52:05 -07006
7#include <map>
Patrick Ventureeeeb8672019-02-08 11:47:42 -08008#include <string>
9
10using json = nlohmann::json;
11
Patrick Venturea0764872020-08-08 07:48:43 -070012namespace pid_control
13{
14
Patrick Ventureeeeb8672019-02-08 11:47:42 -080015/**
16 * Given a json object generated from a configuration file, build the sensor
17 * configuration representation. This expecteds the json configuration to be
18 * valid.
19 *
20 * @param[in] data - the json data
21 * @return a map of sensors.
22 */
Patrick Venture1df9e872020-10-08 15:35:01 -070023std::map<std::string, conf::SensorConfig>
Patrick Ventureeeeb8672019-02-08 11:47:42 -080024 buildSensorsFromJson(const json& data);
Patrick Venturea0764872020-08-08 07:48:43 -070025
26} // namespace pid_control