Skip to content

Commit

Permalink
Clarify timestamping descriptions [AP-1087] (#1395)
Browse files Browse the repository at this point in the history
# Description

@swift-nav/devinfra

<!-- Changes proposed in this PR -->

# API compatibility

Does this change introduce a API compatibility risk?

<!-- Provide a short explanation why or why not -->

## API compatibility plan

If the above is "Yes", please detail the compatibility (or migration)
plan:

<!-- Provide a short explanation plan here -->

# JIRA Reference

https://swift-nav.atlassian.net/browse/AP-1087

---------

Co-authored-by: Matt Woodward <[email protected]>
Co-authored-by: Matt Woodward <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2024
1 parent 416da16 commit 2df29c8
Show file tree
Hide file tree
Showing 37 changed files with 191 additions and 195 deletions.
9 changes: 4 additions & 5 deletions c/include/libsbp/imu/MSG_IMU_RAW.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ extern "C" {
* indications on the device itself. Measurement units, which are specific to
* the device hardware and settings, are communicated via the MSG_IMU_AUX
* message. If using "time since startup" local time tags, the receiving end
* will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also requires
* that the MSG_PPS_TIME message be sent prior to any IMU RAW messages that are
* based on the current (as measured at the PPS edge) local time timestamps. The
* local time (as defined in the MSG_PPS_TIME message) must wrap around to zero
* when reaching the extent of the u64 "Local time in microseconds" parameter.
* will expect either a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the
* relationship between IMU time and GNSS time. Regardless of the timestamping
* mode, the timestamp is required to roll over to zero when reaching one week
* (604800 seconds, or 604800000 milliseconds).
*/
typedef struct {
/**
Expand Down
10 changes: 4 additions & 6 deletions c/include/libsbp/legacy/imu.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ SBP_PACK_START
* the indications on the device itself. Measurement units, which are specific
* to the device hardware and settings, are communicated via the MSG_IMU_AUX
* message. If using "time since startup" local time tags, the receiving end
* will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also
* requires that the MSG_PPS_TIME message be sent prior to any IMU RAW
* messages that are based on the current (as measured at the PPS edge) local
* time timestamps. The local time (as defined in the MSG_PPS_TIME message)
* must wrap around to zero when reaching the extent of the u64 "Local time in
* microseconds" parameter.
* will expect either a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the
* relationship between IMU time and GNSS time.
* Regardless of the timestamping mode, the timestamp is required to roll over
* to zero when reaching one week (604800 seconds, or 604800000 milliseconds).
* The time-tagging mode should not change throughout a run.
*/

Expand Down
11 changes: 6 additions & 5 deletions c/include/libsbp/legacy/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,16 @@ typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
*
* The PPS time message contains the value of the sender's local time in
* microseconds at the moment a pulse is detected on the PPS input. This is to
* be used for syncronisation of sensor data sampled with a local timestamp
* be used for synchronisation of sensor data sampled with a local timestamp
* (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender.
*
* The local time used to timestamp the PPS pulse must be generated by the
* same clock which is used to timestamp the IMU/wheel sensor data and should
* follow the same roll-over rules. A separate MSG_PPS_TIME message should be
* sent for each source of sensor data which uses PPS-relative timestamping.
* The sender ID for each of these MSG_PPS_TIME messages should match the
* sender ID of the respective sensor data.
* follow the same roll-over rules (i.e. it should roll over to zero after
* 604800 seconds). A separate MSG_PPS_TIME message should be sent for each
* source of sensor data which uses local timestamping. The sender ID for
* each of these MSG_PPS_TIME messages should match the sender ID of the
* respective sensor data.
*/

typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
Expand Down
15 changes: 8 additions & 7 deletions c/include/libsbp/legacy/vehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ SBP_PACK_START
* the odometry reference point and the definition and origin of the user
* frame are defined through the device settings interface. There are 4
* possible user-defined sources of this message which are labeled arbitrarily
* source 0 through 3. If using "processor time" time tags, the receiving end
* will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to
* synchronise odometry measurements with GNSS. Processor time shall roll over
* to zero after one week.
* source 0 through 3.
* If using "processor time" time tags, the receiving end will expect either
* `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming odometry data to
* GNSS time. Processor time shall roll over to zero after one week.
*/

typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
Expand All @@ -67,9 +67,10 @@ typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
* 0 to 255. The timestamp associated with this message should represent the
* time when the accumulated tick count reached the value given by the
* contents of this message as accurately as possible. If using "local CPU
* time" time tags, the receiving end will expect a `MSG_GNSS_TIME_OFFSET`
* when a PVT fix becomes available to synchronise wheeltick measurements with
* GNSS. Local CPU time shall roll over to zero after one week.
* time" time tags, the receiving end will also expect either
* `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming wheeltick data to
* GNSS time.
* Local CPU time shall roll over to zero after one week.
*/

typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
Expand Down
2 changes: 1 addition & 1 deletion c/include/libsbp/system/MSG_PPS_TIME.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C" {
*
* The PPS time message contains the value of the sender's local time in
* microseconds at the moment a pulse is detected on the PPS input. This is to
* be used for syncronisation of sensor data sampled with a local timestamp
* be used for synchronisation of sensor data sampled with a local timestamp
* (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender.
*
*/
Expand Down
5 changes: 1 addition & 4 deletions c/include/libsbp/vehicle/MSG_ODOMETRY.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ extern "C" {
* odometry reference point and the definition and origin of the user frame are
* defined through the device settings interface. There are 4 possible
* user-defined sources of this message which are labeled arbitrarily source 0
* through 3. If using "processor time" time tags, the receiving end will expect
* a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise
* odometry measurements with GNSS. Processor time shall roll over to zero after
* one week.
* through 3.
*/
typedef struct {
/**
Expand Down
5 changes: 2 additions & 3 deletions c/include/libsbp/vehicle/MSG_WHEELTICK.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ extern "C" {
* The timestamp associated with this message should represent the time when the
* accumulated tick count reached the value given by the contents of this
* message as accurately as possible. If using "local CPU time" time tags, the
* receiving end will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes
* available to synchronise wheeltick measurements with GNSS. Local CPU time
* shall roll over to zero after one week.
* receiving end will also expect either `MSG_GNSS_TIME_OFFSET` or
* `MSG_PPS_TIME` to sync incoming wheeltick data to GNSS time.
*/
typedef struct {
/**
Expand Down
Binary file modified docs/sbp.pdf
Binary file not shown.
10 changes: 4 additions & 6 deletions haskell/src/SwiftNav/SBP/Imu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ msgImuRaw = 0x0900
-- the indications on the device itself. Measurement units, which are specific
-- to the device hardware and settings, are communicated via the MSG_IMU_AUX
-- message. If using "time since startup" local time tags, the receiving end
-- will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also
-- requires that the MSG_PPS_TIME message be sent prior to any IMU RAW
-- messages that are based on the current (as measured at the PPS edge) local
-- time timestamps. The local time (as defined in the MSG_PPS_TIME message)
-- must wrap around to zero when reaching the extent of the u64 "Local time in
-- microseconds" parameter.
-- will expect either a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the
-- relationship between IMU time and GNSS time.
-- Regardless of the timestamping mode, the timestamp is required to roll over
-- to zero when reaching one week (604800 seconds, or 604800000 milliseconds).
-- The time-tagging mode should not change throughout a run.
data MsgImuRaw = MsgImuRaw
{ _msgImuRaw_tow :: !Word32
Expand Down
11 changes: 6 additions & 5 deletions haskell/src/SwiftNav/SBP/System.hs
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,16 @@ msgPpsTime = 0xFF08
--
-- The PPS time message contains the value of the sender's local time in
-- microseconds at the moment a pulse is detected on the PPS input. This is to
-- be used for syncronisation of sensor data sampled with a local timestamp
-- be used for synchronisation of sensor data sampled with a local timestamp
-- (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender.
--
-- The local time used to timestamp the PPS pulse must be generated by the
-- same clock which is used to timestamp the IMU/wheel sensor data and should
-- follow the same roll-over rules. A separate MSG_PPS_TIME message should be
-- sent for each source of sensor data which uses PPS-relative timestamping.
-- The sender ID for each of these MSG_PPS_TIME messages should match the
-- sender ID of the respective sensor data.
-- follow the same roll-over rules (i.e. it should roll over to zero after
-- 604800 seconds). A separate MSG_PPS_TIME message should be sent for each
-- source of sensor data which uses local timestamping. The sender ID for
-- each of these MSG_PPS_TIME messages should match the sender ID of the
-- respective sensor data.
data MsgPpsTime = MsgPpsTime
{ _msgPpsTime_time :: !Word64
-- ^ Local time in microseconds
Expand Down
15 changes: 8 additions & 7 deletions haskell/src/SwiftNav/SBP/Vehicle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ msgOdometry = 0x0903
-- the odometry reference point and the definition and origin of the user
-- frame are defined through the device settings interface. There are 4
-- possible user-defined sources of this message which are labeled arbitrarily
-- source 0 through 3. If using "processor time" time tags, the receiving end
-- will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to
-- synchronise odometry measurements with GNSS. Processor time shall roll over
-- to zero after one week.
-- source 0 through 3.
-- If using "processor time" time tags, the receiving end will expect either
-- `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming odometry data to
-- GNSS time. Processor time shall roll over to zero after one week.
data MsgOdometry = MsgOdometry
{ _msgOdometry_tow :: !Word32
-- ^ Time field representing either milliseconds in the GPS Week or local
Expand Down Expand Up @@ -88,9 +88,10 @@ msgWheeltick = 0x0904
-- 0 to 255. The timestamp associated with this message should represent the
-- time when the accumulated tick count reached the value given by the
-- contents of this message as accurately as possible. If using "local CPU
-- time" time tags, the receiving end will expect a `MSG_GNSS_TIME_OFFSET`
-- when a PVT fix becomes available to synchronise wheeltick measurements with
-- GNSS. Local CPU time shall roll over to zero after one week.
-- time" time tags, the receiving end will also expect either
-- `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming wheeltick data to
-- GNSS time.
-- Local CPU time shall roll over to zero after one week.
data MsgWheeltick = MsgWheeltick
{ _msgWheeltick_time :: !Word64
-- ^ Time field representing either microseconds since the last PPS,
Expand Down
9 changes: 4 additions & 5 deletions java/src/com/swiftnav/sbp/imu/MsgImuRaw.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
* The sense of the measurements are to be aligned with the indications on the device itself.
* Measurement units, which are specific to the device hardware and settings, are communicated via
* the MSG_IMU_AUX message. If using "time since startup" local time tags, the receiving end will
* expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also requires that the MSG_PPS_TIME
* message be sent prior to any IMU RAW messages that are based on the current (as measured at the
* PPS edge) local time timestamps. The local time (as defined in the MSG_PPS_TIME message) must
* wrap around to zero when reaching the extent of the u64 "Local time in microseconds" parameter.
* The time-tagging mode should not change throughout a run.
* expect either a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the relationship between IMU
* time and GNSS time. Regardless of the timestamping mode, the timestamp is required to roll over
* to zero when reaching one week (604800 seconds, or 604800000 milliseconds). The time-tagging mode
* should not change throughout a run.
*/
public class MsgImuRaw extends SBPMessage {
public static final int TYPE = 0x0900;
Expand Down
14 changes: 7 additions & 7 deletions java/src/com/swiftnav/sbp/system/MsgPpsTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
* construct it inline using a dict of its fields.
*
* <p>The PPS time message contains the value of the sender's local time in microseconds at the
* moment a pulse is detected on the PPS input. This is to be used for syncronisation of sensor data
* sampled with a local timestamp (e.g. IMU or wheeltick messages) where GNSS time is unknown to the
* sender.
* moment a pulse is detected on the PPS input. This is to be used for synchronisation of sensor
* data sampled with a local timestamp (e.g. IMU or wheeltick messages) where GNSS time is unknown
* to the sender.
*
* <p>The local time used to timestamp the PPS pulse must be generated by the same clock which is
* used to timestamp the IMU/wheel sensor data and should follow the same roll-over rules. A
* separate MSG_PPS_TIME message should be sent for each source of sensor data which uses
* PPS-relative timestamping. The sender ID for each of these MSG_PPS_TIME messages should match the
* sender ID of the respective sensor data.
* used to timestamp the IMU/wheel sensor data and should follow the same roll-over rules (i.e. it
* should roll over to zero after 604800 seconds). A separate MSG_PPS_TIME message should be sent
* for each source of sensor data which uses local timestamping. The sender ID for each of these
* MSG_PPS_TIME messages should match the sender ID of the respective sensor data.
*/
public class MsgPpsTime extends SBPMessage {
public static final int TYPE = 0xFF08;
Expand Down
6 changes: 3 additions & 3 deletions java/src/com/swiftnav/sbp/vehicle/MsgOdometry.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
* reference point(s) specified by the user. The offset for the odometry reference point and the
* definition and origin of the user frame are defined through the device settings interface. There
* are 4 possible user-defined sources of this message which are labeled arbitrarily source 0
* through 3. If using "processor time" time tags, the receiving end will expect a
* `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise odometry measurements with
* GNSS. Processor time shall roll over to zero after one week.
* through 3. If using "processor time" time tags, the receiving end will expect either
* `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming odometry data to GNSS time. Processor
* time shall roll over to zero after one week.
*/
public class MsgOdometry extends SBPMessage {
public static final int TYPE = 0x0903;
Expand Down
6 changes: 3 additions & 3 deletions java/src/com/swiftnav/sbp/vehicle/MsgWheeltick.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
* source of this message is identified by the source field, which is an integer ranging from 0 to
* 255. The timestamp associated with this message should represent the time when the accumulated
* tick count reached the value given by the contents of this message as accurately as possible. If
* using "local CPU time" time tags, the receiving end will expect a `MSG_GNSS_TIME_OFFSET` when a
* PVT fix becomes available to synchronise wheeltick measurements with GNSS. Local CPU time shall
* roll over to zero after one week.
* using "local CPU time" time tags, the receiving end will also expect either
* `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming wheeltick data to GNSS time. Local CPU
* time shall roll over to zero after one week.
*/
public class MsgWheeltick extends SBPMessage {
public static final int TYPE = 0x0904;
Expand Down
13 changes: 6 additions & 7 deletions javascript/sbp/imu.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ let UInt64 = require('cuint').UINT64;
* gyroscope readings. The sense of the measurements are to be aligned with the
* indications on the device itself. Measurement units, which are specific to the
* device hardware and settings, are communicated via the MSG_IMU_AUX message. If
* using "time since startup" local time tags, the receiving end will expect a
* `MSG_PPS_TIME` regardless of GNSS fix state. This also requires that the
* MSG_PPS_TIME message be sent prior to any IMU RAW messages that are based on the
* current (as measured at the PPS edge) local time timestamps. The local time (as
* defined in the MSG_PPS_TIME message) must wrap around to zero when reaching the
* extent of the u64 "Local time in microseconds" parameter. The time-tagging mode
* should not change throughout a run.
* using "time since startup" local time tags, the receiving end will expect either
* a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the relationship between IMU
* time and GNSS time. Regardless of the timestamping mode, the timestamp is
* required to roll over to zero when reaching one week (604800 seconds, or
* 604800000 milliseconds). The time-tagging mode should not change throughout a
* run.
*
* Fields in the SBP payload (`sbp.payload`):
* @field tow number (unsigned 32-bit int, 4 bytes) Milliseconds since reference epoch and time status.
Expand Down
9 changes: 5 additions & 4 deletions javascript/sbp/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,14 @@ MsgGnssTimeOffset.prototype.fieldSpec.push(['flags', 'writeUInt8', 1]);
*
* The PPS time message contains the value of the sender's local time in
* microseconds at the moment a pulse is detected on the PPS input. This is to be
* used for syncronisation of sensor data sampled with a local timestamp (e.g. IMU
* used for synchronisation of sensor data sampled with a local timestamp (e.g. IMU
* or wheeltick messages) where GNSS time is unknown to the sender. The local time
* used to timestamp the PPS pulse must be generated by the same clock which is
* used to timestamp the IMU/wheel sensor data and should follow the same roll-over
* rules. A separate MSG_PPS_TIME message should be sent for each source of sensor
* data which uses PPS-relative timestamping. The sender ID for each of these
* MSG_PPS_TIME messages should match the sender ID of the respective sensor data.
* rules (i.e. it should roll over to zero after 604800 seconds). A separate
* MSG_PPS_TIME message should be sent for each source of sensor data which uses
* local timestamping. The sender ID for each of these MSG_PPS_TIME messages
* should match the sender ID of the respective sensor data.
*
* Fields in the SBP payload (`sbp.payload`):
* @field time number (unsigned 64-bit int, 8 bytes) Local time in microseconds
Expand Down
13 changes: 7 additions & 6 deletions javascript/sbp/vehicle.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ let UInt64 = require('cuint').UINT64;
* odometry reference point and the definition and origin of the user frame are
* defined through the device settings interface. There are 4 possible user-defined
* sources of this message which are labeled arbitrarily source 0 through 3. If
* using "processor time" time tags, the receiving end will expect a
* `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise odometry
* measurements with GNSS. Processor time shall roll over to zero after one week.
* using "processor time" time tags, the receiving end will expect either
* `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming odometry data to GNSS
* time. Processor time shall roll over to zero after one week.
*
* Fields in the SBP payload (`sbp.payload`):
* @field tow number (unsigned 32-bit int, 4 bytes) Time field representing either milliseconds in the GPS Week or local CPU time
Expand Down Expand Up @@ -75,9 +75,10 @@ MsgOdometry.prototype.fieldSpec.push(['flags', 'writeUInt8', 1]);
* by the source field, which is an integer ranging from 0 to 255. The timestamp
* associated with this message should represent the time when the accumulated tick
* count reached the value given by the contents of this message as accurately as
* possible. If using "local CPU time" time tags, the receiving end will expect a
* `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise wheeltick
* measurements with GNSS. Local CPU time shall roll over to zero after one week.
* possible. If using "local CPU time" time tags, the receiving end will also
* expect either `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming
* wheeltick data to GNSS time. Local CPU time shall roll over to zero after one
* week.
*
* Fields in the SBP payload (`sbp.payload`):
* @field time number (unsigned 64-bit int, 8 bytes) Time field representing either microseconds since the last PPS, microseconds in
Expand Down
Loading

0 comments on commit 2df29c8

Please sign in to comment.