Skip to content

fix: raise when the pose estimate of ESTPOSE_P fails - #264

Merged
petercorke merged 2 commits into
mainfrom
bug/estpose-failure
Nov 23, 2026
Merged

petercorke merged 2 commits into
mainfrom
bug/estpose-failure

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Fixes bug list item 11. The ESTPOSE_P block output None when CentralCamera.estpose found no solution (OpenCV solvePnP returned no pose), and the next block in the diagram received None as its input.

  • EstPose_p.output raises RuntimeError("pose estimation failed: method 'ippe' found no pose for 8 points"). bdsim prints the block, the time and the input and stops the run with a "Fatal failure" error caused by this one. I chose to raise, not hold the last pose, so that a bad setup is not hidden; a long run of failures would otherwise look like a frozen pose.
  • The block docstring has :raises RuntimeError: and a .. versionchanged:: 2.5.0 note. CentralCamera.estpose already returned SE3 | None, and its :return: text now says None is possible.

Tests: with every image point at one position the ippe method finds no pose, so estpose gives None (checked first), and the block raises with the method and point count in the message. A real bdsim diagram of CONSTANT -> ESTPOSE_P fails at compile with the error as its cause, and bdsim prints the block name. The existing frame tests are unchanged. mypy reports no issues and the full suite passes (2163 passed, 33 skipped).

AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.

🤖 Generated with Claude Code

The block output None when CentralCamera.estpose found no solution, and the
next block in the diagram received None as its input. It now raises
RuntimeError, which bdsim reports with the block, the time and the input. The
estpose :return: text also now says it can be None.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit 7eb53fb into main Nov 23, 2026
32 checks passed
@petercorke
petercorke deleted the bug/estpose-failure branch November 23, 2026 10:31
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant