Combining Optimization and Analytic Inverse Kinematics

Thomas Cohn

April 18, 2025

A Brief Disclaimer

  • This project was supposed to be further along
  • Today's presentation is mostly proposing an idea
  • Will scatter in some open questions

Optimization IK

Analytic IK

Motivation: Two Kinds of IK

Outline

  1. Background: Perspectives on IK
  2. Proposed Method
  3. Proposed Experiments

Part 1

Background

What do different people mean when they talk about "IK"?

The Mainstream Perspective

IK is the process of finding joint angles for a robot arm to put the hand at a given pose.

 

  • Analytic IK: write down the equations and invert them.
    • Geometric strategies
    • Algebraic strategies
  • Various iterative approaches
    • Jacobian pseudoinverse
    • Jacobian transpose
    • Cyclic coordinate descent
    • FABRIK

https://thewanderingtech.blogspot.com/2009/06/educational-flash-application-on.html

Russ's Perspective

IK is a broad class of optimization problems, broadly asking to find "postures of the robot satisfying certain constraints".

 

(Then use a general solver to optimize.)

Main research directions:

  • Formulating desired behavior as costs/constraints.
  • Finding better formulations (easier to optimize).
  • Generally not looking at improving the solvers.

 

In some sense, subsumes the mainstream perspective

Greatest Hits of Optimization IK

MIT DARPA Robotics Challenge

Dai, Izatt, and Tedrake 2017

Tommy's Perspective

IK is a coordinate system, where the pose of a robot is described by the position of its end effector(s), along with additional values to disambiguate kinematic redundancy.

Can be practically defined in terms of a change of variables, induced by an analytic IK solution. We might write

\[\phi:\operatorname{SE}(3)\times\mathcal{C}\times\mathcal{D}\to\mathbb{R}^n,\]

where \(\mathcal{C}\) are continuous redundancy parameters and \(\mathcal{D}\) are discrete redundancy parameters.

Besides singularities, for fixed \(d\in\mathcal{D}\), \(\phi\) is a smooth injection.

Discrete

Continuous

Types of Kinematic Redunancy

Kinematics of Serial Manipulators, Virgala et. al.

Grow IRIS Regions

Trajectory Optimization

Automatic Differentiation

Limited Applicability

  • Analytic IK solutions are generally hand-designed.
  • Some arms (booooo Kinova Jaco) don't have them yet.
  • Solutions may not exist at all! (See: unsolvability of the quintic)
  • The arm may be poorly calibrated

There are some automatic tools for constructing solutions

  • Option 1: IK-GEO, EAIK
    • Only works for certain classes of robot kinematics
  • Option 2: IKFast, YAIK
    • Need sampling to handle kinematic redundancy
    • Open question: could we use sampled solutions?

Part 2

Proposed Method

Does my intuition on why this should work make sense?

Setup

We have a robot with an analytic IK solution

\[\phi:\operatorname{SE}(3)\times\mathcal{C}\times\mathcal{D}\to\mathbb{R}^n.\]

where \(\mathcal{C}\) are continuous redundancy parameters and \(\mathcal{D}\) are discrete redundancy parameters.

Note that \(\mathcal{C}\) can include additional joints.

  • Mobile robot base pose
  • Arm on a sliding rail
  • Additional kinematic subchains (e.g. humanoid head)

What Does Analytic IK Look Like?

What Does Analytic IK Look Like?

Practicum: Domain Checking

  • Joint limit violations
    • Check that \(\operatorname{IK}(X)\) is valid
  • Non-reachable configurations
    • Check that \(\operatorname{FK}(\operatorname{IK}(X))\approx X\) (up to a tolerance)
  • Inverse trig function domain
    • Clip inputs to the valid domain
    • Open question: what to do about gradients?
  • Singular configurations
    • Ignore for now because they're a measure zero set.
    • Open question: can we do better?

Passively Avoiding Singularities?

Optimization IK (Standard Form)

\[\begin{array}{rl}\min_q & f(q)\\ \operatorname{subject\; to} & {}^WX^G=\operatorname{FK}(q),\\ & g_i(q)\ge0,\;\forall i\in I,\\ & h_j(q)=0,\;\forall j\in J.\end{array}\]

 

  • \(f\) is our objective.
  • \(g_i\) are generic inequality constraints.
  • \(h_j\) are generic equality constraints.

Reformulated IK (Proposed)

\[\begin{array}{rl}\min_{X,\psi} & f(q)\\\operatorname{subject\; to} & T\in\operatorname{SE}(3),\psi\in\mathcal C,\\ & q:=\phi(X,\psi),\\ & \textrm{$q$ satisfies joint limits},\\ & {}^WX^G(q)=X,\\ & g_i(q)\ge0,\;\forall i\in I,\\ & h_j(q)=0,\;\forall j\in J.\end{array}\]

 

  • \(q\) is not a variable, but is substituted
  • "\(\textrm{$q$ satisfies joint limits}\)" is now a nonlinear inequality constraint
  • The feasible set of \({}^WX^G(q)=X\) has positive measure.

Why it Might be Better

  • Intuition: nonlinear equality constraints are inherently hard
    • You lose feasibility at every iteration
    • Constantly projecting back to feasibility is a costly slowdown
    • (This is why manifold optimization is so good.)
  • Change-of-variables allows us to step along the manifold of solutions in closed form
  • Possible problems
    • Anything that used \(q\) is now much more complicated
    • The new inequality constraints are complicated
    • It might be slower computationally

Some Practical Concerns

  • Domain issues for the mappings
    • What if the initial guess is outside the domain?
    • What if an intermediate iterate leaves the domain?
    • (Is clipping inputs alone enough?)
  • Discrete parameters
    • For now, just pick one and keep it constant
    • If varying initial guesses, also vary discrete parameters
  • Representing rotations
    • Want to avoid nonlinear equality constraints
    • (Rotation matrices and quaternions are out)
    • Euler angles vs exponential coordinates

What would it take for me to convince you that this works?

Part 3

Proposed Experiments

Overall Plan

  • Create a slate of many experimental domains
  • Compare the two formulations across many IK solves
    • Success rate (may also try multiple initial guesses)
    • Optimal cost
    • Runtime
  • If problem constraints are amenable, compare to Hongkai's Global IK

Collision-Free IK

\[\begin{array}{rl}\min_q & ||q||^2\\ \operatorname{subject\; to} & {}^WX^G=\operatorname{FK}(q),\\ & \operatorname{SignedDistance}(q)\ge 0.\end{array}\]

 

  • Known to be a challenging problem
  • Maybe easier if the optimizer doesn't have to worry about IK?

Humanoid Stability IK

\[\begin{array}{rl}\min_q & ||q||^2\\ \operatorname{subject\; to} & {}^WX^G_{\operatorname{left\;arm}}=\operatorname{FK}_{\operatorname{left\;arm}}(q),\\ & {}^WX^G_{\operatorname{right\;arm}}=\operatorname{FK}_{\operatorname{right\;arm}}(q),\\ & {}^WX^G_{\operatorname{left\;leg}}=\operatorname{FK}_{\operatorname{left\;leg}}(q),\\ & {}^WX^G_{\operatorname{right\;leg}}=\operatorname{FK}_{\operatorname{right\;leg}}(q),\\ & \pi_{xy}(x_{\operatorname{com}})\in\operatorname{SupportPolytope}(q).\end{array}\]

 

  • We specify the pose of both hands and both feet.
  • The support polytope is estimated as the convex hull of the corners of the feet.
  • Could add gaze constraints.
  • Could work with the spot robot as well.

The Part where Tommy Complains

Hubo IK

Hubo's Kinematics

Oh Great He's Still Complaining

Kinematics and Inverse Kinematics for the Humanoid Robot HUBO2+, O'Flaherty et al.

Solution: Change the URDF

Multiple Possible EE Poses

\[\begin{array}{rl}\min_q & ||q||^2\\ \operatorname{subject\; to} & \operatorname{FK}(q)\in\{{}^WX^G:\textrm{some conditions}\}.\end{array}\]

 

Possible sets include

  • Set of antipodal grasps on an object
    • Unclear how to formulate in an optimization problem
  • Only fixing the position or orientation of the hand

Some Brainstorming Time...

  • Create a generic \(n\)-link arm (where \(n\) can be scaled), and explore how performance changes as \(n\) grows.
  • Solve IK problems for multiple robots jointly grasping an object.
  • Footstep placement for a quadruped on rough terrain.
  • Stewart platform
  • ...

Dai et al. 2019

Porta et al. 2009

Combining Optimization and Analytic Inverse Kinematics

Thomas Cohn

April 18, 2025