autotest: print beacon position delta as float, not truncated %u#33558
autotest: print beacon position delta as float, not truncated %u#33558peterbarker wants to merge 1 commit into
Conversation
| # :.2f, not %u: pos_delta is a float distance in metres; %u | ||
| # truncated it, so e.g. a real 1.55 m miss printed as "delta=1" | ||
| # and looked like it satisfied "want <= 1". |
There was a problem hiding this comment.
IMO this comment is unnecessary.
But also OK as-is.
There was a problem hiding this comment.
Yeah, it really wasn't. Fixed.
BeaconPosition() (also exercised by the Replay Beacon bit) waits for the EKF position to settle within max_delta=1 m of the pre-switch GPS fix and logs the distance with "delta=%u". pos_delta is a float in metres, so %u truncated it: a genuine 1.55 m miss printed as "delta=1", which reads as though it satisfied "want <= 1" yet the test still timed out -- actively misleading when diagnosing the beacon-convergence flake. Print %.2f. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a3b0795 to
e99a0c6
Compare
tpwrules
left a comment
There was a problem hiding this comment.
Does this just make the issue happen at 1.004? Can you think of any reason to limit the number of digits at all? Do you think that is a likely case?
Pretty sure we have reasonable epsilons here, so we don't need all the digits. |
|
I do not see any epsilon in the next line. I'm not hoping to be difficult, just pointing out that according to my understanding this PR does not fully solve the problem laid out in the description. If you think it's close enough I'm fine, just want to make sure we share an understanding. |
Summary
Adjusts output to add more precision
Classification & Testing (check all that apply and add your own)
Description
BeaconPosition() (also exercised by the Replay Beacon bit) waits for the EKF position to settle within max_delta=1 m of the pre-switch GPS fix and logs the distance with "delta=%u". pos_delta is a float in metres, so %u truncated it: a genuine 1.55 m miss printed as "delta=1", which reads as though it satisfied "want <= 1" yet the test still timed out -- actively misleading when diagnosing the beacon-convergence flake. Print %.2f.
Discovered as part of chasing this outlier down: