Fixposition SDK 0.0.0-heads/main-0-g90a51ff
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpb.hpp File Reference

Fixposition SDK: Parser FP_B routines and types. More...

#include <cstdint>
#include <cstring>
#include <vector>
#include "../types.hpp"
Include dependency graph for fpb.hpp:

Go to the source code of this file.

Classes

struct  fpsdk::common::parser::fpb::FpbMeasurementsHead
 FP_B-MEASUREMENTS payload: head. More...
 
struct  fpsdk::common::parser::fpb::FpbMeasurementsMeas
 FP_B-MEASUREMENTS payload: measurement. More...
 
struct  fpsdk::common::parser::fpb::FpbVersionPayload
 FP_B-VERSION payload: head. More...
 

Namespaces

namespace  fpsdk
 Fixposition SDK.
 
namespace  fpsdk::common
 Fixposition SDK: Common library.
 
namespace  fpsdk::common::parser
 Parser.
 
namespace  fpsdk::common::parser::fpb
 Parser FP_B routines and types.
 

Functions

constexpr uint16_t fpsdk::common::parser::fpb::FpbMsgId (const uint8_t *msg)
 Get message ID.
 
constexpr uint16_t fpsdk::common::parser::fpb::FpbMsgTime (const uint8_t *msg)
 Get message time.
 
