Skip to content

Commit

Permalink
Added documentation links
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpantic committed Mar 12, 2019
1 parent cfbfe66 commit a6f66b5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rqt_gps_rtk_plugin/include/rqt_gps_rtk_plugin/SBPDecoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ enum class SBP_MSG_TYPE : uint16_t {

// note: packed attribute mandatory for low-level parsing.
// Otherwise the compiler might align variables with padding etc.
//
// Definition source: SBP Manual v2.4.7
// Available here: https://support.swiftnav.com/customer/en/portal/articles/2492810-swift-binary-protocol

// Header as defined in chapter "2 Message Framing Structure".
typedef struct __attribute__ ((packed)) {
uint8_t preamble;
SBP_MSG_TYPE message_type;
uint16_t sender;
uint8_t length;
} SBP_MSG_HEADER;

// struct for measurement status flags
// Struct for measurement status flags as defined in field
// definition 6.6.1 / Chapter 6.6
typedef struct __attribute__ ((packed)) {
uint pseodorange_valid:1;
uint carrier_phase_valid:1;
Expand All @@ -40,19 +45,22 @@ typedef struct __attribute__ ((packed)) {
uint RAIM_excl:1;
} SBP_MSG_OBS_OBSERVATION_FLAGS;

// struct for n_obs
// Struct for number of observations as defined in Chapter 6.6
// (field n_obs in table)
typedef struct __attribute__ ((packed)) {
uint index:4;
uint total_n:4; // upper and lower nibble (:4)
} SBP_MSG_OBS_OBSERVATION_NOBS;

// Struct for observation header as defined in Chapter 6.6 (Table 6.6.1).
typedef struct __attribute__ ((packed)) {
uint32_t tow;
int32_t ns_residual;
uint16_t wn;
SBP_MSG_OBS_OBSERVATION_NOBS n_obs;
} SBP_MSG_OBS_HEADER;

// Struct for observation header as defined in Chapter 6.6 (Table 6.6.1)
typedef struct __attribute__ ((packed)) {
uint32_t P; // pseudoragne
int32_t L_i; // carrier phase integer cycles
Expand Down Expand Up @@ -82,7 +90,7 @@ class SBP_MSG_OBS {
public:
SBP_MSG_OBS_HEADER header;
std::vector<SBP_MSG_OBS_OBSERVATION> observations;

std::string str() {
std::map<uint8_t, std::string> code_map = {
{0, "GPS L1CA"},
Expand Down

0 comments on commit a6f66b5

Please # to comment.