Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Verify that loaded almanac is valid (within a certain week number range) #470

Closed

Conversation

denniszollo
Copy link
Contributor

Invalidate almanac in memory if invalid for a particular PRN when discovered.

This is a check that is most relevant in the future when we are decoding the almanac or sending it to the device. It may affect people who haven't used Piksi for a long time but used it last when we used to send the almanac to the device through the console.

@swiftnav-jenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/piksi_firmware_Pull_Requests/460/
Test PASSed.

@denniszollo
Copy link
Contributor Author

/cc @henryhallam what do you think of this?

@@ -171,8 +183,16 @@ static void manage_calc_almanac_scores(void)
/* No almanac or position/time information, give it the benefit of the
* doubt. */
acq_prn_param[prn].score[ACQ_HINT_ALMANAC] = 0;
} else if (almanac[prn].valid && time_quality > TIME_COARSE &&
(abs(almanac[prn].week - t.wn%1024) > MAX_ALM_WEEK_DIFF)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not roll this into the previous condition, and simply not use the almanac for this PRN rather than labeling the almanac entry as invalid?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we ought to make sure the week number stuff is thoroughly thought through. IIRC the policy was to use full-length, non-wrapping week numbers internally, and correct the received mod-1024 value to the full length value at the time we receive a TOW, ephemeris or almanac from the sky or the internet. So the % 1024 here, and the -1024 later, might not be appropriate here. @fnoble is that what you had in mind?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that we only need to check the file/memory once.
If we see that it is invalid, it is invalid for eterinity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The policy is definitely to correct the week number for rollover at the point of decoding, and use the full week number everywhere internally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so does this mean that our almanac file and corresponding SBP message should be the full week number?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

On Wed, Jul 8, 2015 at 1:04 PM, denniszollo [email protected]
wrote:

In src/manage.c
#470 (comment)
:

@@ -171,8 +183,16 @@ static void manage_calc_almanac_scores(void)
/* No almanac or position/time information, give it the benefit of the
* doubt. */
acq_prn_param[prn].score[ACQ_HINT_ALMANAC] = 0;

  • } else if (almanac[prn].valid && time_quality > TIME_COARSE &&
  •          (abs(almanac[prn].week - t.wn%1024) > MAX_ALM_WEEK_DIFF)) {
    

so does this mean that our almanac file and corresponding SBP message
should be the full week number?


Reply to this email directly or view it on GitHub
https://github.com/swift-nav/piksi_firmware/pull/470/files#r34191971.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces around %

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment "TODO: Fix almanac week numbers and use gpsdifftime()"

@denniszollo denniszollo force-pushed the use_only_valid_almanac branch from e23265c to 29a8199 Compare September 9, 2015 01:06
@swiftnav-jenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/piksi_firmware_Pull_Requests/657/
Test FAILed.

@denniszollo denniszollo force-pushed the use_only_valid_almanac branch from 29a8199 to 361a2d5 Compare September 9, 2015 01:20
@denniszollo
Copy link
Contributor Author

Rebased on master, added TODOs, style fixes, and created the following issues for next steps:
https://github.com/swift-nav/libswiftnav/issues/217
#550
swift-nav/libsbp#246

@swiftnav-jenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/piksi_firmware_Pull_Requests/658/
Test PASSed.

@sashamitelman
Copy link

Do we check NMCT? If not, the method described in this article may be worth implementing:

https://www.ion.org/publications/abstract.cfm?articleID=1682

(I have the PDF of the entire article if it sounds like it would be useful. I'd think implementation would be pretty straightforward.)

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

Successfully merging this pull request may close these issues.

5 participants