Describe the bug
In both PhotonPoseEstimator.checkUpdate() (Java) and PhotonPoseEstimator._checkUpdate() (Python) the cache is not invalidated if the first parameter is empty/null. With the current usages, this means that if the reference pose was not set, setting it would not invalidate the cache.
To Reproduce
Steps to reproduce the behavior in Python:
camera = createCameraWithVisibleTag()
estimator = PhotonPoseEstimator(
aprilTags, PoseStrategy.LOWEST_AMBIGUITY, camera, Transform3d())
estimatedPose = estimator.update()
assert estimatedPose is not None
estimator.referencePose = Pose3d(3, 3, 3, robotToCamera)
assert estimator._poseCacheTimestampSeconds == -1 # fails
Steps to reproduce the behavior in Java:
PhotonCamera camera = createCameraWithVisibleTag();
var estimator = new PhotonPoseEstimator(
aprilTags, PoseStrategy.LOWEST_AMBIGUITY, camera, robotToCamera);
var estimatedPose = estimator.update(cameraResult);
assert estimatedPose.isPresent();
estimator.setReferencePose(new Pose3d(3, 3, 3, new Rotation3d());
assert estimator.poseCacheTimestampSeconds == -1 // fails
Additional context
I found this while adding working on adding support for more strategies in Python.
I have a fix I'll be sending out shortly for Python
Describe the bug
In both
PhotonPoseEstimator.checkUpdate()(Java) andPhotonPoseEstimator._checkUpdate()(Python) the cache is not invalidated if the first parameter is empty/null. With the current usages, this means that if the reference pose was not set, setting it would not invalidate the cache.To Reproduce
Steps to reproduce the behavior in Python:
Steps to reproduce the behavior in Java:
Additional context
I found this while adding working on adding support for more strategies in Python.
I have a fix I'll be sending out shortly for Python