Repository navigation
fix: notebook ARMPLOT asks the block to move the robot plot - #254
Conversation
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>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 2 |
🟢 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 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Summary
In a notebook the robot in an
ARMPLOTblock stays at its starting pose.notebook_patches.pyreplacesArmPlot.step()from roboticstoolbox (RTB) with its own copy, and setsrobot.qitself, which since RTB #873 no longer moves the arm: the plot is pinned to the pose it was made with. Found in thecomputed-torqueexample 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_versionis 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
pyproject.tomlclassifiers (CI tests them all)🤖 Generated with Claude Code