Heuristic Methods for IK

Aaron Su

CSCE 450

Introduction

The traditional method of IK optimization requires optimizing n individual link-angles (𝛉1, ..., 𝛉n), which involves optimizing a high-dimensional parameter space, leading to high computational complexity and potentially long optimization times.

The Circular Alignment Algorithm (CAA) streamlines the optimization process for an n-link, equal-length articulated arm by focusing on a single parameter -- the subtended angle 𝛃 -- when aligning the arm along a circular arc. This approach is more efficient than optimizing for the individual n link-angles (𝛉1, ..., 𝛉n) because it significantly reduces the dimensionality of the optimization problem. By representing the arm's configuration using a single parameter, the algorithm simplifies the search space, making it easier and faster to find the optimal alignment.

Further, the Cyclic Coordinate Descent (CCD) algorithm employs a heuristic approach to expedite the inverse kinematic process. CCD focuses on updating one joint angle at a time, iteratively adjusting each angle to improve alignment with the desired end-effector position. By iteratively addressing each joint in a cyclic manner, CCD effectively narrows down the optimization space, reducing the overall dimensionality of the problem. This targeted and sequential adjustment of joint angles contributes to a more rapid convergence towards a solution.

The problem of Inverse Kinematics (IK) on an n-link articulated arm is highly under constrained with many possible solutions. While analytical solutions exist and are achievable for few-link arms, as n increases, analytical solutions soon become unscalable. Thus, many numerical solutions have been widely used in the computer graphics and robotics industry.

In this project, I explore the characteristics of Circular Alignment Algorithm (CAA) and Cyclical Coordinate Descent (CCD) on an N-link, equal-length, articulated arm. All methods are implemented from scratch and evaluated across a standard set of movement challenges in a 2d simulation.

Implementation

The baseline IK and CAA were both optimized using BFGS with max iterations 150, tolerance 1e-6, max line-search iterations 20, and gamma 0.5.

While the baseline IK objective function aims to minimize the distance from the target (with theta regularization), the CAA objective function minimizes the difference between local and global alignment parameterized by an angle 𝛃.

CCD, which does not rely on optimization, uses a threshold distance of 0.1. While traditional CCD adjusts from link n to link 1 for each iteration, I found that minimizing the number of links involved in the optimization problem reduced computational costs. More specifically, I used the distance from the target to each link to find the minimum last k links needed to reach the target, assuming all previous links remain in the same position. This is denoted by CCD* in charts and diagrams.

All IK methods were evaluated on a suite of 4 simulations using 4-links and 10-links. Simulation 1 follows a horizontal line. Simulation 2 follows a box centered around the origin. Simulation 3 is a circle centered around the origin, and Simulation 4 is a figure-8 (See Simulations).

Findings

To discuss findings, we should first discuss measures of proximity and iterations. While one could argue that the proximity to target is mostly dependent on the tolerance set in the optimizer, I attempted to balance iterations with proximity for each method and found that reducing tolerance did not greatly decrease the number of iterations for convergence.

Further, each iteration requires different amounts of computation. For example, each iteration for Baseline IK requires much more computation than for CAA due to the number of parameters optimized. On the other hand each iteration of CCD contains n angle adjustments, and each iteration of CCD* contains between 2 and n* angle adjustments. Overall, the iteration count should be used as a proxy for “computational efficiency”, and not as the end goal.

As expected, the Baseline IK was closest to the target for all simulations.

Furthermore, the fastest converging method varied between CCD*, CCD, and CAA. This depended on the simulation and number of links. When evaluating proximity and iteration count, CCD* was the best, with consistently low distance-to-target and low iteration counts.

Proximity and Iteration Counts

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 1 WITH 4 LINKS

+----------+-----------------------+--------------------+

|          |       distance        |        itr         |

+----------+-----------------------+--------------------+

| Baseline | 0.0007221895591766723 |  9.30017152658662  |

|   CAA    |  0.7168297262103506   | 99.75459098497495  |

|   CCD    |  0.06689502744227353  | 2.9875666074600353 |

|   CCD*   |  0.0603274156936937   | 1.8342342342342342 |

+----------+-----------------------+--------------------+

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 2 WITH 4 LINKS

+----------+-----------------------+--------------------+

|          |       distance        |        itr         |

+----------+-----------------------+--------------------+

| Baseline | 0.0007323350932203391 | 10.76271186440678  |

