Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passing elapsed time instead of real timestamp to the GeomagneticField constructor #79

Open
ftabashir opened this issue Jun 20, 2020 · 1 comment

Comments

@ftabashir
Copy link

Last parameter of GeomagneticField constructor is timeMillis. Here is the documentation of this parameter:

Time at which to evaluate the declination, in milliseconds
since January 1, 1970. (approximate is fine -- the declination
changes very slowly).

In KalmanLocationService the timestamp which is passed to GeomagneticField is calculated like this:

timeStamp = Utils.nano2milli(location.getElapsedRealtimeNanos());

As you see Location.getElapsedRealtimeNanos is used which its value is nanoseconds since last device boot (instead of milliseconds since January 1, 1970)
Shouldn't it be Location.getTime()?

@Lezh1k
Copy link
Collaborator

Lezh1k commented Jun 22, 2020

So, this is an error and we should use unix timestamp instead of Location.getElapsedRealtimeNanos. Does Location.getTime() do what we want? We will change it then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants