Step 2
Differentiating forward kinematics
Differentiate the FK formula by hand to get an exact Jacobian that needs no FK calls at all.
Builds on Chaining transforms: forward kinematics, from the free Foundations.
Exact derivatives
Finite differences need 8 FK calls per Jacobian and are only approximate. You know the FK formula, though, so you can differentiate it by hand. The result is exact and much cheaper.
Recall the FK from Pick & Place, with link tilts , and :
The base column
Only and depend on , and doesn't. Turning the base swings the gripper sideways, faster the further out it is:
The pitch columns
appears in all three tilts, in and , and only in . By the chain rule:
For the base rotation just carries these along:
The row is yours. Differentiate the same way, remembering that .
Your task
Implement jacobian(q) analytically, without calling arm.fk. The starter includes a working jacobian_fd from Step 1. It prints the largest difference between the two on a few poses, and how long each one takes.
The grader checks every entry of your jacobian to within on 20 random configurations. arm.fk is switched off while it does, so a jacobian that calls it fails.