Skip to content

Commit 2df29c8

Browse files
reimerixwoodfellMatt Woodward
authored
Clarify timestamping descriptions [AP-1087] (#1395)
# 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 <46688854+woodfell@users.noreply.github.com> Co-authored-by: Matt Woodward <matthew.woodward@swift-nav.com>
1 parent 416da16 commit 2df29c8

File tree

37 files changed

+191
-195
lines changed

37 files changed

+191
-195
lines changed

c/include/libsbp/imu/MSG_IMU_RAW.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ extern "C" {
4545
* indications on the device itself. Measurement units, which are specific to
4646
* the device hardware and settings, are communicated via the MSG_IMU_AUX
4747
* message. If using "time since startup" local time tags, the receiving end
48-
* will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also requires
49-
* that the MSG_PPS_TIME message be sent prior to any IMU RAW messages that are
50-
* based on the current (as measured at the PPS edge) local time timestamps. The
51-
* local time (as defined in the MSG_PPS_TIME message) must wrap around to zero
52-
* when reaching the extent of the u64 "Local time in microseconds" parameter.
48+
* will expect either a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the
49+
* relationship between IMU time and GNSS time. Regardless of the timestamping
50+
* mode, the timestamp is required to roll over to zero when reaching one week
51+
* (604800 seconds, or 604800000 milliseconds).
5352
*/
5453
typedef struct {
5554
/**

c/include/libsbp/legacy/imu.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ SBP_PACK_START
4242
* the indications on the device itself. Measurement units, which are specific
4343
* to the device hardware and settings, are communicated via the MSG_IMU_AUX
4444
* message. If using "time since startup" local time tags, the receiving end
45-
* will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also
46-
* requires that the MSG_PPS_TIME message be sent prior to any IMU RAW
47-
* messages that are based on the current (as measured at the PPS edge) local
48-
* time timestamps. The local time (as defined in the MSG_PPS_TIME message)
49-
* must wrap around to zero when reaching the extent of the u64 "Local time in
50-
* microseconds" parameter.
45+
* will expect either a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the
46+
* relationship between IMU time and GNSS time.
47+
* Regardless of the timestamping mode, the timestamp is required to roll over
48+
* to zero when reaching one week (604800 seconds, or 604800000 milliseconds).
5149
* The time-tagging mode should not change throughout a run.
5250
*/
5351

c/include/libsbp/legacy/system.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,16 @@ typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
217217
*
218218
* The PPS time message contains the value of the sender's local time in
219219
* microseconds at the moment a pulse is detected on the PPS input. This is to
220-
* be used for syncronisation of sensor data sampled with a local timestamp
220+
* be used for synchronisation of sensor data sampled with a local timestamp
221221
* (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender.
222222
*
223223
* The local time used to timestamp the PPS pulse must be generated by the
224224
* same clock which is used to timestamp the IMU/wheel sensor data and should
225-
* follow the same roll-over rules. A separate MSG_PPS_TIME message should be
226-
* sent for each source of sensor data which uses PPS-relative timestamping.
227-
* The sender ID for each of these MSG_PPS_TIME messages should match the
228-
* sender ID of the respective sensor data.
225+
* follow the same roll-over rules (i.e. it should roll over to zero after
226+
* 604800 seconds). A separate MSG_PPS_TIME message should be sent for each
227+
* source of sensor data which uses local timestamping. The sender ID for
228+
* each of these MSG_PPS_TIME messages should match the sender ID of the
229+
* respective sensor data.
229230
*/
230231

231232
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {

c/include/libsbp/legacy/vehicle.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ SBP_PACK_START
4242
* the odometry reference point and the definition and origin of the user
4343
* frame are defined through the device settings interface. There are 4
4444
* possible user-defined sources of this message which are labeled arbitrarily
45-
* source 0 through 3. If using "processor time" time tags, the receiving end
46-
* will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to
47-
* synchronise odometry measurements with GNSS. Processor time shall roll over
48-
* to zero after one week.
45+
* source 0 through 3.
46+
* If using "processor time" time tags, the receiving end will expect either
47+
* `MSG_GNSS_TIME_OFFSET` or `MSG_PPS_TIME` to sync incoming odometry data to
48+
* GNSS time. Processor time shall roll over to zero after one week.
4949
*/
5050

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

7576
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {

c/include/libsbp/system/MSG_PPS_TIME.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern "C" {
4242
*
4343
* The PPS time message contains the value of the sender's local time in
4444
* microseconds at the moment a pulse is detected on the PPS input. This is to
45-
* be used for syncronisation of sensor data sampled with a local timestamp
45+
* be used for synchronisation of sensor data sampled with a local timestamp
4646
* (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender.
4747
*
4848
*/

c/include/libsbp/vehicle/MSG_ODOMETRY.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ extern "C" {
4545
* odometry reference point and the definition and origin of the user frame are
4646
* defined through the device settings interface. There are 4 possible
4747
* user-defined sources of this message which are labeled arbitrarily source 0
48-
* through 3. If using "processor time" time tags, the receiving end will expect
49-
* a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise
50-
* odometry measurements with GNSS. Processor time shall roll over to zero after
51-
* one week.
48+
* through 3.
5249
*/
5350
typedef struct {
5451
/**

c/include/libsbp/vehicle/MSG_WHEELTICK.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ extern "C" {
4848
* The timestamp associated with this message should represent the time when the
4949
* accumulated tick count reached the value given by the contents of this
5050
* message as accurately as possible. If using "local CPU time" time tags, the
51-
* receiving end will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes
52-
* available to synchronise wheeltick measurements with GNSS. Local CPU time
53-
* shall roll over to zero after one week.
51+
* receiving end will also expect either `MSG_GNSS_TIME_OFFSET` or
52+
* `MSG_PPS_TIME` to sync incoming wheeltick data to GNSS time.
5453
*/
5554
typedef struct {
5655
/**

docs/sbp.pdf

962 Bytes
Binary file not shown.

haskell/src/SwiftNav/SBP/Imu.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ msgImuRaw = 0x0900
4545
-- the indications on the device itself. Measurement units, which are specific
4646
-- to the device hardware and settings, are communicated via the MSG_IMU_AUX
4747
-- message. If using "time since startup" local time tags, the receiving end
48-
-- will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also
49-
-- requires that the MSG_PPS_TIME message be sent prior to any IMU RAW
50-
-- messages that are based on the current (as measured at the PPS edge) local
51-
-- time timestamps. The local time (as defined in the MSG_PPS_TIME message)
52-
-- must wrap around to zero when reaching the extent of the u64 "Local time in
53-
-- microseconds" parameter.
48+
-- will expect either a MSG_GNSS_TIME_OFFSET or MSG_PPS_TIME to establish the
49+
-- relationship between IMU time and GNSS time.
50+
-- Regardless of the timestamping mode, the timestamp is required to roll over
51+
-- to zero when reaching one week (604800 seconds, or 604800000 milliseconds).
5452
-- The time-tagging mode should not change throughout a run.
5553
data MsgImuRaw = MsgImuRaw
5654
{ _msgImuRaw_tow :: !Word32

haskell/src/SwiftNav/SBP/System.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,16 @@ msgPpsTime = 0xFF08
454454
--
455455
-- The PPS time message contains the value of the sender's local time in
456456
-- microseconds at the moment a pulse is detected on the PPS input. This is to
457-
-- be used for syncronisation of sensor data sampled with a local timestamp
457+
-- be used for synchronisation of sensor data sampled with a local timestamp
458458
-- (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender.
459459
--
460460
-- The local time used to timestamp the PPS pulse must be generated by the
461461
-- same clock which is used to timestamp the IMU/wheel sensor data and should
462-
-- follow the same roll-over rules. A separate MSG_PPS_TIME message should be
463-
-- sent for each source of sensor data which uses PPS-relative timestamping.
464-
-- The sender ID for each of these MSG_PPS_TIME messages should match the
465-
-- sender ID of the respective sensor data.
462+
-- follow the same roll-over rules (i.e. it should roll over to zero after
463+
-- 604800 seconds). A separate MSG_PPS_TIME message should be sent for each
464+
-- source of sensor data which uses local timestamping. The sender ID for
465+
-- each of these MSG_PPS_TIME messages should match the sender ID of the
466+
-- respective sensor data.
466467
data MsgPpsTime = MsgPpsTime
467468
{ _msgPpsTime_time :: !Word64
468469
-- ^ Local time in microseconds

0 commit comments

Comments
 (0)