Skip to content

Add a differentiable FK layer and pose-reaching demo - #901

Merged
yuecideng merged 3 commits into
mainfrom
codex/differentiable-fk-layer
Oct 29, 2026
Merged

yuecideng merged 3 commits into
mainfrom
codex/differentiable-fk-layer

Conversation

@yuecideng

@yuecideng yuecideng commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add DifferentiableFKLayer as the forward-kinematics counterpart to DifferentiableIKLayer. Its forward call computes TCP poses without constructing an unused geometric Jacobian; evaluate() returns poses and Jacobians from one FK pass.

Add a Franka pose-reaching example that trains a joint predictor through fixed FK and TCP pose supervision with the shared SL trainer, plus a browser comparison of initial and frozen trained predictions. The combined FK/IK guide lives under Learning Infrastructure.

Use DifferentiableFKLayer as the public FK API. Remove the old KinematicsLayer alias/module and the old IK documentation redirect. Existing IK state-dict keys remain unchanged. The existing kinematic benchmark only migrates its FK import and constructor; this PR adds no benchmark mode or reporting changes.

Fix the two CI failures in the RigidFormer showcase: verify prepared geometry before importing the optional evaluator dependencies, and explicitly configure the engine demo's visualization backend.

Dependencies: no new core dependencies. Optional plotting/mesh packages are listed in the example requirements.

Type of change

  • New feature
  • Bug fix
  • Breaking change: replace imports of KinematicsLayer with DifferentiableFKLayer.

Validation

  • Core numerical/layer/import and example-package tests: 56 passed, with five CUDA cases skipped in the CPU run. Dedicated serial CUDA run: 5 passed.
  • CI regressions: 3 passed, including geometry validation with imports of roma deliberately blocked and the visualization-configuration check.
  • Context schema/routing tests: 42 passed. API-documentation checker tests: 11 passed. Public API documentation coverage: 3287/3287.
  • black . with 26.10.1, Black check, Python compilation of the changed example/benchmark entry points, and git diff --check passed.
  • Sphinx dummy build passed. Existing unrelated optional-import/cross-reference warnings remain; none refer to the changed FK/IK guide or layer API pages.
  • Default CPU reaching experiment: seed 17, 1,000 updates, validation-selected checkpoint and 128 independent local test targets. Mean position error 52.791 → 4.749 mm and mean rotation error 8.231 → 1.527 degrees. This demonstrates local interpolation.

Coverage review: reuse the existing FK/IK numerical, gradient, checkpoint/device and import tests and the existing showcase/visualization regressions. Remove compatibility-alias assertions with the deleted alias. No additional example-coupled tests were needed.

Context review: update learning-layer ownership, imports and benchmark guidance. Adjacent solver, framework, neural-dynamics and RL ownership remains accurate; the showcase fixes restore existing validation/configuration contracts.

Checklist

  • I have run black ..
  • I reviewed affected documentation and agent context and updated it where needed.
  • Public API changes are reflected in the API docs.
  • I verified behavioral coverage and reviewed test necessity.
  • Dependencies are documented where applicable.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue remains.

Summary

Adds DifferentiableFKLayer, a pose-only FK path, and a pose-reaching training example with a browser comparison.

  • Robot networks can get TCP poses without building a Jacobian.
  • A Franka predictor learns local reaching from TCP pose targets.
  • The RigidFormer showcase checks geometry before loading its evaluator.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Current joints and target pose] --> B[Joint predictor]
  B --> C[Predicted joints]
  C --> D[DifferentiableFKLayer]
  D --> E[TCP pose loss]
  E -. gradients .-> B
Loading

Reviews (3) · Last reviewed commit: "Fix optional dependencies in RigidFormer..." · Reviewed by Greptile

@yuecideng yuecideng added feature New user-facing capabilities. kinematics FK, IK, Jacobians, reachability and kinematic solvers; not physics solvers. compute Shared numerical algorithms and kernels independent of simulation objects. sl Supervised learning updates, training, recovery and behavior cloning workflows. visualization Browser viewers, markers, trajectory previews and interactive debugging displays. benchmark Benchmark protocols, suites, metrics, evaluation tools and technical reports. docs Documentation, API references and example explanations. labels Oct 28, 2026
@yuecideng yuecideng added breaking User-visible incompatible changes requiring migration. and removed benchmark Benchmark protocols, suites, metrics, evaluation tools and technical reports. labels Oct 29, 2026
Comment thread embodichain/learning/layers/__init__.py Resolved
@greptile-apps

greptile-apps Bot commented Oct 29, 2026

Copy link
Copy Markdown

Comments Outside Diff

These findings could not be posted inline.

  • P2 Old guide links break docs/source/overview/learning/differentiable_ik.md:9 ▶

    Deleting differentiable_ik.md removes the page at the old guide URL. The Sphinx redirects cover robot pages only, so the generated site no longer provides the promised compatibility entry. Readers following old links lose the page that points them to the new guide. Keep the small moved-guide page or add a redirect to differentiable_kinematics.

Skip the GPU recovery case when roma or einops is unavailable, consistent with the neighboring optional RigidFormer tests. With dependencies installed, the existing exact EMA/recovery assertions still execute unchanged.

Validation: 25 RigidFormer CPU/GPU tests and 59 FK/IK/import tests passed. Missing roma and missing einops were each verified to skip the case. Black 26.10.1, API docs coverage (3287/3287), and diff checks passed.

Context review: no update needed; this test-only correction restores optional-dependency handling without changing documented model or training contracts. Existing behavioral coverage is reused; no redundant tests added.
@yuecideng
yuecideng merged commit 981076e into main Oct 29, 2026
2 of 4 checks passed
@yuecideng
yuecideng deleted the codex/differentiable-fk-layer branch October 29, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking User-visible incompatible changes requiring migration. compute Shared numerical algorithms and kernels independent of simulation objects. docs Documentation, API references and example explanations. feature New user-facing capabilities. kinematics FK, IK, Jacobians, reachability and kinematic solvers; not physics solvers. sl Supervised learning updates, training, recovery and behavior cloning workflows. visualization Browser viewers, markers, trajectory previews and interactive debugging displays.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant