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
Binary file modified docs/sbp.pdf
Binary file not shown.
37 changes: 19 additions & 18 deletions haskell/src/SwiftNav/SBP/Ssr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ data STECHeader = STECHeader
, _sTECHeader_update_interval :: !Word8
-- ^ Update interval between consecutive corrections. Encoded following RTCM
-- DF391 specification.
, _sTECHeader_iod_ssr :: !Word8
-- ^ IOD of the SSR correction. A change of Issue Of Data SSR is used to
-- indicate a change in the SSR generating configuration.
, _sTECHeader_iod_atmo :: !Word8
-- ^ IOD of the SSR atmospheric correction
} deriving ( Show, Read, Eq )

instance Binary STECHeader where
Expand All @@ -123,15 +122,15 @@ instance Binary STECHeader where
_sTECHeader_num_msgs <- getWord8
_sTECHeader_seq_num <- getWord8
_sTECHeader_update_interval <- getWord8
_sTECHeader_iod_ssr <- getWord8
_sTECHeader_iod_atmo <- getWord8
pure STECHeader {..}

put STECHeader {..} = do
put _sTECHeader_time
putWord8 _sTECHeader_num_msgs
putWord8 _sTECHeader_seq_num
putWord8 _sTECHeader_update_interval
putWord8 _sTECHeader_iod_ssr
putWord8 _sTECHeader_iod_atmo

$(makeJSON "_sTECHeader_" ''STECHeader)
$(makeLenses ''STECHeader)
Expand All @@ -150,12 +149,11 @@ data GriddedCorrectionHeader = GriddedCorrectionHeader
, _griddedCorrectionHeader_update_interval :: !Word8
-- ^ Update interval between consecutive corrections. Encoded following RTCM
-- DF391 specification.
, _griddedCorrectionHeader_iod_ssr :: !Word8
-- ^ IOD of the SSR correction. A change of Issue Of Data SSR is used to
-- indicate a change in the SSR generating configuration.
, _griddedCorrectionHeader_iod_atmo :: !Word8
-- ^ IOD of the SSR atmospheric correction
, _griddedCorrectionHeader_tropo_quality_indicator :: !Word8
-- ^ Quality of the troposphere data. Encoded following RTCM DF389
-- specifcation but as TECU instead of m.
-- specifcation in units of m.
} deriving ( Show, Read, Eq )

instance Binary GriddedCorrectionHeader where
Expand All @@ -164,7 +162,7 @@ instance Binary GriddedCorrectionHeader where
_griddedCorrectionHeader_num_msgs <- getWord16le
_griddedCorrectionHeader_seq_num <- getWord16le
_griddedCorrectionHeader_update_interval <- getWord8
_griddedCorrectionHeader_iod_ssr <- getWord8
_griddedCorrectionHeader_iod_atmo <- getWord8
_griddedCorrectionHeader_tropo_quality_indicator <- getWord8
pure GriddedCorrectionHeader {..}

Expand All @@ -173,7 +171,7 @@ instance Binary GriddedCorrectionHeader where
putWord16le _griddedCorrectionHeader_num_msgs
putWord16le _griddedCorrectionHeader_seq_num
putWord8 _griddedCorrectionHeader_update_interval
putWord8 _griddedCorrectionHeader_iod_ssr
putWord8 _griddedCorrectionHeader_iod_atmo
putWord8 _griddedCorrectionHeader_tropo_quality_indicator

$(makeJSON "_griddedCorrectionHeader_" ''GriddedCorrectionHeader)
Expand All @@ -187,7 +185,7 @@ data STECSatElement = STECSatElement
-- ^ Unique space vehicle identifier
, _sTECSatElement_stec_quality_indicator :: !Word8
-- ^ Quality of the STEC data. Encoded following RTCM DF389 specifcation but
-- as TECU instead of m.
-- in units of TECU instead of m.
, _sTECSatElement_stec_coeff :: ![Int16]
-- ^ Coefficents of the STEC polynomial in the order of C00, C01, C10, C11
} deriving ( Show, Read, Eq )
Expand All @@ -209,7 +207,7 @@ $(makeLenses ''STECSatElement)

