Repository navigation
Report zero timestamps even when no valid timestamp arrived - #672
Open
tomek89wo-ops wants to merge 1 commit into
Open
tomek89wo-ops wants to merge 1 commit into
tomek89wo-ops wants to merge 1 commit into
Conversation
TimeStampStatus only evaluated zero_seen inside the branch taken when at least one non-zero timestamp was received in the period. When a source publishes only zero stamps (e.g. a driver that never fills header.stamp), run() reported WARN "No data since last update.", did not increment the "Zero seen diagnostic update count", and then reset zero_seen, so the detection was discarded. Move the zero_seen check out of that branch in both the C++ and Python implementations, and add a test for a period containing only zero stamps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
TimeStampStatusonly checkszero_seenwhen at least one non-zero timestamp arrived in the period. If a source publishes only zero stamps (for example a driver that never fillsheader.stamp),run()reports WARN "No data since last update.", does not increment "Zero seen diagnostic update count", and then resetszero_seen, so the zero-stamp detection is lost.This moves the
zero_seencheck out of that branch in both the C++ and the Python implementation, and adds a test for a period that contains only zero stamps to both test suites. Behaviour for future, past and valid timestamps is unchanged.Testing: the Python change was run against the real
_update_functions.pywith the ROS dependencies stubbed out — the new case fails before the change (WARN, counter 0) and passes after it, and the existing cases still pass. The C++ change mirrors the Python one, but I could not build it locally, so I am relying on CI for it.Disclosure: this change was prepared with AI assistance (Claude), as noted in the commit trailer.