Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions c/include/libsbp/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -5658,6 +5658,47 @@ struct MessageTraits<sbp_msg_ssr_grid_definition_dep_a_t> {
}
};

template <>
struct MessageTraits<sbp_msg_ssr_gridded_correction_bounds_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrGriddedCorrectionBounds;
static const sbp_msg_ssr_gridded_correction_bounds_t &get(
const sbp_msg_t &msg) {
return msg.ssr_gridded_correction_bounds;
}
static sbp_msg_ssr_gridded_correction_bounds_t &get(sbp_msg_t &msg) {
return msg.ssr_gridded_correction_bounds;
}
static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_bounds_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->ssr_gridded_correction_bounds = msg;
}
static sbp_msg_t to_sbp_msg(
const sbp_msg_ssr_gridded_correction_bounds_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.ssr_gridded_correction_bounds = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_ssr_gridded_correction_bounds_t &msg,
sbp_write_fn_t write) {
return sbp_msg_ssr_gridded_correction_bounds_send(state, sender_id, &msg,
write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_gridded_correction_bounds_t &msg) {
return sbp_msg_ssr_gridded_correction_bounds_encode(buf, len, n_written,
&msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_gridded_correction_bounds_t *msg) {
return sbp_msg_ssr_gridded_correction_bounds_decode(buf, len, n_read, msg);
}
static size_t encoded_len(
const sbp_msg_ssr_gridded_correction_bounds_t &msg) {
return sbp_msg_ssr_gridded_correction_bounds_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_ssr_gridded_correction_dep_a_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrGriddedCorrectionDepA;
Expand Down Expand Up @@ -5991,6 +6032,42 @@ struct MessageTraits<sbp_msg_ssr_stec_correction_dep_a_t> {
}
};

template <>
struct MessageTraits<sbp_msg_ssr_stec_correction_dep_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrStecCorrectionDep;
static const sbp_msg_ssr_stec_correction_dep_t &get(const sbp_msg_t &msg) {
return msg.ssr_stec_correction_dep;
}
static sbp_msg_ssr_stec_correction_dep_t &get(sbp_msg_t &msg) {
return msg.ssr_stec_correction_dep;
}
static void to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->ssr_stec_correction_dep = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.ssr_stec_correction_dep = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_ssr_stec_correction_dep_t &msg,
sbp_write_fn_t write) {
return sbp_msg_ssr_stec_correction_dep_send(state, sender_id, &msg, write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_stec_correction_dep_t &msg) {
return sbp_msg_ssr_stec_correction_dep_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_stec_correction_dep_t *msg) {
return sbp_msg_ssr_stec_correction_dep_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_ssr_stec_correction_dep_t &msg) {
return sbp_msg_ssr_stec_correction_dep_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_ssr_stec_correction_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrStecCorrection;
Expand Down Expand Up @@ -6027,6 +6104,42 @@ struct MessageTraits<sbp_msg_ssr_stec_correction_t> {
}
};

template <>
struct MessageTraits<sbp_msg_ssr_tile_definition_dep_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinitionDep;
static const sbp_msg_ssr_tile_definition_dep_t &get(const sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep;
}
static sbp_msg_ssr_tile_definition_dep_t &get(sbp_msg_t &msg) {
return msg.ssr_tile_definition_dep;
}
static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_t &msg,
sbp_msg_t *sbp_msg) {
sbp_msg->ssr_tile_definition_dep = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.ssr_tile_definition_dep = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_ssr_tile_definition_dep_t &msg,
sbp_write_fn_t write) {
return sbp_msg_ssr_tile_definition_dep_send(state, sender_id, &msg, write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_tile_definition_dep_t &msg) {
return sbp_msg_ssr_tile_definition_dep_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_tile_definition_dep_t *msg) {
return sbp_msg_ssr_tile_definition_dep_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_ssr_tile_definition_dep_t &msg) {
return sbp_msg_ssr_tile_definition_dep_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_ssr_tile_definition_t> {
static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinition;
Expand Down
22 changes: 20 additions & 2 deletions c/include/libsbp/legacy/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -985,19 +985,25 @@ struct MessageTraits<msg_ssr_grid_definition_dep_a_t> {


template<>
struct MessageTraits<msg_ssr_tile_definition_t> {
struct MessageTraits<msg_ssr_tile_definition_dep_t> {
static constexpr u16 id = 1526;
};


template<>
struct MessageTraits<msg_ssr_tile_definition_t> {
static constexpr u16 id = 1527;
};


template<>
struct MessageTraits<msg_ssr_gridded_correction_dep_a_t> {
static constexpr u16 id = 1530;
};


template<>
struct MessageTraits<msg_ssr_stec_correction_t> {
struct MessageTraits<msg_ssr_stec_correction_dep_t> {
static constexpr u16 id = 1531;
};

Expand All @@ -1008,6 +1014,18 @@ struct MessageTraits<msg_ssr_gridded_correction_t> {
};


template<>
struct MessageTraits<msg_ssr_stec_correction_t> {
static constexpr u16 id = 1533;
};


template<>
struct MessageTraits<msg_ssr_gridded_correction_bounds_t> {
static constexpr u16 id = 1534;
};


template<>
struct MessageTraits<msg_ssr_satellite_apc_t> {
static constexpr u16 id = 1540;
Expand Down
153 changes: 144 additions & 9 deletions c/include/libsbp/legacy/ssr.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,27 @@ typedef struct SBP_ATTR_PACKED {
stec_sat_element_t stec_sat_list[0]; /**< Array of STEC polynomial
coefficients for each space
vehicle. */
} msg_ssr_stec_correction_dep_t;

typedef struct SBP_ATTR_PACKED {
gps_time_sec_t time; /**< GNSS reference time of the bound */
u8 num_msgs; /**< Number of messages in the dataset */
u8 seq_num; /**< Position of this message in the dataset */
u8 update_interval; /**< Update interval between consecutive bounds.
Similar to RTCM DF391. */
u8 sol_id; /**< SSR Solution ID. */
} bounds_header_t;

typedef struct SBP_ATTR_PACKED {
bounds_header_t header; /**< Header of a STEC correction with
bounds message. */
u8 ssr_iod_atmo; /**< IOD of the SSR atmospheric correction */
u16 tile_set_id; /**< Tile set ID */
u16 tile_id; /**< Tile ID */
u8 n_sats; /**< Number of satellites. */
stec_sat_element_t stec_sat_list[0]; /**< Array of STEC polynomial
coefficients for each space
vehicle. */
} msg_ssr_stec_correction_t;

/** Gridded troposphere and STEC correction residuals
Expand All @@ -292,6 +313,128 @@ typedef struct SBP_ATTR_PACKED {
satellite (mean, stddev). */
} msg_ssr_gridded_correction_t;

/** None
*
* STEC polynomial and bounds for the given satellite.
*/

typedef struct SBP_ATTR_PACKED {
stec_residual_t stec_residual; /**< STEC residuals (mean, stddev) */
u8 stec_bound_mu; /**< STEC Error Bound Mean (range 0-17.5) i<= 200,
mean = 0.01i 200<i<=230, mean=2+0.1(i-200)
i>230, mean=5+0.5(i-230) [m] */
u8 stec_bound_sig; /**< STEC Error Bound Standard Deviation (range
0-17.5) i<= 200, mean = 0.01i 200<i<=230,
mean=2+0.1(i-200) i>230, mean=5+0.5(i-230) [m] */
u8 stec_bound_mu_dot; /**< STEC Error Bound Mean First derivative
degradation parameter(range 0-0.01275) [0.00005
m/s] */
u8 stec_bound_sig_dot; /**< STEC Error Bound Standard Deviation First
derivative degradation parameter (range
0-0.01275) [0.00005 m/s] */
} stec_sat_element_integrity_t;

typedef struct SBP_ATTR_PACKED {
bounds_header_t header; /**< Header of a bounds message. */
u8 ssr_iod_atmo; /**< IOD of the SSR atmospheric correction. */
u16 tile_set_id; /**< Unique identifier of the set this tile
belongs to. */
u16 tile_id; /**< Unique identifier of this tile in the
tile set. */
u8 tropo_qi; /**< Tropo Quality Indicator. Similar to RTCM
DF389. */
u16 grid_point_id; /**< Index of the Grid Point. */
tropospheric_delay_correction_t tropo_delay_correction; /**< Tropospheric
delay at
grid point. */
u8 tropo_bound_mu; /**< Troposphere Error Bound Mean (range
0-1.275). [0.005 m] */
u8 tropo_bound_sig; /**< Troposphere Error Bound Standard
Deviation (range 0-1.275) [0.005 m] */
u8 n_sats; /**< Number of satellites. */
stec_sat_element_integrity_t stec_sat_list[0]; /**< Array of STEC
polynomial
coefficients
and its bounds
for each space
vehicle. */
} msg_ssr_gridded_correction_bounds_t;

/** Definition of a SSR atmospheric correction tile.

*
* Provides the correction point coordinates for the atmospheric correction
* values in the MSG_SSR_STEC_CORRECTION_DEP and MSG_SSR_GRIDDED_CORRECTION
* messages.
*
* Based on ETSI TS 137 355 V16.1.0 (LTE Positioning Protocol) information
* element GNSS-SSR-CorrectionPoints. SBP only supports gridded arrays of
* correction points, not lists of points.
*/

typedef struct SBP_ATTR_PACKED {
u16 tile_set_id; /**< Unique identifier of the tile set this tile
belongs to. */
u16 tile_id; /**< Unique identifier of this tile in the tile set.
See GNSS-SSR-ArrayOfCorrectionPoints field
correctionPointSetID. */
s16 corner_nw_lat; /**< North-West corner correction point latitude.

The relation between the latitude X in the range
[-90, 90] and the coded number N is:

N = floor((X / 90) * 2^14)

See GNSS-SSR-ArrayOfCorrectionPoints field
referencePointLatitude. [encoded degrees] */
s16 corner_nw_lon; /**< North-West corner correction point longitude.

The relation between the longitude X in the range
[-180, 180] and the coded number N is:

N = floor((X / 180) * 2^15)

See GNSS-SSR-ArrayOfCorrectionPoints field
referencePointLongitude. [encoded degrees] */
u16 spacing_lat; /**< Spacing of the correction points in the latitude
direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
stepOfLatitude. [0.01 degrees] */
u16 spacing_lon; /**< Spacing of the correction points in the longitude
direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
stepOfLongitude. [0.01 degrees] */
u16 rows; /**< Number of steps in the latitude direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
numberOfStepsLatitude. */
u16 cols; /**< Number of steps in the longitude direction.

See GNSS-SSR-ArrayOfCorrectionPoints field
numberOfStepsLongitude. */
u64 bitmask; /**< Specifies the availability of correction data at
the correction points in the array.

If a specific bit is enabled (set to 1), the
correction is not available. Only the first rows
* cols bits are used, the remainder are set to 0.
If there are more then 64 correction points the
remaining corrections are always available.

Starting with the northwest corner of the array
(top left on a north oriented map) the correction
points are enumerated with row precedence - first
row west to east, second row west to east, until
last row west to east - ending with the southeast
corner of the array.

See GNSS-SSR-ArrayOfCorrectionPoints field
bitmaskOfGrids but note the definition of the
bits is inverted. */
} msg_ssr_tile_definition_dep_t;

/** Definition of a SSR atmospheric correction tile.

*
Expand All @@ -305,6 +448,7 @@ typedef struct SBP_ATTR_PACKED {
*/

typedef struct SBP_ATTR_PACKED {
u8 ssr_sol_id; /**< SSR Solution ID. */
u16 tile_set_id; /**< Unique identifier of the tile set this tile
belongs to. */
u16 tile_id; /**< Unique identifier of this tile in the tile set.
Expand Down Expand Up @@ -520,15 +664,6 @@ typedef struct SBP_ATTR_PACKED {
are encoded as u8 integers. */
} msg_ssr_grid_definition_dep_a_t;

typedef struct SBP_ATTR_PACKED {
gps_time_sec_t time; /**< GNSS reference time of the bound */
u8 num_msgs; /**< Number of messages in the dataset */
u8 seq_num; /**< Position of this message in the dataset */
u8 update_interval; /**< Update interval between consecutive bounds.
Similar to RTCM DF391. */
u8 sol_id; /**< SSR Solution ID. */
} bounds_header_t;

/** None
*
* Orbit and clock bound.
Expand Down
3 changes: 3 additions & 0 deletions c/include/libsbp/sbp_msg_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ typedef enum {
SbpMsgSsrCodeBiases = SBP_MSG_SSR_CODE_BIASES,
SbpMsgSsrCodePhaseBiasesBounds = SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS,
SbpMsgSsrGridDefinitionDepA = SBP_MSG_SSR_GRID_DEFINITION_DEP_A,
SbpMsgSsrGriddedCorrectionBounds = SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS,
SbpMsgSsrGriddedCorrectionDepA = SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A,
SbpMsgSsrGriddedCorrectionNoStdDepA =
SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A,
Expand All @@ -220,7 +221,9 @@ typedef enum {
SbpMsgSsrPhaseBiases = SBP_MSG_SSR_PHASE_BIASES,
SbpMsgSsrSatelliteApc = SBP_MSG_SSR_SATELLITE_APC,
SbpMsgSsrStecCorrectionDepA = SBP_MSG_SSR_STEC_CORRECTION_DEP_A,
SbpMsgSsrStecCorrectionDep = SBP_MSG_SSR_STEC_CORRECTION_DEP,
SbpMsgSsrStecCorrection = SBP_MSG_SSR_STEC_CORRECTION,
SbpMsgSsrTileDefinitionDep = SBP_MSG_SSR_TILE_DEFINITION_DEP,
SbpMsgSsrTileDefinition = SBP_MSG_SSR_TILE_DEFINITION,
SbpMsgStartup = SBP_MSG_STARTUP,
SbpMsgStatusJournal = SBP_MSG_STATUS_JOURNAL,
Expand Down
Loading