Store the last pose on update (#1207)

* Store the last pose on update

* Don't clear lastPose if pose isn't calculated

---------

Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
This commit is contained in:
Tim Winters
2024-02-05 09:50:36 -05:00
committed by GitHub
parent 7666f152bb
commit 0eb0a4e3c5
2 changed files with 5 additions and 2 deletions

View File

@@ -408,8 +408,8 @@ public class PhotonPoseEstimator {
return Optional.empty();
}
if (estimatedPose.isEmpty()) {
lastPose = null;
if (estimatedPose.isPresent()) {
lastPose = estimatedPose.get().estimatedPose;
}
return estimatedPose;