bool fpsdk::common::parser::fpb::FpbGetMessageName (char *name, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
 Get FP_B message name.
 
bool fpsdk::common::parser::fpb::FpbGetMessageInfo (char *info, const std::size_t size, const uint8_t *msg, const std::size_t msg_size)
 Get FP_B message info.
 
bool fpsdk::common::parser::fpb::FpbMakeMessage (std::vector< uint8_t > &msg, const uint16_t msg_id, const uint16_t msg_time, const std::vector< uint8_t > &payload)
 Make a FP_B message.
 
bool fpsdk::common::parser::fpb::FpbMakeMessage (std::vector< uint8_t > &msg, const uint16_t msg_id, const uint16_t msg_time, const uint8_t *payload, const std::size_t payload_size)
 Make a FP_B message.
 

Variables

static constexpr std::size_t fpsdk::common::parser::fpb::FP_B_FRAME_SIZE = 12
 Size (in bytes) of FP_B frame.
 
static constexpr std::size_t fpsdk::common::parser::fpb::FP_B_HEAD_SIZE = 8
 Size of FP_B frame header.
 
static constexpr uint8_t fpsdk::common::parser::fpb::FP_B_SYNC_1 = 0x66
 FP_B frame sync char 1 ('f', 102, 0b0110'0110)
 
static constexpr uint8_t fpsdk::common::parser::fpb::FP_B_SYNC_2 = 0x21
 FP_B frame sync char 2 ('!', 33, 0b0010'0001)
 
FP_B messages (names and IDs)
  • 1- 999: unused
  • 1000-1999: messages with payload binary serialised data
    • 1101-1199: Fusion
    • 1201-1299: GNSS
    • 1301-1399: System
    • 1401-1499: Configuration
    • 1501-1599: Sensor data
    • 1601-1699: Reserved
    • 1701-1699: Reserved
    • 1801-1699: Reserved
    • 1901-1999: Reserved
  • 2000-3000: messages with static payload
    • 2001-2099: Input data messages (measurements, ...)
    • 2101-2199: Input command message
    • 2201-2299: Input config message
    • 2301-2399: System
    • 2401-2499: Reserved
    • 2501-2599: Reserved
    • 2601-2699: Reserved
    • 2701-2799: Reserved
    • 2801-2899: Reserved
    • 2901-2999: Reserved
  • 3000-65000: Reserved
  • 65001-...: Test messages
static constexpr uint16_t fpsdk::common::parser::fpb::FP_B_GNSSSTATUS_MSGID = 1201
 FP_B-GNSSSTATUS message ID.
 
static constexpr const char * fpsdk::common::parser::fpb::FP_B_GNSSSTATUS_STRID = "FP_B-GNSSSTATUS"
 FP_B-GNSSSTATUS message name.
 
static constexpr uint16_t fpsdk::common::parser::fpb::FP_B_SYSTEMSTATUS_MSGID = 1301
 FP_B-SYSTEMSTATUS message ID.
 
static constexpr const char * fpsdk::common::parser::fpb::FP_B_SYSTEMSTATUS_STRID = "FP_B-SYSTEMSTATUS"
 FP_B-SYSTEMSTATUS message name.
 
static constexpr uint16_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_MSGID = 2001
 FP_B-MEASUREMENTS message ID.
 
static constexpr const char * fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_STRID = "FP_B-MEASUREMENTS"
 FP_B-MEASUREMENTS message name.
 
static constexpr uint16_t fpsdk::common::parser::fpb::FP_B_VERSION_MSGID = 2301
 FP_B-VERSION message ID.
 
static constexpr const char * fpsdk::common::parser::fpb::FP_B_VERSION_STRID = "FP_B-VERSION"
 FP_B-VERSION message name.
 
static constexpr uint16_t fpsdk::common::parser::fpb::FP_B_UNITTEST1_MSGID = 65001
 FP_B-UNITTEST1 message ID.
 
static constexpr const char * fpsdk::common::parser::fpb::FP_B_UNITTEST1_STRID = "FP_B-UNITTEST1"
 FP_B-UNITTEST1 message name.
 
static constexpr uint16_t fpsdk::common::parser::fpb::FP_B_UNITTEST2_MSGID = 65002
 FP_B-UNITTEST2 message ID.
 
static constexpr const char * fpsdk::common::parser::fpb::FP_B_UNITTEST2_STRID = "FP_B-UNITTEST2"
 FP_B-UNITTEST2 message name.
 
FP_B-VERSION

Description:

This message contains version strings.

Payload fields:

# Offset Field Type Unit Description
1 0 version uint8_t - Version of the FP_B_VERSION message (currently 1)
2 1 reserved0 uint8_t[7] - Reserved for future use. Set to 0.
3 8 sw_version uint8_t[64] - Software version (nul-terminated string)
4 72 hw_name uint8_t[32] - Hardware name string (nul-terminated string)
5 104 hw_ver uint8_t[32] - Hardware version (nul-terminated string)
6 136 hw_uid uint8_t[32] - Hardware UID (nul-terminated string)
7 168 reserved1 uint8_t[64] - Reserved for future use. Set to 0.
static constexpr uint8_t fpsdk::common::parser::fpb::FP_B_VERSION_V1 = 0x01
 FP_B-VERSION.version value.
 
static constexpr std::size_t fpsdk::common::parser::fpb::FP_B_VERSION_PAYLOAD_SIZE = 232
 Size of FpbVersionPayload.
 

FP_B-MEASUREMENTS

Description:

This message is used to input measurements, such as wheelspeeds, to the sensor.

Notes:

  • The supported meas_type, meas_loc and timestamp_type values depend on the sensor software and configuration used. Refer to the sensor documentation for valid combinations of values for these fields.

Payload fields:

# Offset Field Type Unit Description
1 0 version uint8_t - Version of the FP_B_MEASUREMENTS message (currently 1)
2 1 num_meas uint8_t - Number of measurements present in the body of the message (1…10)
3 2 reserved0 uint8_t[6] - Reserved for future use. Set to 0.
The following fields are repeated num_meas times (i = 0…num_meas-1):
4 + i·12 8 + i·28 meas_x int32_t * Measurement x axis (for example, [mm/s])
5 + i·12 12 + i·28 meas_y int32_t * Measurement y axis (for example, [mm/s])
6 + i·12 16 + i·28 meas_z int32_t * Measurement z axis (for example, [mm/s])
7 + i·12 20 + i·28 meas_x_valid uint8_t - Validity of meas_x (1 = valid data, 0 = invalid data or n/a)
8 + i·12 21 + i·28 meas_y_valid uint8_t - Validity of meas_y (1 = valid data, 0 = invalid data or n/a)
9 + i·12 22 + i·28 meas_z_valid uint8_t - Validity of meas_z (1 = valid data, 0 = invalid data or n/a)
10 + i·12 23 + i·28 meas_type uint8_t - Type of measurement (see below)
11 + i·12 24 + i·28 meas_loc uint8_t - Location of measurement (see below)
12 + i·12 25 + i·28 reserved1 uint8_t[4] - Reserved for future use. Set to 0.
13 + i·12 29 + i·28 timestamp_type uint8_t - Type of timestamp (see below)
14 + i·12 30 + i·28 gps_wno uint16_t - GPS week number
15 + i·12 32 + i·28 gps_tow uint32_t * GPS time of week [ms] or monotonic time [-]

Valid meas_type values are:

Value Description
0 Unspecified
1 Velocity (wheel speed)

Valid meas_loc values are:

Value Description
0 Unspecified
1 Measurement of a sensor at the rear-center (RC)
2 Measurement of a sensor at the front-right (FR)
3 Measurement of a sensor at the front-left (FL)
4 Measurement of a sensor at the rear-right (RR)
5 Measurement of a sensor at the rear-left (RL)

Valid timestamp_type values are:

Value Description
0 Unspecified
1 Use time of arrival of the measurement (ignore gps_wno and gps_tow)
2 Use monotonic time [any] (stored in the gps_tow field)
3 Use GPS time (stored in gps_wno [-] and gps_tow [ms] fields)
enum class  fpsdk::common::parser::fpb::FpbMeasurementsMeasType : uint8_t { fpsdk::common::parser::fpb::UNSPECIFIED = 0 , fpsdk::common::parser::fpb::VELOCITY = 1 }
 FP_B-MEASUREMENTS measurement type. More...
 
enum class  fpsdk::common::parser::fpb::FpbMeasurementsMeasLoc : uint8_t {
  fpsdk::common::parser::fpb::UNSPECIFIED = 0 , fpsdk::common::parser::fpb::RC = 1 , fpsdk::common::parser::fpb::FR = 2 , fpsdk::common::parser::fpb::FL = 3 ,
  fpsdk::common::parser::fpb::RR = 4 , fpsdk::common::parser::fpb::RL = 5
}
 FP_B-MEASUREMENTS measurement location. More...
 
enum class  fpsdk::common::parser::fpb::FpbMeasurementsTimestampType : uint8_t { fpsdk::common::parser::fpb::UNSPECIFIED = 0 , fpsdk::common::parser::fpb::TIMEOFARRIVAL = 1 , fpsdk::common::parser::fpb::MONOTONIC = 2 , fpsdk::common::parser::fpb::GPS = 3 }
 FP_B-MEASUREMENTS timestamp type. More...
 
static constexpr uint8_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_V1 = 0x01
 FP_B-MEASUREMENTS.version value.
 
static constexpr std::size_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_HEAD_SIZE = 8
 FP_B-MEASUREMENTS payload head size.
 
static constexpr std::size_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_MEAS_SIZE = 28
 Size of FpbMeasurementsMeas.
 
static constexpr std::size_t fpsdk::common::parser::fpb::FP_B_MEASUREMENTS_MAX_NUM_MEAS = 10
 Maximum number of measurements.
 

Detailed Description

Fixposition SDK: Parser FP_B routines and types.

* ___    ___
* \  \  /  /
*  \  \/  /   Copyright (c) Fixposition AG (www.fixposition.com) and contributors
*  /  /\  \   License: see the LICENSE file
* /__/  \__\
*
* Based on work by flipflip (https://github.com/phkehl)
* 

Definition in file fpb.hpp.