-- | TroposphericDelayCorrection.
--
-- Troposphere delays at the grid point.
-- Troposphere vertical delays at the grid point.
data TroposphericDelayCorrection = TroposphericDelayCorrection
{ _troposphericDelayCorrection_hydro :: !Int16
-- ^ Hydrostatic vertical delay
Expand Down Expand Up @@ -287,13 +285,15 @@ $(makeLenses ''GridElement)
-- RLE encoded validity list.
data GridDefinitionHeader = GridDefinitionHeader
{ _gridDefinitionHeader_region_size_inverse :: !Word8
-- ^ inverse of region size
-- ^ region_size (deg) = 10 / region_size_inverse 0 is an invalid value.
, _gridDefinitionHeader_area_width :: !Word16
-- ^ area width; see spec for details
-- ^ grid height (deg) = grid idth (deg) = area_width / region_size 0 is an
-- invalid value.
, _gridDefinitionHeader_lat_nw_corner_enc :: !Word16
-- ^ encoded latitude of the northwest corner of the grid
-- ^ North-West corner latitdue (deg) = region_size * lat_nw_corner_enc - 90
, _gridDefinitionHeader_lon_nw_corner_enc :: !Word16
-- ^ encoded longitude of the northwest corner of the grid
-- ^ North-West corner longtitude (deg) = region_size * lon_nw_corner_enc -
-- 180
, _gridDefinitionHeader_num_msgs :: !Word8
-- ^ Number of messages in the dataset
, _gridDefinitionHeader_seq_num :: !Word8
Expand Down Expand Up @@ -646,7 +646,8 @@ msgSsrGridDefinition = 0x05F5

-- | SBP class for message MSG_SSR_GRID_DEFINITION (0x05F5).
--
-- Definition of the grid for STEC and tropo messages
-- Based on the 3GPP proposal R2-1906781 which is in turn based on OMA-LPPe-
-- ValidityArea from OMA-TS-LPPe–V2_0-20141202-C
data MsgSsrGridDefinition = MsgSsrGridDefinition
{ _msgSsrGridDefinition_header :: !GridDefinitionHeader
-- ^ Header of a Gridded Correction message
Expand Down
12 changes: 8 additions & 4 deletions java/src/com/swiftnav/sbp/ssr/GridDefinitionHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@

public class GridDefinitionHeader extends SBPStruct {

/** inverse of region size */
/** region_size (deg) = 10 / region_size_inverse
0 is an invalid value.
*/
public int region_size_inverse;

/** area width; see spec for details */
/** grid height (deg) = grid idth (deg) = area_width / region_size
0 is an invalid value.
*/
public int area_width;

/** encoded latitude of the northwest corner of the grid */
/** North-West corner latitdue (deg) = region_size * lat_nw_corner_enc - 90 */
public int lat_nw_corner_enc;

/** encoded longitude of the northwest corner of the grid */
/** North-West corner longtitude (deg) = region_size * lon_nw_corner_enc - 180 */
public int lon_nw_corner_enc;

/** Number of messages in the dataset */
Expand Down
14 changes: 6 additions & 8 deletions java/src/com/swiftnav/sbp/ssr/GriddedCorrectionHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ public class GriddedCorrectionHeader extends SBPStruct {
*/
public int update_interval;

/** IOD of the SSR correction. A change of Issue Of Data
SSR is used to indicate a change in the SSR
generating configuration.
/** IOD of the SSR atmospheric correction
*/
public int iod_ssr;
public int iod_atmo;

/** Quality of the troposphere data. Encoded following RTCM DF389
specifcation but as TECU instead of m.
specifcation in units of m.
*/
public int tropo_quality_indicator;

Expand All @@ -60,7 +58,7 @@ public GriddedCorrectionHeader parse(SBPMessage.Parser parser) throws SBPBinaryE
num_msgs = parser.getU16();
seq_num = parser.getU16();
update_interval = parser.getU8();
iod_ssr = parser.getU8();
iod_atmo = parser.getU8();
tropo_quality_indicator = parser.getU8();
return this;
}
Expand All @@ -72,7 +70,7 @@ public void build(SBPMessage.Builder builder) {
builder.putU16(num_msgs);
builder.putU16(seq_num);
builder.putU8(update_interval);
builder.putU8(iod_ssr);
builder.putU8(iod_atmo);
builder.putU8(tropo_quality_indicator);
}

Expand All @@ -83,7 +81,7 @@ public JSONObject toJSON() {
obj.put("num_msgs", num_msgs);
obj.put("seq_num", seq_num);
obj.put("update_interval", update_interval);
obj.put("iod_ssr", iod_ssr);
obj.put("iod_atmo", iod_atmo);
obj.put("tropo_quality_indicator", tropo_quality_indicator);
return obj;
}
Expand Down
3 changes: 2 additions & 1 deletion java/src/com/swiftnav/sbp/ssr/MsgSsrGridDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
* an inherited SBP object, or construct it inline using a dict of its
* fields.
*
* Definition of the grid for STEC and tropo messages */
* Based on the 3GPP proposal R2-1906781 which is in turn based on
* OMA-LPPe-ValidityArea from OMA-TS-LPPe–V2_0-20141202-C */

public class MsgSsrGridDefinition extends SBPMessage {
public static final int TYPE = 0x05F5;
Expand Down
12 changes: 5 additions & 7 deletions java/src/com/swiftnav/sbp/ssr/STECHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ public class STECHeader extends SBPStruct {
*/
public int update_interval;

/** IOD of the SSR correction. A change of Issue Of Data
SSR is used to indicate a change in the SSR
generating configuration.
/** IOD of the SSR atmospheric correction
*/
public int iod_ssr;
public int iod_atmo;


public STECHeader () {}
Expand All @@ -55,7 +53,7 @@ public STECHeader parse(SBPMessage.Parser parser) throws SBPBinaryException {
num_msgs = parser.getU8();
seq_num = parser.getU8();
update_interval = parser.getU8();
iod_ssr = parser.getU8();
iod_atmo = parser.getU8();
return this;
}

Expand All @@ -66,7 +64,7 @@ public void build(SBPMessage.Builder builder) {
builder.putU8(num_msgs);
builder.putU8(seq_num);
builder.putU8(update_interval);
builder.putU8(iod_ssr);
builder.putU8(iod_atmo);
}

@Override
Expand All @@ -76,7 +74,7 @@ public JSONObject toJSON() {
obj.put("num_msgs", num_msgs);
obj.put("seq_num", seq_num);
obj.put("update_interval", update_interval);
obj.put("iod_ssr", iod_ssr);
obj.put("iod_atmo", iod_atmo);
return obj;
}
}
2 changes: 1 addition & 1 deletion java/src/com/swiftnav/sbp/ssr/STECSatElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class STECSatElement extends SBPStruct {
public SvId sv_id;

/** Quality of the STEC data. Encoded following RTCM DF389 specifcation
but as TECU instead of m.
but in units of TECU instead of m.
*/
public int stec_quality_indicator;

Expand Down
2 changes: 1 addition & 1 deletion javascript/sbp.bundle.js

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions javascript/sbp/ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ PhaseBiasesContent.prototype.fieldSpec.push(['bias', 'writeInt32LE', 4]);
* @field seq_num number (unsigned 8-bit int, 1 byte) Position of this message in the dataset
* @field update_interval number (unsigned 8-bit int, 1 byte) Update interval between consecutive corrections. Encoded following RTCM DF391
* specification.
* @field iod_ssr number (unsigned 8-bit int, 1 byte) IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a
* change in the SSR generating configuration.
* @field iod_atmo number (unsigned 8-bit int, 1 byte) IOD of the SSR atmospheric correction
*
* @param sbp An SBP object with a payload to be decoded.
*/
Expand All @@ -134,13 +133,13 @@ STECHeader.prototype.parser = new Parser()
.uint8('num_msgs')
.uint8('seq_num')
.uint8('update_interval')
.uint8('iod_ssr');
.uint8('iod_atmo');
STECHeader.prototype.fieldSpec = [];
STECHeader.prototype.fieldSpec.push(['time', GPSTimeSec.prototype.fieldSpec]);
STECHeader.prototype.fieldSpec.push(['num_msgs', 'writeUInt8', 1]);
STECHeader.prototype.fieldSpec.push(['seq_num', 'writeUInt8', 1]);
STECHeader.prototype.fieldSpec.push(['update_interval', 'writeUInt8', 1]);
STECHeader.prototype.fieldSpec.push(['iod_ssr', 'writeUInt8', 1]);
STECHeader.prototype.fieldSpec.push(['iod_atmo', 'writeUInt8', 1]);

/**
* SBP class for message fragment GriddedCorrectionHeader
Expand All @@ -154,10 +153,9 @@ STECHeader.prototype.fieldSpec.push(['iod_ssr', 'writeUInt8', 1]);
* @field seq_num number (unsigned 16-bit int, 2 bytes) Position of this message in the dataset
* @field update_interval number (unsigned 8-bit int, 1 byte) Update interval between consecutive corrections. Encoded following RTCM DF391
* specification.
* @field iod_ssr number (unsigned 8-bit int, 1 byte) IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a
* change in the SSR generating configuration.
* @field tropo_quality_indicator number (unsigned 8-bit int, 1 byte) Quality of the troposphere data. Encoded following RTCM DF389 specifcation but
* as TECU instead of m.
* @field iod_atmo number (unsigned 8-bit int, 1 byte) IOD of the SSR atmospheric correction
* @field tropo_quality_indicator number (unsigned 8-bit int, 1 byte) Quality of the troposphere data. Encoded following RTCM DF389 specifcation in
* units of m.
*
* @param sbp An SBP object with a payload to be decoded.
*/
Expand All @@ -177,14 +175,14 @@ GriddedCorrectionHeader.prototype.parser = new Parser()
.uint16('num_msgs')
.uint16('seq_num')
.uint8('update_interval')
.uint8('iod_ssr')
.uint8('iod_atmo')
.uint8('tropo_quality_indicator');
GriddedCorrectionHeader.prototype.fieldSpec = [];
GriddedCorrectionHeader.prototype.fieldSpec.push(['time', GPSTimeSec.prototype.fieldSpec]);
GriddedCorrectionHeader.prototype.fieldSpec.push(['num_msgs', 'writeUInt16LE', 2]);
GriddedCorrectionHeader.prototype.fieldSpec.push(['seq_num', 'writeUInt16LE', 2]);
GriddedCorrectionHeader.prototype.fieldSpec.push(['update_interval', 'writeUInt8', 1]);
GriddedCorrectionHeader.prototype.fieldSpec.push(['iod_ssr', 'writeUInt8', 1]);
GriddedCorrectionHeader.prototype.fieldSpec.push(['iod_atmo', 'writeUInt8', 1]);
GriddedCorrectionHeader.prototype.fieldSpec.push(['tropo_quality_indicator', 'writeUInt8', 1]);

/**
Expand All @@ -194,8 +192,8 @@ GriddedCorrectionHeader.prototype.fieldSpec.push(['tropo_quality_indicator', 'wr
*
* Fields in the SBP payload (`sbp.payload`):
* @field sv_id SvId Unique space vehicle identifier
* @field stec_quality_indicator number (unsigned 8-bit int, 1 byte) Quality of the STEC data. Encoded following RTCM DF389 specifcation but as TECU
* instead of m.
* @field stec_quality_indicator number (unsigned 8-bit int, 1 byte) Quality of the STEC data. Encoded following RTCM DF389 specifcation but in units
* of TECU instead of m.
* @field stec_coeff array Coefficents of the STEC polynomial in the order of C00, C01, C10, C11
*
* @param sbp An SBP object with a payload to be decoded.
Expand Down Expand Up @@ -223,7 +221,7 @@ STECSatElement.prototype.fieldSpec.push(['stec_coeff', 'array', 'writeInt16LE',
/**
* SBP class for message fragment TroposphericDelayCorrection
*
* Troposphere delays at the grid point.
* Troposphere vertical delays at the grid point.
*
* Fields in the SBP payload (`sbp.payload`):
* @field hydro number (signed 16-bit int, 2 bytes) Hydrostatic vertical delay
Expand Down Expand Up @@ -318,10 +316,11 @@ GridElement.prototype.fieldSpec.push(['stec_residuals', 'array', STECResidual.pr
* encoded validity list.
*
* Fields in the SBP payload (`sbp.payload`):
* @field region_size_inverse number (unsigned 8-bit int, 1 byte) inverse of region size
* @field area_width number (unsigned 16-bit int, 2 bytes) area width; see spec for details
* @field lat_nw_corner_enc number (unsigned 16-bit int, 2 bytes) encoded latitude of the northwest corner of the grid
* @field lon_nw_corner_enc number (unsigned 16-bit int, 2 bytes) encoded longitude of the northwest corner of the grid
* @field region_size_inverse number (unsigned 8-bit int, 1 byte) region_size (deg) = 10 / region_size_inverse 0 is an invalid value.
* @field area_width number (unsigned 16-bit int, 2 bytes) grid height (deg) = grid idth (deg) = area_width / region_size 0 is an invalid
* value.
* @field lat_nw_corner_enc number (unsigned 16-bit int, 2 bytes) North-West corner latitdue (deg) = region_size * lat_nw_corner_enc - 90
* @field lon_nw_corner_enc number (unsigned 16-bit int, 2 bytes) North-West corner longtitude (deg) = region_size * lon_nw_corner_enc - 180
* @field num_msgs number (unsigned 8-bit int, 1 byte) Number of messages in the dataset
* @field seq_num number (unsigned 8-bit int, 1 byte) Postion of this message in the dataset
*
Expand Down Expand Up @@ -659,7 +658,8 @@ MsgSsrGriddedCorrection.prototype.fieldSpec.push(['element', GridElement.prototy
/**
* SBP class for message MSG_SSR_GRID_DEFINITION (0x05F5).
*
* Definition of the grid for STEC and tropo messages
* Based on the 3GPP proposal R2-1906781 which is in turn based on OMA-LPPe-
* ValidityArea from OMA-TS-LPPe–V2_0-20141202-C
*
* Fields in the SBP payload (`sbp.payload`):
* @field header GridDefinitionHeader Header of a Gridded Correction message
Expand Down
11 changes: 6 additions & 5 deletions proto/ssr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ message STECHeader {
uint32 num_msgs = 2;
uint32 seq_num = 3;
uint32 update_interval = 4;
uint32 iod_ssr = 5;
uint32 iod_atmo = 5;
}

/** Header for MSG_SSR_GRIDDED_CORRECTION
Expand All @@ -69,7 +69,7 @@ message GriddedCorrectionHeader {
uint32 num_msgs = 2;
uint32 seq_num = 3;
uint32 update_interval = 4;
uint32 iod_ssr = 5;
uint32 iod_atmo = 5;
uint32 tropo_quality_indicator = 6;
}

Expand All @@ -85,7 +85,7 @@ message STECSatElement {

/** None
*
* Troposphere delays at the grid point.
* Troposphere vertical delays at the grid point.
*/
message TroposphericDelayCorrection {
sint32 hydro = 1;
Expand Down Expand Up @@ -208,9 +208,10 @@ message MsgSsrGriddedCorrection {
GridElement element = 2;
}

/** None
/** Definition of the grid for STEC and tropo messages
*
* Definition of the grid for STEC and tropo messages
* Based on the 3GPP proposal R2-1906781 which is in turn based on
* OMA-LPPe-ValidityArea from OMA-TS-LPPe-V2_0-20141202-C
*/
message MsgSsrGridDefinition {
GridDefinitionHeader header = 1;
Expand Down
Loading