Skip to content

fix: EstPose_p passes its frame argument to estpose - #210

Merged
petercorke merged 1 commit into
mainfrom
bug/estpose-p-frame
Nov 22, 2026
Merged

petercorke merged 1 commit into
mainfrom
bug/estpose-p-frame

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

The EstPose_p block accepted a frame argument ("world" or "camera") and documented it, but never stored or used it, so the pose was always given with respect to the world frame. The block now stores frame, rejects any other value with ValueError when it is constructed, and passes it to CentralCamera.estpose, which already supports it. The docstring gains a .. versionchanged:: 2.5.0 note, because a block built with frame="camera" now returns a different pose.

Adds tests/test_blocks.py, the first bdsim block tests under tests/. It uses a camera that is not at the world origin, so the two frames give different answers, and checks the default ("world"), "camera", and a bad value. The module is skipped when bdsim is not installed. Moving the other block tests out of the package and installing bdsim in CI is a separate change.

Not changed: estpose returns None if the solver fails, and the block then outputs None.

Testing

pytest tests/test_blocks.py: 4 passed. Three of the four fail on main without the fix. mypy reports no issues. Not run: CI does not install bdsim yet, so these tests are skipped there until the follow-up change.

This change was written with AI assistance (Claude Code) and the diff has been read by the maintainer.

🤖 Generated with Claude Code

The block accepted frame ("world" or "camera") but never stored or used
it, so the pose was always given in the world frame. It now stores the
argument, rejects other values at construction, and passes it on. Adds
tests in tests/test_blocks.py, skipped when bdsim is not installed.

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 5 complexity · 0 duplication

Metric Results
Complexity 5
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 3594254 into main Nov 22, 2026
34 checks passed
@petercorke
petercorke deleted the bug/estpose-p-frame branch November 22, 2026 02:08
@github-actions github-actions Bot mentioned this pull request Nov 22, 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