MIT 6.4210 — Lecture 5
Inverse Kinematics via Optimization
§ Inversion as Optimization: Constraints
Recall from Lecture 4 that our approach to solving “inverse” problems is to take the (damped, possibly) pseudo-inverse, because it nicely satisfies the following properties.
Theorem. (Pseudo-Inverse Approximation) For any matrix and vector (with appropriate dimensions), the vector is the vector with minimum magnitude across all vectors that minimize . In particular,
If the column space of does not contain , then is such that is minimized.
If the column space of contains (that is, can be zero), then is the solution to minimizing .
We can go even further, though, by phrasing this as an optimization problem.
Quadratic Program. Find the vector with minimum magnitude that minimizes .
Viewing this as a quadratic program (see 6.1220 Notes for context), we can also consider adding constraints to this problem. For example, we might want to specify that , and to prevent exploding velocities.
Notice that this is not just as simple as taking the output of the pseudo-inverse and clipping it to a constrained region!

As the image above indicates, the solution achieved by clipping (shown in red) can oftentimes be less optimal than the solution achieved by optimizing the constrained quadratic program (shown in blue).
§ Inversion as Optimization: Joint Centering
Now suppose that our system is highly redundant—there are infinitely many that achieve . Can we get something out of the fact that our null space is nontrivial?
Well, the pseudo-inverse exploits this by specifically aiming for the solution with smallest magnitude.
But maybe, more smartly, we can specify a preferred position . Then if our current state is , we might imagine a spring of stiffness that induces a desired velocity of .
Since the null space is nontrivial, we can project this desired velocity into the null space. This lets us freely add the projection into without affecting the fact that . See the (warning: AI-generated) widget below.
This is fairly widely used, especially for robots that are highly redundant.
§ Trajectory Optimization
A common constraint that one might use is that the robot must avoid collisions. In the very simple example of a 2D simplified two-rod Kuka IIWA, here's how that constraint looks in the configuration space .

Notably, this constraint is non-convex, so it cannot simply be solved by traditional quadratic program solvers. (For example, gradient descent can get stuck in a local minimum.)
One might define a trajectory optimization problem like so:
Trajectory Optimization. Minimize such that , , and the path does not collide with anything.
An optimizer might then start with an initial guess and gradually improve the guess, in hopes that the local minimum that it converges towards does actually satisfy the nonconvex constraints.

Given a set of points , we can define a path via a B-spline, for example.

One nice property of B-splines is that the curve always stays within the convex hull of the control points. But one bad property of B-splines is that even if the control points satisfy the constraints, the path itself might not.

Next lecture, we'll discuss alternative (non-optimization-based) approaches to motion planning.