Skip to content

fix: notebook ARMPLOT asks the block to move the robot plot - #254

Merged
petercorke merged 2 commits into
mainfrom
fix/notebook-armplot-pose
Nov 15, 2026
Merged

petercorke merged 2 commits into
mainfrom
fix/notebook-armplot-pose

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

In a notebook the robot in an ARMPLOT block stays at its starting pose. notebook_patches.py replaces ArmPlot.step() from roboticstoolbox (RTB) with its own copy, and sets robot.q itself, which since RTB #873 no longer moves the arm: the plot is pinned to the pose it was made with. Found in the computed-torque example of the ICRA 2026 notebook, where the scope updated and the robot did not.

The patch now calls the block's _set_pose(q) (petercorke/robotics-toolbox-python#939), which knows how the plots hold a pose, and keeps the old behaviour for an older RTB that does not have it. patch_version is 8.

This only reduces the coupling. Making RTB's graphics blocks work in a notebook on their own, so that this patch can be deleted, is #250.

Checked end to end in a notebook kernel with this change and the RTB fixes (#938 and #939): the arm geometry is distinct in all 304 frames; before, identical in all of them. Test: test_armplot_patch_notebook_moves_the_pose_through_the_block. The notebook only shows the fix once RTB #939 is merged and released.

Checklist

  • A small fix needs no issue
  • This PR covers a single concern
  • Tests were added or updated, and the full suite passes (CI runs it)
  • The code works on every Python version in the pyproject.toml classifiers (CI tests them all)
  • This change was AI-assisted (tool: Claude Code) and I have read and run the code myself
  • This change alters public behaviour: the arm moves in a notebook, with a roboticstoolbox that has the fix

🤖 Generated with Claude Code

The notebook patch replaces ArmPlot.step and sets robot.q itself, which since
roboticstoolbox #873 no longer moves the arm: its plot is pinned to the pose it was
made with, so the robot stayed at its starting pose in every notebook. Call the
block's _set_pose(), which knows how its plots hold a pose, and keep the old
behaviour for an older roboticstoolbox that does not have it.

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

codacy-production Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 2 duplication

Metric Results
Complexity 0
Duplication 2

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b9dccca) 6124 5134 83.83%
Head commit (f7aac3d) 6125 (+1) 5135 (+1) 83.84% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#254) 6 6 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

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.

@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.83%. Comparing base (b9dccca) to head (f7aac3d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #254   +/-   ##
=======================================
  Coverage   83.83%   83.83%           
=======================================
  Files          26       26           
  Lines        6124     6125    +1     
=======================================
+ Hits         5134     5135    +1     
  Misses        990      990           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke merged commit ed00426 into main Nov 15, 2026
44 of 46 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 15, 2026
@petercorke
petercorke deleted the fix/notebook-armplot-pose branch November 15, 2026 06:52
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