Numerical vs Neural Network based Kinematics Solver
Investigating numerical and deep neural network-based inverse kinematics solvers for a 7-DOF redundant manipulator.
Overview
Finding inverse kinematics (IK) solutions for redundant manipulators is a fundamental challenge in robotics. For a 7-degree-of-freedom (7-DOF) manipulator like the KUKA LBR iiwa, closed-form analytical solutions do not generally exist due to kinematic redundancy and non-linear geometric constraints.
Traditional iterative numerical methods (such as Jacobian-based solvers) are widely used across the industry. However, they can require substantial computational power per step, suffer from kinematic singularities, or exhibit slow convergence in real-time control loops. Artificial Neural Networks (ANNs) offer an alternative data-driven approach that can predict joint configurations with constant-time inference and GPU parallelization.
Completed as part of a graduate research project for course II2202 at KTH Royal Institute of Technology, this computational study benchmarks popular iterative numerical solvers (Jacobian Transpose, Pseudo-Inverse, and SVD) against multi-layer perceptron (Dense) and Convolutional Neural Network (CNN) architectures. We evaluated convergence rate, execution time, and trajectory tracking fidelity across linear, square, and circular Cartesian trajectories.
My Contributions
- Kinematic Solvers & Implementation: Formulated and implemented iterative Jacobian-based algorithms (Jacobian Transpose, Moore-Penrose Pseudo-Inverse, and Singular Value Decomposition) in Python.
- Simulation Pipeline: Built the simulation environment integrating ROS Melodic and Gazebo 9 to benchmark the 7-DOF KUKA LBR iiwa on 3D spatial trajectories under error tolerances ranging from $10^{-1}\,\text{m}$ to $10^{-6}\,\text{m}$.
- Dataset Synthesis: Synthesized a 5-million sample forward kinematics dataset mapping end-effector Cartesian poses (6D) to joint angles (7D), applying deduplication and normalization.
- Custom Loss Formulation: Formulated the forward-kinematics-aware custom loss function, evaluating position and orientation errors directly in task space to address the many-to-one ambiguity of redundant manipulators.
- Empirical Benchmarking: Evaluated accuracy, iteration counts, and inference latency between traditional numerical solvers and neural network models.
System
The evaluation framework follows an end-to-end simulation and benchmarking workflow:
Target Trajectory $\to$ IK Solver (Iterative / ANN) $\to$ Joint Angle Commands $\to$ Gazebo Physics Simulation $\to$ Trajectory Tracking Analysis
1. Kinematics Approaches Compared
We compared three primary paradigms to solve inverse kinematics:
2. Network Architectures & Custom Loss
Because inverse kinematics for redundant arms is a many-to-one mapping, training with standard Mean Squared Error (MSE) in joint space often causes conflicting gradients when multiple valid joint configurations reach the same end-effector pose.
To address this, we formulated a custom forward-kinematics loss function that evaluates error directly in task space:
We evaluated both fully connected (Dense) and 1D/2D Convolutional Neural Network (CNN) architectures to learn the non-linear mappings:
Results & Key Findings
We evaluated trajectory tracking across three test profiles (linear, square, and circular) using both numerical methods and trained networks.
Key Takeaways
- Jacobian SVD & Pseudo-Inverse vs. Transpose: Jacobian SVD and Pseudo-Inverse converged identically well in ~2 iterations ($<10\,\text{ms}$) down to high precision ($10^{-6}\,\text{m}$). In contrast, Jacobian Transpose required 80 to 370+ iterations, degrading rapidly as the error tolerance tightened.
- Custom Loss vs. Standard MSE: Networks trained with the task-space custom loss function converged faster and yielded significantly lower tracking error than models trained with standard joint-space MSE.
- CNN vs. Dense Generalization: While the dense network achieved lower loss on the training set, the CNN architecture generalized noticeably better on unseen trajectories due to reduced overfitting.
- Execution Time vs. Precision: The trained neural network computed the entire circular trajectory in $\approx 15\,\text{ms}$ on GPU. While it fell short of the sub-millimeter precision of iterative solvers, its rapid execution makes it well-suited for fast initial approximations or real-time reactive seeding.
Technical Highlights
- Manipulator: 7-DOF KUKA LBR iiwa robotic arm
- Simulation: ROS Melodic 路 Gazebo 9.0 路 Ubuntu 18.04
- Numerical Solvers: Jacobian Transpose, Moore-Penrose Pseudo-Inverse ($J^\dagger = J^T(JJ^T)^{-1}$), and SVD
- Learning Stack: TensorFlow 1.15 路 TensorFlow Graphics 路 Docker GPU environment
- Architectures: Multi-Layer Perceptron (Dense) and Convolutional Neural Network (CNN)
- Dataset: 5 million forward kinematics mappings (6D pose $\leftrightarrow$ 7D joint space) with deduplication
- Loss Formulation: Forward-kinematics task-space loss penalizing Euclidean position and rotational error
- Benchmarked Trajectories: 3D Linear, Square, and Circular paths
- Key Metrics: Constant ~2 iterations for Jacobian Pseudo-Inverse; ~15 ms full-trajectory GPU inference for CNN
Team
Sumit Patidar 路 Utkarsh Kunwar
Technical Report
For the complete mathematical formulations, hyperparameter tables, loss convergence plots, and detailed multi-trajectory benchmarks, please refer to our full technical report:
- Download Project Report (PDF)
- Title: Popular Traditional and Neural Network-Based Methods for Solving Inverse Kinematics of Complex Manipulators: A Computational Study
- Authors: Sumit Patidar & Utkarsh Kunwar
- Institution: KTH Royal Institute of Technology, Stockholm, Sweden (Course II2202)