[photon-lib] Add PhotonPoseEstimator.resetHeadingData()#1933
Merged
samfreund merged 3 commits intoPhotonVision:mainfrom Apr 26, 2025
Merged
[photon-lib] Add PhotonPoseEstimator.resetHeadingData()#1933samfreund merged 3 commits intoPhotonVision:mainfrom
samfreund merged 3 commits intoPhotonVision:mainfrom
Conversation
Member
|
LGTM, but as I'm not that familiar with the pose estimator, I'll leave it to someone else to approve. |
photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java
Outdated
Show resolved
Hide resolved
spacey-sooty
approved these changes
Apr 26, 2025
samfreund
pushed a commit
to samfreund/photonvision
that referenced
this pull request
Jun 28, 2025
7 tasks
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.
Description
When using
PNP_DISTANCE_TRIG_SOLVE, heading data provided prior to a pose or rotation reset (examples including resetting odometry at the start of autonomous, or zeroing the robot's gyro) may be utilized when calculating future pose estimates, which can cause unpredictable behavior in some scenarios. This PR addsPhotonPoseEstimator.resetHeadingData(), giving users the option to manually clear the heading buffer to avoid the aforementioned issue.Here's a log from one of my team's practice matches, where we observed irregular vision measurements at the start of autonomous, after the robot's pose was reset. Afterwards, we copied
PhotonPoseEstimatorinto our robot code and implemented the method added by this PR, which resolved the problem. Green ghosts are the poses given by Photon, the solid model is our estimated pose.2025-04-25.17-07-09.mp4
Meta
Merge checklist: