forstack overflowizi
forstack overflowizi

Reputation: 424

GnssClock method getFullBiasNanos returns a decreasing number every callback when it should be increasing by definition

The method public long getFullBiasNanos () in the GnssClock class is defined to be:

the difference between hardware clock (getTimeNanos()) inside GPS receiver and the true GPS time since 0000Z, January 6, 1980, in nanoseconds.

So i assumed that every time i will get a callback event for the gnss measurements(from which i am extracting the gnss clock), this number will grow, as the subsequent calls arrive at subsequent times, so that the time of the received measurement will be larger (naturally we are moving AWAY from 1980, not towards it)
However that is not seemed to be the case, Here are two readings (the first and last) i got while the app was running: (date and time stamp attached)
First was on 14:11:40

2022-07-06 14:11:40.985 12285-12304/com.example.gnss1 I/aabaab: full Bias Nanos: -1340320027695657699

Last was on 14:13:40

2022-07-06 14:13:40.040 12285-12304/com.example.gnss1 I/aabaab: full Bias Nanos: -1340320027695649792

As you can see, after 2 full minutes of the app running, the result of getFullBiasNanos() didn't increase, it actually DECREASED by a couple of thousands of nano seconds, when it should have been increased by hundreds of billions of nano-seconds.
What am i missing?
Thank you in advance

Upvotes: 1

Views: 297

Answers (2)

龙隆萌
龙隆萌

Reputation: 16

The explanation is just like the official docs at getFullBiasNanos. What I want to add is that this method should reflect the relative stability between the local GNSS receiver clock and the GPS clock. Normally, the duration between each GnssMeasurementsEvent.Callback shoud be 1s. If you log the GnssMeasurementsEvent (you mey refer to the GNSSLogger android app), the gnssClock.getTimeNanos() interval is perfect 1s. The local GNSS receiver clock could not reach this high precision. At the same time, gnssClock.getFullBiasNanos() interval fluctuates, whos value is less than 1 us. Combining these two values, the estimated GPS time shoud have us level precision. Welcome more discussion about the GnssClock.

Upvotes: 0

forstack overflowizi
forstack overflowizi

Reputation: 424

Not a complete solution, but probably part of it:
gnssClock.getTimeNanos() retrieves the number of nanos passed since reboot until gnss measurement arrived from the satellite,
While gnssClock.getFullBiasNanos() retrieves the number of nanos between gps epoch (1980) until reboot.
Together these values create the time from gps epoch (1980) until gnss measurement arrived at phone.
If anyone has a better understanding of this please let me know

Upvotes: 0

Related Questions