Same planar 2-link manipulator (shoulder-elbow) as the 3D version, seen here edge-on: the main view is the arm's own vertical reach/drop plane, and the small top-left inset is a top-down map showing the turret's bearing to the target. Given the horizontal reach r and vertical drop v from the shoulder pivot to the target, the elbow angle follows from the law of cosines:
d = √(r² + v²)
cosθ₂ = (d² − L₁² − L₂²) / (2·L₁·L₂)
θ₂ = acos(cosθ₂) (elbow bend)
θ₁ = atan2(v, r) − atan2(L₂sinθ₂, L₁+L₂cosθ₂) (shoulder pitch)
A third, wrist joint is servoed to keep the claw pointing straight down regardless of shoulder/elbow pose. The turret yaw is atan2 of the target's lateral offset, so the arm plane is re-oriented to face the device before the 2-link solve runs — reach depends only on distance, never on bearing.
Grip force loop: once the claw contacts the object, a proportional feedback loop closes the jaws while grip force ramps toward the operator's setpoint (F(t+dt) = F(t) + k·(F_set − F(t))·dt) instead of slamming shut — too much force risks triggering a pressure-sensitive fuze, too little drops it.
Fix versus the 3D version: the 3D scene draws the second link at world angle θ₁+θ₂−π, which does not match the law-of-cosines convention its own inverse-kinematics solver assumes (θ₁+θ₂) — the rendered claw there lands up to ~1.6 m from the commanded target even though the displayed angles are numerically correct. Verified by forward-kinematics round-trip in a standalone script. This 2D sibling draws the second link at θ₁+θ₂, so the claw visibly reaches the target it was commanded to.