# 数值逆运动学

**数值逆运动学**是一类迭代方法，通过反复对正运动学进行线性化并修正关节猜测值，而非求解闭式方程，来找到使末端执行器到达期望位置或位姿的机器人关节构型。凡是不存在解析解的情况——这对任意机械臂而言是普遍情形——都会用到它，它也是MoveIt的KDL与TRAC-IK插件、Drake的微分逆运动学等框架内置求解器的基础。<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup><sup> • </sup><sup>[2](https://moveit.picknik.ai/main/doc/how_to_guides/trac_ik/trac_ik_tutorial.html)</sup><sup> • </sup><sup>[3](https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_differential_inverse_kinematics_system.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 核心迭代 | 牛顿-拉夫逊法：在当前猜测值处计算末端执行器误差e，然后更新θ ← θ + J<sup>#</sup>(θ) e，其中J<sup>#</sup>为雅可比伪逆<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup> |
| 伪逆的作用 | 当J可逆时退化为矩阵逆；在多个解中选取关节变化量最小者，无精确解时使误差最小<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup> |
| 阻尼最小二乘 | 最小化\( \|J\Delta\theta - e\|^2 + \lambda^2\|\Delta\theta\|^2 \)，得到\( \Delta\theta = J^{\top}(JJ^{\top} + \lambda^2 I)^{-1} e \)<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup> |
| DLS的起源 | 由Charles W. Wampler II以及Nakamura与Hanafusa最早应用于逆运动学；亦称Levenberg-Marquardt方法<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup> |
| 奇异行为 | 用奇异值表示时，伪逆将各模态按\( 1/\sigma_i \)缩放，而DLS按\( \sigma_i/(\sigma_i^2 + \lambda^2) \)缩放，后者当\( \sigma_i \to 0 \)时趋于零<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup> |
| 初始猜测 | 决定迭代收敛到哪个解；在运行中的控制器里，上一时间步的关节向量是下一步的良好猜测<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup> |

## 牛顿-拉夫逊表述

问题通过正运动学来陈述。函数f(θ)将关节向量θ映射为描述末端执行器构型的一组最小坐标，逆运动学要求找到一个θ_d满足x_d − f(θ_d) = 0，其中x_d为期望构型。<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup>

牛顿-拉夫逊法用局部线性步长求解这一求根问题。将f在期望构型附近作泰勒展开，取一阶项得x_d − f(θ_i) = J(θ_i) Δθ，其中J为f在当前猜测值θ_i处求值的雅可比矩阵。若J可逆，修正量为Δθ = J<sup>−1</sup>(x_d − f(θ_i))。由于J一般不是方阵，且在某些构型处会变得奇异，修正量改用伪逆J<sup>#</sup>计算，伪逆对非方阵和奇异矩阵均有定义。<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup>

于是算法为：从初始猜测θ₀出发，计算末端执行器误差e，若其足够小则接受θ₀为解；否则将J<sup>#</sup>e加到猜测值上并重复。每一步只是近似正确，因为线性化忽略了高阶项，所以必须反复迭代直至误差低于容差。<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup>

**初始猜测为何重要。** 在标量图景中，迭代沿误差函数的局部斜率走向某个根。位于平台一侧的猜测值收敛到该侧的根，而位于平台顶部附近、斜率很小的猜测值会产生很大的步长，可能落到远离任何解的地方。因此不同的初始猜测可能收敛到同一目标的不同关节解。<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup>

## 奇异与伪逆

在奇异构型处，雅可比矩阵降秩，机器人至少在一个方向上无法产生末端执行器速度。对于连杆长度为单位长度的平面两连杆臂，雅可比行列式为det J = sin θ₂，因此当θ₂ = 0或π、即两连杆完全对齐时，机械臂处于奇异状态；此时两个关节列指向同一方向。<sup>[5](https://ocw.mit.edu/courses/2-12-introduction-to-robotics-fall-2005/d6edf8a76e7674076c6fd5c09dedbed3_chapter5.pdf)</sup>

精确求解J Δθ = e意味着除以雅可比的最小奇异值，而在奇异附近这一除法代价高昂：由精确逆计算出的关节速度被除以2 sin θ₂，当机械臂接近对齐构型时会急剧增大。<sup>[5](https://ocw.mit.edu/courses/2-12-introduction-to-robotics-fall-2005/d6edf8a76e7674076c6fd5c09dedbed3_chapter5.pdf)</sup>伪逆方法在奇异值σ_i趋近于零时不稳定，而这正是奇异点处发生的情形。<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup>

## 阻尼最小二乘

**阻尼最小二乘（DLS）**，亦称Levenberg-Marquardt方法或奇异鲁棒逆，通过惩罚大的关节增量来解决这一问题。它不寻求最好地求解线性化方程的最小Δθ，而是最小化

\[ \|J\Delta\theta - e\|^2 + \lambda^2 \|\Delta\theta\|^2, \]

其中阻尼常数λ非零。正规方程给出\( (J^{\top}J + \lambda^2 I)\Delta\theta = J^{\top}e \)，由于\( J^{\top}J + \lambda^2 I \)非奇异，解为

\[ \Delta\theta = J^{\top}(JJ^{\top} + \lambda^2 I)^{-1} e. \]

当任务空间维数m小于关节数n时，更倾向于采用对m × m矩阵JJ<sup>T</sup> + λ²I求逆的形式，且可通过行运算求值而无需显式矩阵求逆。<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup>

奇异值分解使该机制变得明确。记J = UDV<sup>T</sup>，伪逆将各奇异值取倒数τ_i = 1/σ_i，而DLS使用τ_i = σ_i/(σ_i² + λ²)。当σ_i远大于λ时两者几乎相同，但当σ_i与λ同阶或更小时两者出现分歧，且σ_i/(σ_i² + λ²)当σ_i趋于零时趋于零。因此DLS在远离奇异处表现得像伪逆，而在奇异附近则使其性能变得平滑。<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup>

阻尼常数必须谨慎选取：既要足够大以使关节更新在奇异附近保持良好行为，但若过大则收敛速度太慢。已有基于构型动态选取λ的方法被提出，Buss与Kim的选择性阻尼最小二乘（SDLS）方法对每个奇异模态分别施加阻尼。<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup>

Wampler 1986年的论文是该方法的早期表述，它将精确逆问题重新表述为一个阻尼最小二乘问题，在解的误差与解的幅度之间取得平衡，对包括运动学奇异附近在内的所有机械臂构型都能给出有用的结果，而早期基于雅可比的表述在这些情形下会失效。<sup>[6](https://oamonitor.ireland.openaire.eu/national/search/publication?pid=10.1109%2Ftsmc.1986.289285)</sup>

## 变体与比较

除伪逆与DLS之外，雅可比转置法沿J<sup>T</sup>e方向迭代；它简单，但因不稳定而在奇异附近表现不佳，而DLS方法以每次迭代略高的代价换来显著更好的性能。<sup>[4](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)</sup>2013年弗罗茨瓦夫理工大学的Ignacy Dulęba与Michał Opałka的一项比较研究评估了雅可比转置、伪逆以及三种借自数值分析的方法（包括一种改进的Levenberg-Marquardt变体）；仿真结果表明改进的Levenberg-Marquardt方法颇具前景，而一种避免对可操作度矩阵显式求逆的一阶近似方法以不高的计算代价换来了可靠性。<sup>[7](https://reference-global.com/article/10.2478/amcs-2013-0028)</sup>

实际求解器会加入朴素迭代所忽略的约束。TRAC-IK是MoveIt中KDL求解器的替代方案，它同时运行两种实现，因为KDL基于牛顿法的收敛在存在关节限位时效果不佳：一种是对KDL牛顿法的扩展，通过随机跳变逃离关节限位导致的局部极小；另一种是能更好地处理关节限位的序列二次规划方法；任一方法收敛即返回搜索结果。<sup>[2](https://moveit.picknik.ai/main/doc/how_to_guides/trac_ik/trac_ik_tutorial.html)</sup>Drake的DifferentialInverseKinematicsSystem通过求解一个最小二乘优化问题来计算广义速度指令，通常带有次级关节居中代价以确定零空间内的运动，另可选加笛卡尔位置与速度限制、碰撞约束以及关节速度与加速度限制。<sup>[3](https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_differential_inverse_kinematics_system.html)</sup>

## 局部方法的局限

由于每种基于雅可比的方法都只走局部步长，某些目标无法从某些起始构型到达，而在奇异附近即使阻尼求解器也可能不够。在奇异点处，当规定了某些末端执行器运动时，任何基于伪逆的解都可能无法求解逆运动学问题；Andreas Mueller的解析辅助逆运动学（AI-IK）方法通过显式描述奇异运动的切向方面来构造一个邻近的正则构型，再以此为起点进行迭代数值求解，并报告了在7自由度KUKA iiwa上的结果。<sup>[8](https://arxiv.org/abs/2412.20409)</sup>

在运行中的控制器里，这些局限被热启动部分掩盖：每个时间步控制器收到更新的期望构型，并从上一关节向量出发求解逆运动学，由于新目标接近旧目标，这是一个良好的初始猜测。<sup>[1](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)</sup>

## References

1. [Modern Robotics, Chapter 6.2: Numerical Inverse Kinematics (Part 1 of 2), Lynch and Park, Northwestern University](https://modernrobotics.northwestern.edu/nu-gm-book-resource/6-2-numerical-inverse-kinematics-part-1-of-2/)
2. [TRAC-IK Kinematics Solver, MoveIt Documentation](https://moveit.picknik.ai/main/doc/how_to_guides/trac_ik/trac_ik_tutorial.html)
3. [Drake: DifferentialInverseKinematicsSystem Class Reference](https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_differential_inverse_kinematics_system.html)
4. [Samuel R. Buss (2009). Introduction to Inverse Kinematics with Jacobian Transpose, Pseudoinverse and Damped Least Squares Methods, UC San Diego](https://people.csail.mit.edu/jbarry/spring2011PR2/readings/jactrans.pdf)
5. [H. Harry Asada. Introduction to Robotics, Chapter 5, MIT OCW 2.12 (Fall 2005)](https://ocw.mit.edu/courses/2-12-introduction-to-robotics-fall-2005/d6edf8a76e7674076c6fd5c09dedbed3_chapter5.pdf)
6. [Charles W. Wampler II (1986). Manipulator Inverse Kinematic Solutions Based on Vector Formulations and Damped Least-Squares Methods, IEEE Transactions on Systems, Man, and Cybernetics 16:93-101](https://oamonitor.ireland.openaire.eu/national/search/publication?pid=10.1109%2Ftsmc.1986.289285)
7. [Ignacy Dulęba and Michał Opałka (2013). A comparison of Jacobian-based methods of inverse kinematics for serial robot manipulators, Int. J. Appl. Math. Comput. Sci. 23(2):373-382](https://reference-global.com/article/10.2478/amcs-2013-0028)
8. [Andreas Mueller (2024). Analytically Informed Inverse Kinematics Solution at Singularities, arXiv:2412.20409](https://arxiv.org/abs/2412.20409)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › Mechanical foundations of robotics › Robot kinematics and differential kinematics

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/numerical-inverse-kinematics

English original: https://www.edgepedia.org/numerical-inverse-kinematics
