[photon-lib] Invalidate pose cache when setting referencePose#2040
[photon-lib] Invalidate pose cache when setting referencePose#2040samfreund merged 4 commits intoPhotonVision:mainfrom
Conversation
b9067c6 to
2041e2b
Compare
|
I'd prefer that we not close #2039 after this PR because it will still apply for Java. |
Agreed. Wasn't sure on the proper way to associate this PR with that bug without auto-closing the bug at merge time. |
If u mention it that links it. I just edited it, let me know if that looks good to you. |
2041e2b to
b847b8a
Compare
The Java code was trivial to fix and verify, so pushed a commit to fix that as well.
It does not happen in the C++ code; updated the tests to confirm. |
380ec56 to
f9df7cc
Compare
|
@kcooney looks like you got a failing test. |
f9df7cc to
e5e9db4
Compare
@samfreund when I looked, all checks were reported as passed (excluding 3 skipped tasks). Rebased from main and pushed again, and GitHub is reporting "All checks have passed" 🤷♂️ |
Lemme rephrase, looks like we have a flaky test 💀. Sorry about that! |
|
Whoops, that’s my bad. I reran the failing job and forgot to mention that. Sorry! |
mcm001
left a comment
There was a problem hiding this comment.
On mobile but seems reasonable to me
Gold856
left a comment
There was a problem hiding this comment.
The time units are different in Python between PipelineResult and PipelineMetadata? Weird, but the new test utils seem pretty nice for handling that. LGTM
|
We should probably make that consistent in follow on work |
Setting
PhotonPoseEstimator.referencePosenow resets the pose cache, evenif there was not a previous reference pose value.
Previously, the pose cache would only be cleared if the estimator had a
reference pose and was updated to a different reference pose value, which
is likely not what users may expect.
Fixes #2039
Java changes:
PhotonPoseEstimator.checkUpdate()PhotonPoseEstimatorTest.cacheIsInvalidated()to verify the fixPython changes:
Fix (and simplify)
PhotonPoseEstimator._checkUpdate()Update
photonPoseEstimator_test.test_cacheIsInvalidated()to verify thefix
Add
PipelineTimestampsin thetestpackage (to make it easier toensure that
PhotonCameraResult.getTimestampSeconds()returns non-negative values)
Fix pyright errors in
photonPoseEstimator_test.pyC++ changes:
PhotonPoseEstimatorTest_PoseCache_Testto confirm this bug didnot exist in the C++ code
Other changes:
photon-lib/py/buildAndTest.shto specify the shell, to not assumethat the current directory is the one with the script, and to not assume
that
bdist_wheelwas installed