{'fraction_non_alphanumeric': 0.032771150418209244, 'fraction_numerical': 0.012889071712601124, 'mean_word_length': 4.711824588880188, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Inverse Kinematics as Low-Rank Euclidean Distance Matrix Completion

The majority of inverse kinematics (IK) algorithms search for solutions in a configuration space defined by joint angles. However, the kinematics of many robots can also be described in terms of distances between rigidly-attached points, which collectively form a Euclidean distance matrix. This alternative geometric description of the kinematics reveals an elegant equivalence between IK and the problem of low-rank matrix completion. We use this connection to implement a novel Riemannian optimization-based solution to IK for various articulated robots with symmetric joint angle constraints.


I. INTRODUCTION
Inverse kinematics (IK) algorithms play an essential role in robot motion and task planning. For robots with redundant degrees of freedom (DOFs), such as manipulators, there exist infinitely many IK solutions and numerical methods are needed to find feasible configurations. The vast majority of IK algorithms use a joint angle parameterization, with decision variables Θ ∈ R n comprising the configuration space C. These variables are related to the workspace by where F is the forward kinematics mapping and T is the task space containing the target poses w of the end-effector. For complex robots with many degrees of freedom, F is a highly nonlinear function composed of trigonometric products and sums. Thus, formulating IK as an optimization problem over decision variable Θ incorporates either a nonconvex cost function or nonconvex constraints. These nonconvex formulations introduce local minima that complicate the search for a global minimum Θ that exactly satisfies Equation (1).
Recently, an alternative strategy for describing IK has emerged based on constraining the distances between points fixed to the links of articulated robots [1]- [3]. Most notably, Porta et al. have cast inverse kinematics as a special case of the general Euclidean distance matrix (EDM) completion problem for several articulated robots [4], [5]. In this work, we apply the Riemannian optimization-based approach to low-rank EDM completion introduced in [6] to the IK problem with symmetric joint limit constraints. Figure 1 illustrates our approach for a simple 3-DOF manipulator.  The IK problem consists of finding the joint angles Θ that bring the end-effector of a 3-DOF robotic manipulator to its goal position (p 6 in the diagram). Our method uses distance information common to all possible IK solutions by defining an incomplete graph whose edges are weighted by known distances. Then, we use low-rank matrix completion to recover the weights corresponding to the unknown edges, solving the IK problem. matrix P = [p 0 , p 1 , . . . , p N −1 ] T ∈ R N ×K . All inter-point distances d u,v between p u and p v are determined via the Euclidean norm: The inner product X := PP T is a symmetric positive semidefinite Gram matrix that can be used to compute the full set of squared inter-point distances d 2 u,v , where Sym(X) = 1 2 (X + X T ) and diag (X) is the vector formed by the main diagonal of X. The resulting matrix D is known as a Euclidean distance matrix or EDM [7]. Given a full EDM, we can use eigenvalue decomposition to extract the underlying point set P up to a rigid transformation.
In our point-based kinematics model, a subset of interpoint distances is defined by the manipulator's rigid link geometry and desired end-effector pose. Joint angle limits define lower bounds on distances between points that share a neighbouring joint. The problem of finding the remaining unknown entries in the resulting partial EDM is known as the EDM completion problem [7], [8]. We denote the N × N binary matrices that index the locations of all known and lower bounded squared distances of the partial EDMD as Ω and Ψ respectively. The problem of finding the missing EDM where is the element-wise Hadamard product, max is taken element-wise with 0, and M is the Riemannian manifold described in Equation (4). By factoring the Gram matrix as X = PP T and solving for P, we are implicitly constraining the dimensionality of the search space [9], without changing the global minimum [10].
The factorization of the Gram matrix is invariant to orthogonal transformations of the point set P → PQ, where Q ∈ O(K). It follows that the cost function minima are not isolated, which significantly hinders the convergence of second-order optimization methods [11]. Following [6], the local search is constrained to the quotient manifold M ≡ R N ×K * /O(K), which represents the equivalence class The geometry of the Riemannian manifold M isolates minima, and a variety of algorithms can be applied to solve the problem in Equation (3) as an unconstrained Riemannian optimization problem [11].

III. RESULTS AND FUTURE WORK
In Table I, we present the results of a simulated evaluation of our method on IK problems for a variety of manipulators. In every instance we formulate and solve the problem in Equation (3) in Python using the pymanopt 1 package on a laptop computer with an Intel ® Core TM i7-8750H CPU at 2.20 GHz and 16 GB RAM. The IK problems are generated by randomly sampling the configuration space within joint limits, and the problem is initialized using a set of points corresponding to a configuration with joint angles set to 0. Joint limits are random and symmetric about 0, with a minimum value of 0.2 radians. A solution is considered to be correct (successful) if it achieves position and orientation errors lower than 0.01 meters and 0.01 radians, respectively.
We begin with 10 and 100 joint manipulators with unit link lengths, denoted by planar-10, spherical-10, 1 github.com/pymanopt/pymanopt planar-100 and spherical-100 in Table I. In all experiments, our method achieves a 100% success rate with mean computation times well under a second. Surprisingly, this result holds even in the somewhat extreme 100-joint examples, albeit with computation time an order of magnitude greater. Next, we introduce joint limits and repeat the experiment, denoting the results with an asterisk ( * ). Again, in all cases there is a 100% success rate, with the exception of one failure occurring for spherical-100*. The computation times in the joint-limited cases are generally higher due to the introduction of the second cost term in Equation (3) that enforces lower bounds on a subset of distances. Finally, we take the practical example of the UR10 6-DOF manipulator, where our method succeeds in 84.2% and 63.0% of instances (without and with joint limits, respectively). These success rates are comparable to solvers available in the Kinematics and Dynamics Library [12, Table 1].
These results show promise for distance geometric models in kinematics and motion planning, since low-rank matrix completion and the distance geometry problem in general [8] have strong theoretical underpinnings. In our work, we seek to exploit this perspective to develop new methods for solving and analyzing complex inverse kinematics problems. We are currently experimenting with spherical obstacles, which are easily incorporated into our formulation as points with fixed distances from the robot base and one another, and distances to points on the robot that are bounded from below by each obstacle's radius.