Skip to content

fix(robot): update link scene-node transforms without the compiled extension - #947

Merged
petercorke merged 1 commit into
mainfrom
fix/robot-link-t-python-fallback
Nov 17, 2026
Merged

petercorke merged 1 commit into
mainfrom
fix/robot-link-t-python-fallback

Conversation

@petercorke

Copy link
Copy Markdown
Owner

What

fknm.Robot_link_T updates the scene-node transform of every link of a robot. Without the compiled extension it did nothing, with the comment "visualisation only". But those transforms also place the collision geometry, so on the pure-Python wheel (JupyterLite, Pyodide) iscollided and closest_point ran against geometry frozen at the initial pose. For example, at qr the Panda's link 3 stayed at z = -0.145 instead of (-0.093, 0, 0.635).

The Python path now evaluates each link's ETS into the scene node's own array, as the C++ does. It handles a link with no elementary transforms (such as a URDF base link) and a gripper with no joints. The two callers pass each link's ETS data, the same way ETS_fkine already does.

Found by the new pure-Python coverage leg in #946, which failed test_dist (ELink and ERobot), test_collided2 and test_fkine_geometry_matches_scene_graph.

Refs #898.

Behaviour

This changes numerical results on the pure-Python path only: collision and distance queries are now correct there. The compiled path is untouched.

What I ran, and what I could not

  • In a clean venv built from the pure wheel (numpy 2.5.5, spatialgeometry 1.4.2, SMTB 1.1.19, no extensions), the four tests above now pass, and the whole suite (apart from test_blocks.py) went from 19 failures to 15. The 15 are compiled-only tests and one chaotic IK test, which are separate and not part of this PR.
  • New TestRobotLinkTReference in tests/test_fknm_fallback.py chains the scene-node transforms up the tree and compares them with fkine at two configurations. It fails 18 times on main's code and passes with this change.
  • Checked every link of Panda, UR5, Puma560, Frankie, YuMi and Valkyrie against ets.eval: no mismatches.
  • Could not run the compiled path locally (no compiled build here), so CI's compiled legs are the check for it.
  • Not fixed here: ETS([]).eval() and fkine(end=<base link>) raise IndexError on the pure path. That is a separate bug, so the new test skips links with no elementary transforms.

AI assistance

Written with Claude Code (Claude Sonnet 5.5), reviewed by the maintainer.

🤖 Generated with Claude Code

…tension

Robot_link_T was a no-op when the C extension was absent, commented
'visualisation only'. The scene-node transforms also place the collision
geometry, so on the pure-Python wheel (JupyterLite, Pyodide) iscollided and
closest_point ran against geometry frozen at the initial pose: Panda link 3
stayed at z=-0.145 instead of (-0.093, 0, 0.635) at qr.

The fallback now evaluates each link's ETS in Python into the scene node's
own array, as the C++ does, and handles a link with no elementary transforms
and a gripper with no joints. Callers pass each link's ETS data, as
ETS_fkine already does.

Fixes ELink/ERobot test_dist, test_collided2 and
test_fkine_geometry_matches_scene_graph on the pure path, and adds a test
that chains the scene-node transforms and compares them with fkine.

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

Metric Results
Complexity 4
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 b107ad2 into main Nov 17, 2026
22 of 23 checks passed
@petercorke
petercorke deleted the fix/robot-link-t-python-fallback branch November 17, 2026 06:35
@github-actions github-actions Bot mentioned this pull request Nov 16, 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