Skip to content

v0.10.0

Latest

Choose a tag to compare

@LemonPi LemonPi released this 16 Apr 00:44

Analytical FK Backward

forward_kinematics_tensor now uses an analytical geometric Jacobian for the backward pass by default, computing d(transform)/d(joint_angles) directly from joint axes and the kinematic tree structure instead of replaying forward ops through autograd.

  • ~9x faster backward pass on GPU for large batch sizes
  • Compatible with torch.compile(fullgraph=True) — both forward and backward are fully traced
  • Compatible with torch.vmap
  • Escape hatch: analytical_grad=False for higher-order gradients (create_graph=True) or gradients w.r.t. chain parameters (e.g. link offsets for calibration)
chain = pk.build_serial_chain_from_urdf(open("robot.urdf").read(), "end_link")
th = torch.randn(1000, 7, requires_grad=True)
T_all = chain.forward_kinematics_tensor(th)  # analytical backward by default
loss = T_all.sum()
loss.backward()  # ~9x faster than autograd on GPU

Other changes

  • Add --visualize CLI flag and fix window_recorder fallback on macOS