|   CAA    |  0.7174006766666666   | 98.62166666666667  |

|   CCD    |  0.0673254369612069   | 12.193965517241379 |

|   CCD*   | 0.060436397334525944  | 8.452593917710196  |

+----------+-----------------------+--------------------+

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 3 WITH 4 LINKS

+----------+-----------------------+--------------------+

|          |       distance        |        itr         |

+----------+-----------------------+--------------------+

| Baseline | 0.0007315355922818792 | 9.172818791946309  |

|   CAA    |  0.7169039717138103   | 106.00166389351081 |

|   CCD    |  0.06759458958724203  | 6.063789868667917  |

|   CCD*   |  0.06061857231707317  | 6.385017421602788  |

+----------+-----------------------+--------------------+

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 4 WITH 4 LINKS

+----------+-----------------------+--------------------+

|          |       distance        |        itr         |

+----------+-----------------------+--------------------+

| Baseline | 0.0007224529713193117 | 12.294455066921605 |

|   CAA    |  0.7168297262103506   | 100.9398998330551  |

|   CCD    |  0.06715384666064982  | 3.5848375451263537 |

|   CCD*   |  0.06092288813242785  | 3.609507640067912  |

+----------+-----------------------+--------------------+

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 1 WITH 10 LINKS

+----------+-----------------------+-------------------+

|          |       distance        |        itr        |

+----------+-----------------------+-------------------+

| Baseline | 0.0018410321388888885 | 65.69444444444444 |

|   CAA    |  1.7807033670033667   | 6.590909090909091 |

|   CCD    |  0.6549749486666667   | 52.91111111111111 |

|   CCD*   |  0.06526532975362319  | 16.96014492753623 |

+----------+-----------------------+-------------------+

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 2 WITH 10 LINKS

+----------+-----------------------+--------------------+

|          |       distance        |        itr         |

+----------+-----------------------+--------------------+

| Baseline | 0.0032258142999999997 |      138.425       |

|   CAA    |  1.7775833722871452   | 6.808013355592655  |

|   CCD    |  0.7145361827450981   | 48.35294117647059  |

|   CCD*   |  0.06677565222666666  | 30.964444444444446 |

+----------+-----------------------+--------------------+

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 3 WITH 10 LINKS

+----------+---------------------+--------------------+

|          |      distance       |        itr         |

+----------+---------------------+--------------------+

| Baseline |  0.002056303515625  |     77.828125      |

|   CAA    | 1.7833150748752078  | 6.998336106489185  |

|   CCD    | 0.6360476505172413  |        39.5        |

|   CCD*   | 0.06634909976886792 | 33.448113207547166 |

+----------+---------------------+--------------------+

AVERAGE DISTANCE FROM TARGET, ITERATIONS FOR SIMULATION 4 WITH 10 LINKS

+----------+-----------------------+--------------------+

|          |       distance        |        itr         |

+----------+-----------------------+--------------------+

| Baseline | 0.0034782764864864863 | 143.13513513513513 |

|   CAA    |   2.362318175843695   | 46.87744227353463  |

|   CCD    |  0.41325322584269664  | 16.426966292134832 |

|   CCD*   |  0.05690456732558139  | 16.565891472868216 |

+----------+-----------------------+--------------------+

CCD* Denotes CCD which optimizes the last k links required to reach the target.

Relative Iteration Counts

Simulations

Simulation Plots

Resources / Works Referenced

Andreas Aristidou, Joan Lasenby, FABRIK: A fast, iterative solver for the Inverse Kinematics problem, Graphical Models, Volume 73, Issue 5, 2011, Pages 243-260, ISSN 1524-0703, https://doi.org/10.1016/j.gmod.2011.05.003.

Aristidou, A., Lasenby, J., Chrysanthou, Y. and Shamir, A. (2018), Inverse Kinematics Techniques in Computer Graphics: A Survey. Computer Graphics Forum, 37: 35-58. https://doi.org/10.1111/cgf.13310

Canutescu, A.A. and Dunbrack, R.L., Jr. (2003), Cyclic coordinate descent: A robotics algorithm for protein loop closure. Protein Science, 12: 963-972. https://doi.org/10.1110/ps.0242703

Buss, S. R. (2004). Introduction to inverse kinematics with jacobian transpose, pseudoinverse and damped least squares methods. IEEE Journal of Robotics and Automation, 17(1-19), 16.