Step 1
Velocity kinematics
Measure how the gripper moves when each joint moves alone, and build the Jacobian one column at a time.
From positions to velocities
In Pick & Place you used forward kinematics, , to find the gripper from the joint angles. Controllers often need the next question: if the joints turn at speeds , how fast does the gripper move?
Differentiate FK with the chain rule and a matrix appears, the Jacobian:
The gripper moves in 3-D and the arm has 4 joints, so is . Column is the gripper velocity you get when joint turns at 1 rad/s and the others stay still. It depends on : the same joint speed moves the gripper differently in different poses.
Measuring a column
You don't need calculus to get . Nudge one joint by a small both ways and see how the gripper moves:
Here is 1 in slot and 0 elsewhere. This central difference has an error of order , so a smaller is better, up to a point. Make too small and you subtract two almost equal numbers, and floating-point round-off takes over. rad balances the two.
arm.fk(q) is unlocked in this lesson. It returns the grasp point for any q without moving the arm.
Your task
Implement jacobian_fd(q) so it returns a np.array.
The starter program sweeps every joint with a sine wave. In the Plots tab it compares two gripper speeds: one measured from arm.ee_position(), one predicted as using the joint velocities arm.qd. When your Jacobian is right, the curves lie on top of each other.
The grader compares your function with the exact Jacobian on 20 random configurations.