Skip to content

Include selected link offsets in world-frame Jacobians - #29

Merged
neka-nat merged 1 commit into
neka-nat:masterfrom
Afloat16:fix/jacobian-link-offset-20261010
Oct 17, 2026
Merged

neka-nat merged 1 commit into
neka-nat:masterfrom
Afloat16:fix/jacobian-link-offset-20261010

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Forward kinematics reports the selected link offset followed by the optional tool transform, but both Jacobian recursions started at the tool alone. This gives incorrect linear and angular columns when the link offset is nonidentity.

For example, an MJCF hinge about z with a fixed tip at (1, 0, 0) has tip position (cos(theta), sin(theta), 0). At theta=0 the current linear Jacobian is zero instead of (0, 1, 0).

Initialize the reverse transform with selected_link.offset.matrix() @ tool.matrix() in both Jacobian paths. Intermediate link offsets describe their reported poses rather than child-joint transforms, so only the selected link offset enters this seed. World-expressed angular axes and zero columns for downstream joints are preserved.

Six regression methods cover the real MJCF fixed tip, mixed revolute/prismatic chains, each selected link, world angular velocity, equivalent link/tool composition, and identity-offset controls. Expected poses and screw columns are computed independently with SciPy SO(3), including nonidentity root, joint, link and tool transforms.

Validation on Windows CPython 3.12.13 with NumPy 1.26.4 and SciPy 1.15.3: all 15 existing tests pass; before the fix, five new methods fail assertions and the identity control passes, with no errors or skips; after the fix, all 21 tests pass. The original tests and subtest events are unchanged. The project-declared Flake8 check and new-test lint pass before and after. The full declared Mypy command exits 1 in both versions with the same 16 diagnostics in unchanged MJCF/URDF parsers; complete stdout/stderr match, and neither changed file introduces a type error. Both default isolated sdist-to-wheel builds pass with complete package payload verification. The upstream Linux CI matrix remains for CI.

Seed both reverse Jacobian recursions with the selected link offset followed by the tool transform. Verify the MJCF fixed-tip derivative and independent world screw columns for mixed joints and intermediate links.
@neka-nat
neka-nat merged commit 33ab7f7 into neka-nat:master Oct 17, 2026
3 checks passed
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.

2 participants