← PROJECTS/AUTONOMOUS ROBOT DOG·2026 · 05 · 08feat

Basic IK solver for leg-trajectory planning — knees finally bend the right way.

Inverse Kinematics v1

After weeks of the legs doing geometrically incorrect things, the IK solver is working.

The approach: closed-form two-link IK for each leg. Given a target foot position in the body frame, compute the hip and knee angles analytically. No numerical solver needed for the basic case, which keeps latency low enough for real-time use.

What "knees bending the right way" means

A quadruped can have elbow-forward or elbow-backward knee configurations. Getting this wrong produces an uncanny valley effect where the robot looks physically plausible but moves wrong. The fix was correctly handling the two valid IK solutions and selecting the one consistent with the leg's configuration.

Next steps

The current solver assumes a flat body frame and doesn't account for terrain. Connecting it to the IMU data for body orientation compensation is the next piece.