1 #ifndef FIVEAI_STAMPED_DIAGNOSTIC_H 2 #define FIVEAI_STAMPED_DIAGNOSTIC_H 10 #include <boost/algorithm/string.hpp> 29 namespace serialization
34 template <
typename Stream,
typename T>
37 stream.next(m.status);
48 template <
typename Stream,
typename T>
51 stream.next(m.diagnostics);
81 _config.remove_suffix_from_strings,
82 _config.boolean_strings_to_number);
84 std::string replaced_key = diag.
key;
85 std::replace(replaced_key.begin(), replaced_key.end(),
' ',
'_');
90 auto& series = getSeries(
key);
91 series.pushBack({ timestamp, value });
96 auto& series = getStringSeries(
key);
97 series.pushBack({ timestamp, diag.
value });
101 auto key =
fmt::format(
"{}/{}/status", _topic_name, replaced_key);
102 auto& series = getSeries(
key);
103 series.pushBack({ timestamp,
static_cast<double>(diag.
status) });
112 #endif // FIVEAI_STAMPED_DIAGNOSTIC_H
#define ROS_DECLARE_ALLINONE_SERIALIZER
bool parseMessage(MessageRef msg, double ×tamp) override
bool ParseDouble(const std::string &str, double &value, bool remover_suffix, bool parse_boolean)
FMT_INLINE std::basic_string< Char > format(const S &format_str, Args &&... args)
static void allInOne(Stream &stream, T m)
static void allInOne(Stream &stream, T m)
const uint8_t * data() const
FiveAiDiagnosticMsg(const std::string &topic_name, PJ::PlotDataMapRef &plot_data)
std::vector< StampedDiagnostic_ > diagnostics
void deserialize(Stream &stream, T &t)