blob: ee82381a6f0f8fa1f4d40a381b0164c0c800aede [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 */
James Feistf81f2882019-02-26 11:26:36 -080023std::map<std::string, struct 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