# 复合刚体算法

复合刚体算法（CRBA）是机器人动力学中的一种递归方法，用于计算刚体系统的关节空间惯性矩阵，即在运动方程中将关节加速度与关节力联系起来的对称矩阵。它与用于逆动力学的[递归牛顿-欧拉算法](https://www.edgepedia.org/zh/recursive-newton-euler-algorithm)（RNEA）和用于正动力学的铰接体算法（ABA）并称为三大经典递归动力学算法。<sup>[1](https://era.ed.ac.uk/items/0d04b6b5-94cd-4480-97fc-e6007a0458d3)</sup>

| 关键事实 | 详情 |
|---|---|
| 用途 | 计算正动力学（即由力计算加速度）中使用的关节空间惯性（质量）矩阵 H(q)<sup>[1](https://era.ed.ac.uk/items/0d04b6b5-94cd-4480-97fc-e6007a0458d3)</sup> |
| 起源 | 沃克与奥林（1982）的方法三，后由罗伊·费瑟斯通命名为复合刚体算法<sup>[2](https://homes.cs.washington.edu/~todorov/courses/amath533/FeatherstoneOrin00.pdf)</sup> |
| 核心思想 | 将连杆 i 至 n 视为绕关节 i 加速的单一复合刚体，其余关节以刚性连接替代<sup>[3](https://era.ed.ac.uk/bitstream/1842/18179/1/FeatherstoneR_1984redux.pdf)</sup> |
| 计算成本 | 对 \( n \times n \) 惯性矩阵约需 \( 16n^{2} \) 次浮点运算，而 RNEA 每体约 200 次、ABA 每体约 450 次<sup>[4](https://www.scholarpedia.org/article/Robot_dynamics)</sup> |
| 原始复杂度 | 沃克与奥林版本为 O(N³)，因其需要求解规模随 N 增长的线性系统<sup>[2](https://homes.cs.washington.edu/~todorov/courses/amath533/FeatherstoneOrin00.pdf)</sup> |
| 软件 | 在 RBDL 和 Pinocchio 两个 C++ 动力学库中实现<sup>[5](https://github.com/rbdl/rbdl)</sup><sup> • </sup><sup>[6](https://gepettoweb.laas.fr/doc/stack-of-tasks/pinocchio/devel/doxygen-html/md_doc_a-features_g-dynamic.html)</sup> |

## 背景与起源

正动力学，即由施加的力计算机构的加速度，需要求解运动方程 \( \tau = H \ddot{q} + C \)，其中 H 为关节空间惯性矩阵。20 世纪 70 至 80 年代，机器人学研究者发展了这些方程的递归形式，其中描述系统的各量通过递推关系相联系而非显式写出，这些递归正是算法高效性的来源。<sup>[7](https://link.springer.com/book/10.1007/978-0-387-74315-8?cm_mmc=Google-_-Book+Search-_-Springer-_-0)</sup>

迈克尔·沃克（Michael Walker）与大卫·奥林（David Orin）于 1982 年提出了四种基于递归牛顿-欧拉算法的正动力学方法。其中方法三为四种中最高效者，它计算机械臂链外端的复合刚体集合的惯性参数；当时在爱丁堡大学（Edinburgh University）任职、后来撰写了机器人动力学算法标准专著的机器人学家罗伊·费瑟斯通（Roy Featherstone）为其取名为复合刚体算法。<sup>[2](https://homes.cs.washington.edu/~todorov/courses/amath533/FeatherstoneOrin00.pdf)</sup> 在沃克与奥林的表述中，H 的各列通过将关节速度设为零后反复应用逆动力学来计算，由于需要求解线性系统，方法为 O(N³)；当 N 较小时一阶项占主导，结果仍相当高效。<sup>[2](https://homes.cs.washington.edu/~todorov/courses/amath533/FeatherstoneOrin00.pdf)</sup>

## 算法原理

关键的洞见在于如何解释 H 的一列。将 H 乘以 u 得到的是：一个静止的机器人，在不受重力及其他外部效应作用时，为获得关节空间加速度 u 所需的关节力；具体而言，H 的第 i 列给出的是仅绕关节 i 产生单位加速度所需的关节力。<sup>[3](https://era.ed.ac.uk/bitstream/1842/18179/1/FeatherstoneR_1984redux.pdf)</sup>

由于在此情形下关节 i+1 至 n 均无运动，这些关节全部可以用刚性连接替代而不影响链下部的动力学。因此机器人的运动部分简化为一个单一的复合刚体，即连杆 i 至 n 绕关节 i 加速的集合体，而该复合体的惯性提供了所涉及的力。<sup>[3](https://era.ed.ac.uk/bitstream/1842/18179/1/FeatherstoneR_1984redux.pdf)</sup>

在递归实现中，一次反向遍历为每个刚体计算复合刚体惯性：即该刚体自身及其全部后代的空问惯性，经变换并求和，如同它们被焊接为一个刚体。这些复合惯性随后直接给出 H 的各元素。<sup>[8](https://docs.rs/featherstone/latest/featherstone/crba/index.html)</sup> 所得的矩阵 H 是对称正定的。<sup>[9](https://royfeatherstone.org/spatial/v1/documentation.html)</sup>

## 效率及与其他算法的比较

CRBA 以约 \( 16n^{2} \) 次浮点运算计算完整的 \( n \times n \) 惯性矩阵，对 n 体系统具有 O(n²) 复杂度。作为对比，递归牛顿-欧拉算法每体约需 200 次浮点运算，铰接体算法每体约需 450 次，二者均为 O(n)。<sup>[4](https://www.scholarpedia.org/article/Robot_dynamics)</sup> 因此，当需要质量矩阵本身时——例如在基于优化的控制中或需显式求解运动方程时——CRBA 是高效之选；而 ABA 完全避免构造 H，对于长链上的普通正动力学计算更快。<sup>[10](https://inferensys.com/glossary/sim-to-real-transfer-learning/physics-simulation-engines/articulated-body-algorithm-aba)</sup>

**数值行为。** 1995 年，[不列颠哥伦比亚大学](https://www.edgepedia.org/zh/university-of-british-columbia)（University of British Columbia）计算机科学教授迪内什·帕伊（Dinesh Pai）、乌里·阿舍尔（Uri Ascher）与伯努瓦·克卢捷（Benoit Cloutier）发表技术报告，将复合刚体方法与铰接体方法统一为求解同一线性系统的两种消元方法，其中铰接体方法利用了稀疏性。他们证明复合刚体方法存在一种相消误差，这解释了其在病态情形下的数值不稳定性，而适当版本的铰接体方法可避免或最小化该误差；最快的正动力学方法未必是数值上最稳定的，他们将这一现象称为表述刚度。<sup>[11](https://www.cs.ubc.ca/tr/1995/tr-95-12)</sup>

## 软件中的应用

CRBA 是刚体动力学库的标准组件。由海德堡大学（Heidelberg University）的马丁·费利斯（Martin Felis）编写的 RBDL（刚体动力学库）提供了 CompositeRigidBodyAlgorithm 函数，可由模型与位形向量计算关节空间惯性矩阵，仅计算 H 的非零元素。<sup>[5](https://github.com/rbdl/rbdl)</sup><sup> • </sup><sup>[12](https://rbdl.github.io/d6/d63/group__dynamics__group.html)</sup> 由法国国家信息与自动化研究所（INRIA）的 Willow 团队与系统分析与架构实验室-法国国家科学研究中心（LAAS-CNRS）的 Gepetto 团队开发的 [Pinocchio](https://www.edgepedia.org/zh/pinocchio)，实现了 CRBA，并对原始算法作了轻微修改以提高计算效率，其方法遵循费瑟斯通 2008 年著作《刚体动力学算法》中的表述。<sup>[6](https://gepettoweb.laas.fr/doc/stack-of-tasks/pinocchio/devel/doxygen-html/md_doc_a-features_g-dynamic.html)</sup><sup> • </sup><sup>[13](https://gepetto.github.io/doc/pinocchio/doxygen-html/)</sup>

## 并行变体

经典算法的递归计算本质上是串行的，这使得高效的并行版本难以实现。费瑟斯通 1999 年的分治铰接体算法在 O(n) 个处理器上以 O(log(n)) 时间实现正动力学；而普渡大学（Purdue University）的李（C. S. G. Lee）与张（P. R. Chang）更早提出的并行算法基于复合刚体方法，利用并行牛顿-欧拉算法、并行线性递推算法及行扫描算法生成惯性矩阵，再对矩阵求逆以获得关节加速度。<sup>[14](https://journals.sagepub.com/doi/10.1177/02783649922066619)</sup><sup> • </sup><sup>[15](https://docs.lib.purdue.edu/ecetr/552/)</sup> 费瑟斯通还报告称，基于关节空间惯性矩阵的算法的成本可以大幅降低，对 30 自由度的四足机器人可降至原来的约四分之一，足以使其重新与铰接体算法等 O(n) 算法相抗衡。<sup>[16](https://royfeatherstone.org/projects.html)</sup>

## References

1. [Robot dynamics algorithms, Roy Featherstone PhD thesis, University of Edinburgh, 1984](https://era.ed.ac.uk/items/0d04b6b5-94cd-4480-97fc-e6007a0458d3)
2. [Robot Dynamics: Equations and Algorithms, Featherstone and Orin](https://homes.cs.washington.edu/~todorov/courses/amath533/FeatherstoneOrin00.pdf)
3. [FeatherstoneR_1984 thesis PDF, section 5.3, The Composite-Rigid-Body Method](https://era.ed.ac.uk/bitstream/1842/18179/1/FeatherstoneR_1984redux.pdf)
4. [Robot dynamics, Scholarpedia](https://www.scholarpedia.org/article/Robot_dynamics)
5. [RBDL: Rigid Body Dynamics Library, GitHub](https://github.com/rbdl/rbdl)
6. [Pinocchio: Dynamics algorithms documentation](https://gepettoweb.laas.fr/doc/stack-of-tasks/pinocchio/devel/doxygen-html/md_doc_a-features_g-dynamic.html)
7. [Robot Dynamics Algorithms, Springer, 1987](https://link.springer.com/book/10.1007/978-0-387-74315-8?cm_mmc=Google-_-Book+Search-_-Springer-_-0)
8. [featherstone::crba, Rust documentation](https://docs.rs/featherstone/latest/featherstone/crba/index.html)
9. [Spatial Arithmetic and Rigid-Body Dynamics Functions, royfeatherstone.org](https://royfeatherstone.org/spatial/v1/documentation.html)
10. [Articulated Body Algorithm (ABA) glossary, Inference Systems](https://inferensys.com/glossary/sim-to-real-transfer-learning/physics-simulation-engines/articulated-body-algorithm-aba)
11. [Forward Dynamics, Elimination Methods, and Formulation Stiffness in Robot Simulation, UBC TR-95-12, Pai, Ascher, and Cloutier, 1995](https://www.cs.ubc.ca/tr/1995/tr-95-12)
12. [RBDL Dynamics module documentation](https://rbdl.github.io/d6/d63/group__dynamics__group.html)
13. [Pinocchio overview](https://gepetto.github.io/doc/pinocchio/doxygen-html/)
14. [A Divide-and-Conquer Articulated-Body Algorithm for Parallel O(log(n)) Calculation of Rigid-Body Dynamics. Part 1: Basic Algorithm, Roy Featherstone, Robotics Research, 1999](https://journals.sagepub.com/doi/10.1177/02783649922066619)
15. [Efficient Parallel Algorithm for Robot Forward Dynamics Computation, C. S. G. Lee and P. R. Chang, Purdue University](https://docs.lib.purdue.edu/ecetr/552/)
16. [Roy's Research, royfeatherstone.org](https://royfeatherstone.org/projects.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › Mechanical foundations of robotics › Robot dynamics, flexible structures, and system identification

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/composite-rigid-body-algorithm

English original: https://www.edgepedia.org/composite-rigid-body-algorithm
