fix: replace incremental comet update with full reinit#391
Open
mrosseel wants to merge 1 commit intobrickbots:mainfrom
Open
fix: replace incremental comet update with full reinit#391mrosseel wants to merge 1 commit intobrickbots:mainfrom
mrosseel wants to merge 1 commit intobrickbots:mainfrom
Conversation
The incremental update path in do_timed_task() could never add new comets or remove stale ones. Combined with a boot-time race condition (wrong datetime before GPS lock), the initial catalog could contain wrong comets with no way to self-correct. init_comets() is already idempotent and the computation cost is identical since calc_comets() was called on every update anyway. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ebc8c06 to
729d09b
Compare
Collaborator
|
Does this in any way depend on OS clock being synchronized to GPS clock? AFAIK, we do not have the OS clock synchronized at all! On my PiFinders I usually install Chrony and enable synchronization, but I can‘t find an indication in brickbots/PiFinder that we are trying to (synchronize OS time). |
Collaborator
Author
|
it depends on 'dt = self.shared_state.datetime()' which is set by the GPS (i think), os time is not used really. We could sync it but then we could have weird time jumps, not sure raspbian likes that. Any experiences there? Only upside is correct log file timestamps I guess. |
1756af0 to
729d09b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
do_timed_task()could never add new comets or remove stale ones once the catalog was initially populatedinit_comets()which is already idempotent and has identical computation cost (sincecalc_comets()was called on every update anyway)Symptoms observed
Test plan
🤖 Generated with Claude Code