fix(sensors): propagate equal_value_threshold to dynamic DataValidators#27822
Open
ARYA-mgc wants to merge 1 commit into
Open
fix(sensors): propagate equal_value_threshold to dynamic DataValidators#27822ARYA-mgc wants to merge 1 commit into
ARYA-mgc wants to merge 1 commit into
Conversation
When new DataValidators are dynamically added to a DataValidatorGroup via add_new_validator(), they previously initialized with the hardcoded default threshold. If the group had a custom equal_value_threshold set, the new validator would silently ignore it, causing inconsistent sensor failover behavior. This commit: - Stores the group's current threshold in an _equal_value_threshold member - Applies the stored threshold immediately to newly added validators - Adds a getter and test assertion to verify proper propagation - Removes the related TODO workarounds in the test suite
Contributor
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 8 byte (0 %)]px4_fmu-v6x [Total VM Diff: 24 byte (0 %)]Updated: 2026-07-06T17:40:25 |
Author
|
Hi @mrpollo, sorry to tag you directly and add noise to your notifications - I wasn't sure who else to reach for this area. |
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.
Found this while comparing
set_timeout()andset_equal_value_threshold()inDataValidatorGrouptimeout stores_timeout_interval_usand applies it inadd_new_validator(), but the threshold setter had no equivalent storage. Confirmed via the test file, which already hadTODOcomments flagging this exact gap and worked around it manually.Added
_equal_value_thresholdmember (mirrors_timeout_interval_us), applied it inadd_new_validator(), removed the workaround + TODOs, added an assertion to lock in correct behavior.This is my first PR to PX4 - happy to adjust based on any feedback.