Skip to content

Open up pose estimator strategy methods#2252

Merged
mcm001 merged 10 commits intoPhotonVision:mainfrom
Gold856:pose-est
Jan 11, 2026
Merged

Open up pose estimator strategy methods#2252
mcm001 merged 10 commits intoPhotonVision:mainfrom
Gold856:pose-est

Conversation

@Gold856
Copy link
Copy Markdown
Contributor

@Gold856 Gold856 commented Dec 17, 2025

Description

PhotonPoseEstimator has some rather leaky abstractions surrounding the processing of pipeline results. Pose caching makes attempts at comparing the same result with different strategies nearly impossible, and the singular update method with several optional arguments is error prone when you need to provide data for strategies like Constrained SolvePnP, as you can completely miss passing those arguments. Constrained SolvePnP itself has some abstraction leaks due to needing a seed pose, and it currently uses either the multi-tag result, or the multi-tag fallback, which is leaky and inflexible.

Following the design laid out in #1835, all the strategies have now been opened up into their own methods, giving the user complete control over how they want to use a pipeline result. All formerly optional arguments have either been removed for strategies that don't need them, or required for the strategies that do need them. All the old PoseStrategy and update methods have been deprecated for backwards compatibility, except for Python, which is very behind in terms of API parity, which this PR intends to help fix.

Closes #1805, closes #1835, closes #2239.

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@Gold856 Gold856 requested a review from a team as a code owner December 17, 2025 09:37
@github-actions github-actions Bot added documentation Anything relating to https://docs.photonvision.org photonlib Things related to the PhotonVision library labels Dec 17, 2025
Comment thread docs/source/docs/programming/photonlib/robot-pose-estimator.md Outdated
Comment thread photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java
@Gold856 Gold856 force-pushed the pose-est branch 9 times, most recently from 4249f76 to df63de7 Compare December 20, 2025 00:59
Copy link
Copy Markdown
Contributor

@mcm001 mcm001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

broadly lgtm. big fan of this new api.

Comment thread docs/source/docs/programming/photonlib/robot-pose-estimator.md Outdated
@Gold856 Gold856 force-pushed the pose-est branch 2 times, most recently from adba869 to d548a29 Compare December 20, 2025 03:15
Comment thread photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java Outdated
Comment thread photon-lib/src/test/java/org/photonvision/PhotonPoseEstimatorTest.java Outdated
Comment thread photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java
Comment thread docs/source/docs/programming/photonlib/robot-pose-estimator.md Outdated
Comment thread photon-lib/py/photonlibpy/photonPoseEstimator.py
Comment thread photon-lib/py/photonlibpy/photonPoseEstimator.py
Comment thread photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java Outdated
@Gold856 Gold856 force-pushed the pose-est branch 2 times, most recently from 7abc1e8 to 722719a Compare December 31, 2025 02:33
@mcm001
Copy link
Copy Markdown
Contributor

mcm001 commented Jan 4, 2026

@amquake @spacey-sooty since you left comments, can you review and approve if you're happy?

spacey-sooty
spacey-sooty previously approved these changes Jan 4, 2026
Comment thread photon-lib/src/main/native/include/photon/PhotonPoseEstimator.h Outdated
Comment thread docs/source/docs/programming/photonlib/robot-pose-estimator.md Outdated
@mcm001 mcm001 enabled auto-merge (squash) January 7, 2026 16:08
@mcm001 mcm001 disabled auto-merge January 7, 2026 16:08
@Gold856 Gold856 force-pushed the pose-est branch 2 times, most recently from aeb31ad to 590b721 Compare January 8, 2026 00:55
Copy link
Copy Markdown
Member

@amquake amquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only really looking at java and not validating this in sim but tests are green so LGTM

@mcm001 mcm001 enabled auto-merge (squash) January 11, 2026 18:26
@samfreund samfreund disabled auto-merge January 11, 2026 18:50
@samfreund samfreund enabled auto-merge (squash) January 11, 2026 18:50
@mcm001 mcm001 disabled auto-merge January 11, 2026 18:52
@mcm001 mcm001 enabled auto-merge (squash) January 11, 2026 18:52
@mcm001 mcm001 merged commit a5dc9ec into PhotonVision:main Jan 11, 2026
56 checks passed
@Gold856 Gold856 deleted the pose-est branch January 11, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Anything relating to https://docs.photonvision.org photonlib Things related to the PhotonVision library

Projects

None yet

5 participants