13#ifndef __FPSDK_COMMON_TO_JSON_PARSER_FPB_HPP__
14#define __FPSDK_COMMON_TO_JSON_PARSER_FPB_HPP__
20#include <nlohmann/json.hpp>
66inline void to_json_FP_B_MEASUREMENTS(nlohmann::json& j,
const std::vector<uint8_t>& data)
77 j[
"num_meas"] = head.num_meas;
78 j[
"meas"] = nlohmann::json::array();
79 for (std::size_t ix = 0; ix < head.num_meas; ix++) {
83 auto m = nlohmann::json::object();
84 auto xyz = nlohmann::json::array({
nullptr,
nullptr,
nullptr });
85 if (meas.meas_x_valid != 0) {
88 if (meas.meas_y_valid != 0) {
91 if (meas.meas_z_valid != 0) {
98 m[
"gps_wno"] = meas.gps_wno;
99 m[
"gps_tow"] = meas.gps_tow;
100 j[
"meas"].push_back(m);
106inline nlohmann::json to_json_FP_B(
const ParserMsg& msg)
108 auto j = nlohmann::json::object();
Fixposition SDK: Parser FP_B routines and types.
Parser FP_B routines and types.
static constexpr std::size_t FP_B_MEASUREMENTS_HEAD_SIZE
FP_B-MEASUREMENTS payload head size.
static constexpr std::size_t FP_B_FRAME_SIZE
Size (in bytes) of FP_B frame.
static constexpr std::size_t FP_B_HEAD_SIZE
Size of FP_B frame header.
FpbMeasurementsTimestampType
FP_B-MEASUREMENTS timestamp type.
@ MONOTONIC
Use monotonic time [any] (stored in the gps_tow field)
@ UNSPECIFIED
Unspecified.
@ TIMEOFARRIVAL
Use time of arrival of the measurement (ignore gps_wno and gps_tow)
@ GPS
Use GPS time (stored in gps_wno [-] and gps_tow [ms] fields)
FpbMeasurementsMeasType
FP_B-MEASUREMENTS measurement type.
@ UNSPECIFIED
Unspecified.
@ VELOCITY
Velocity measuement (wheel speed)
constexpr uint16_t FpbMsgId(const uint8_t *msg)
Get message ID.
FpbMeasurementsMeasLoc
FP_B-MEASUREMENTS measurement location.
@ FR
Measurement of a sensor at the front-right (FR)
@ UNSPECIFIED
Unspecified.
@ RC
Measurement of a sensor at the rear-center (RC)
@ RL
Measurement of a sensor at the rear-left (RL)
@ FL
Measurement of a sensor at the front-left (FL)
@ RR
Measurement of a sensor at the rear-right (RR)
static constexpr uint16_t FP_B_MEASUREMENTS_MSGID
FP_B-MEASUREMENTS message ID.
static constexpr std::size_t FP_B_MEASUREMENTS_MEAS_SIZE
Size of FpbMeasurementsMeas.
std::string Sprintf(const char *const fmt,...) PRINTF_ATTR(1)
Format string.
constexpr std::underlying_type< T >::type EnumToVal(T enum_val)
Convert enum class constant to the underlying integral type value.
Fixposition SDK: String utilities.
FP_B-MEASUREMENTS payload: head.
FP_B-MEASUREMENTS payload: measurement.
Fixposition SDK: Common types and type helpers.