# iSAM2

**iSAM2**（增量平滑与建图，第二版）是一种用于稀疏非线性增量优化的算法，最初针对同步定位与建图（SLAM）问题提出。它利用一种称为贝叶斯树的数据结构，在测量数据到达时更新机器人轨迹与地图的完整最大后验估计。该算法由迈克尔·卡斯（Michael Kaess）、霍德尔·约翰松（Hordur Johannsson）、理查德·罗伯茨（Richard Roberts）、维奥雷拉·伊拉（Viorela Ila）、约翰·伦纳德（John Leonard）和弗兰克·德拉尔特（Frank Dellaert）于2012年2月在《国际机器人研究杂志》（*International Journal of Robotics Research*）上发表（第31卷，第2期，第217至236页）。<sup>[1](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)</sup>

| 关键事实 | 详情 |
|---|---|
| 发表信息 | 卡斯等，《国际机器人研究杂志》，2012年2月，31(2):217–236<sup>[1](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)</sup> |
| 核心数据结构 | 贝叶斯树——一种有向团树，编码因式分解形式的概率密度，并自然地对应 SLAM 问题的平方根信息矩阵<sup>[1](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)</sup> |
| 效率机制 | 增量式变量重排序与流式重线性化，消除了原始 iSAM 所需的周期性批处理步骤<sup>[1](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)</sup> |
| 复杂度 | 每步 O(1)（每个位姿约束数恒定的探索任务）；完整因式分解最坏情况 O(n³)；在诸多 SLAM 问题所满足的假设下，批处理因式分解与回代为 O(n<sup>1.5</sup>)<sup>[2](https://dellaert.github.io/files/Kaess12ijrr.pdf)</sup> |
| 已知代价 | 在大规模回环闭合情形下比批处理更新更昂贵；对于密集序列，HOG-Man 等近似方法更高效<sup>[3](https://academic.oup.com/jcde/article/8/3/855/6275213)</sup> |
| 标准实现 | GTSAM C++ 库中的 `ISAM2` 类，流式重线性化阈值默认为 0.1，每 10 次更新检查一次<sup>[4](https://borglab.github.io/gtsam/isam2/)</sup><sup> • </sup><sup>[5](https://ai.thesatyajit.com/articles/gtsam-4-3)</sup> |
| 典型用户 | Kimera-VIO 用于视觉-惯性估计，LIO-SAM 用于激光-惯性建图，以及其他实时 SLAM 系统<sup>[6](https://www.cv-learn.com/visual-slam-roadmap/level-02-getting-familiar/incremental-smoothing/)</sup> |

## 背景：从批处理平滑到 iSAM

平滑方法将 SLAM 建模为关于整条轨迹与地图的非线性最小二乘问题，通过对信息矩阵进行稀疏矩阵分解来求解。平方根 SAM 利用 Levenberg–Marquardt 算法对天然稀疏的信息矩阵做乔列斯基分解，从而实现这种平滑。<sup>[3](https://academic.oup.com/jcde/article/8/3/855/6275213)</sup> 原始的 [iSAM](https://www.edgepedia.org/zh/isam) 算法由卡斯及其同事于2008年提出，利用矩阵更新方程对平方根信息矩阵进行快速增量更新，从而复用先前计算的分量，同时仍能在任意时刻计算完整的地图与轨迹。<sup>[7](https://www.cs.cmu.edu/~kaess/pub/Kaess12ijrr.pdf)</sup>

为保持高效与一致性，iSAM 需要周期性的批处理步骤来进行变量重排序与重线性化。轨迹中的回环会引入当前位姿与较早路标之间的相关性，从而产生填充——即因子矩阵稀疏模式之外的非零元；使用 COLAMD（列近似最小度）等启发式方法对变量重排序可以恢复稀疏性，但这需要重新分解矩阵。<sup>[8](https://web.mit.edu/2.166/www/handouts/Kaess08tro.pdf)</sup>

## 贝叶斯树

2012年那篇论文的核心贡献是贝叶斯树——一种将图模型推断与稀疏矩阵分解联系起来的数据结构。团树以因式分解形式表示概率密度，贝叶斯树同样如此；不同之处在于它是有向的，并且与 SLAM 问题的平方根信息矩阵对应得更为紧密。论文提出了三点洞见：贝叶斯树用概率密度来解释矩阵分解；对矩阵分解的抽象更新转化为对树及其条件密度的简单编辑；该树支持一种新的稀疏非线性增量优化算法，作者将其命名为 iSAM2。<sup>[1](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)</sup>

贝叶斯树的构造不同于联结树的构造——后者先形成团图，再寻找生成树。与矩阵分解一样，该树依赖于指定的变量排序，但更为灵活：与平方根信息矩阵中固定的变量排序不同，一个团内的子树可以重新排列。<sup>[3](https://academic.oup.com/jcde/article/8/3/855/6275213)</sup>

## 算法工作原理

iSAM2 在随时间扩展的非线性约束下获得变量（地图与轨迹）的估计。新的因子可以在任意时刻到达，并可能引入新变量。基于当前线性化点，该算法作为迭代非线性优化方案中的子程序求解一个线性化系统，该系统由贝叶斯树表示。<sup>[2](https://dellaert.github.io/files/Kaess12ijrr.pdf)</sup>

**增量更新。** iSAM2 不直接应用矩阵分解更新，而是仅编辑被传入因子触及的贝叶斯树中的团，对受影响部分重新消元。当发生回环闭合时，新因子往往涉及远离根的变量，因此从该处到根的所有内容都被重新消元，重新消元的变量数量急剧上升。<sup>[9](https://github.com/haidai/gtsam/blob/master/gtsam/nonlinear/ISAM2.h)</sup>

**流式重线性化。** iSAM2 不按固定日程对所有变量重线性化，而是仅当某变量的估计偏移超过阈值时才对其重线性化。在 GTSAM 的 `ISAM2Params` 中，该阈值默认为 0.1，每 10 次更新检查一次。<sup>[5](https://ai.thesatyajit.com/articles/gtsam-4-3)</sup> 原始论文还研究了重线性化阈值 β 和回代阈值 α；在 Manhattan 数据集上，较小的回代阈值（如 0.005）在精度几乎不受影响的情况下带来了显著的速度提升。<sup>[10](https://people.csail.mit.edu/kaess/pub/Kaess12ijrr.pdf)</sup>

**增量重排序。** 变量排序在每一步增量更新，而非在周期性的批处理步骤中更新，这正是 iSAM2 得以消除 iSAM1 所需的批处理重分解的原因。<sup>[1](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)</sup><sup> • </sup><sup>[3](https://academic.oup.com/jcde/article/8/3/855/6275213)</sup>

## 复杂度

对于每个位姿约束数恒定的探索任务，每步复杂度为 O(1)，因为只有树顶部的常数个变量受到影响并被重新消元。最一般的界是完整因式分解的 O(n³)，其中 n 为变量（位姿与路标）数。在诸多 SLAM 问题所满足的假设下，批处理矩阵分解与回代可在 O(n<sup>1.5</sup>) 内完成，该界不依赖于回环闭合的次数。经验上，代价通常远低于这些界，因为每一步只需重新分解矩阵的一小部分。<sup>[2](https://dellaert.github.io/files/Kaess12ijrr.pdf)</sup>

在采用相对表述的问题中，iSAM2 将问题分解为由不同子树表示的子地图；新的测量可以随时改变该拓扑，因此复杂度没有显式界。对于大规模回环闭合情形，iSAM2 比批处理更新更昂贵；对于密集序列，HOG-Man 等近似方法更高效。<sup>[3](https://academic.oup.com/jcde/article/8/3/855/6275213)</sup>

## 与其他方法的比较

原始论文将 iSAM2 与 iSAM1、HOG-Man 和 SPA 进行了比较，并报告在一系列真实与模拟数据集上，其在质量和效率上均不逊于其他近期建图算法。<sup>[1](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)</sup><sup> • </sup><sup>[2](https://dellaert.github.io/files/Kaess12ijrr.pdf)</sup> 与滤波方法不同——后者已知对非线性 SLAM 问题不一致——iSAM2 在完整历史上求解完整 SLAM 问题，不拒绝任何信息。<sup>[7](https://www.cs.cmu.edu/~kaess/pub/Kaess12ijrr.pdf)</sup><sup> • </sup><sup>[3](https://academic.oup.com/jcde/article/8/3/855/6275213)</sup>

## 应用与扩展

iSAM2 在开源 GTSAM 库中实现为 `ISAM2` 类，支持增量更新、高效的变量重排序，以及通过边缘、联合和贝叶斯网查询暴露当前线性化高斯的贝叶斯树查询。<sup>[4](https://borglab.github.io/gtsam/isam2/)</sup> 例如，Kimera-VIO 通过运行 GTSAM 的 iSAM2 并配合无结构智能投影因子来进行增量视觉-惯性估计，而 [LIO-SAM](https://www.edgepedia.org/zh/lio-sam) 将其激光-惯性因子图交给同一求解器。<sup>[6](https://www.cv-learn.com/visual-slam-roadmap/level-02-getting-familiar/incremental-smoothing/)</sup> 它也被应用于机器人学之外；沃森和格罗斯使用 iSAM2 评估了 GNSS 定位中精密单点定位（PPP）的收敛性，该方法无需本地参考站即可实现实时滤波与平滑。<sup>[11](https://arxiv.org/abs/1804.04197)</sup> 用于自主水下航行器的水下位姿 SLAM 系统同样使用 GTSAM 的 iSAM2 求解器在前端构建图的同时在线估计轨迹。<sup>[12](https://onlinelibrary.wiley.com/doi/10.1002/rob.22272)</sup>

后续工作对该算法进行了扩展。萧和卡斯提出了多假设 iSAM2，用[高斯混合模型](https://www.edgepedia.org/zh/gaussian-mixture-model)替代单高斯测量模型以处理模糊测量。<sup>[3](https://academic.oup.com/jcde/article/8/3/855/6275213)</sup> NF-iSAM 利用贝叶斯树将高效增量更新引入非高斯推断。<sup>[13](https://arxiv.org/abs/2105.05045)</sup> 近期的 GTSAM 版本包含 riSAM——一种基于 iSAM2 扩展构建的鲁棒增量平滑与建图实现。<sup>[14](https://github.com/borglab/gtsam/releases)</sup> 斯坦纳树协方差恢复已集成到 `ISAM2` 中，提供成对联合协方差查询，在 w20000 数据集（一个包含超过 20,000 个位姿的 Manhattan 风格二维位姿图）上稳定在 3 至 4 毫秒左右，即便 iSAM2 的更新代价波动并在回环闭合时达到峰值。<sup>[15](https://gtsam.org/2026/04/06/incremental-fast-covariance.html)</sup>

## References

1. [Michael Kaess, Hordur Johannsson, Richard Roberts, Viorela Ila, John Leonard, and Frank Dellaert (2012). iSAM2: Incremental Smoothing and Mapping Using the Bayes Tree. IJRR 31(2):217–236. Robotics Institute, Carnegie Mellon University.](https://publications.ri.cmu.edu/isam2-incremental-smoothing-and-mapping-using-the-bayes-tree)
2. [iSAM2: Incremental Smoothing and Mapping Using the Bayes Tree (paper PDF, Frank Dellaert's site)](https://dellaert.github.io/files/Kaess12ijrr.pdf)
3. [iSAM2 using CUR matrix decomposition for data compression and analysis. Journal of Computational Design and Engineering.](https://academic.oup.com/jcde/article/8/3/855/6275213)
4. [ISAM2 – GTSAM Docs](https://borglab.github.io/gtsam/isam2/)
5. [GTSAM 4.3: factor graphs from first principles, and what three years of commits changed](https://ai.thesatyajit.com/articles/gtsam-4-3)
6. [Incremental smoothing – Visual-SLAM Roadmap](https://www.cv-learn.com/visual-slam-roadmap/level-02-getting-familiar/incremental-smoothing/)
7. [iSAM2: Incremental Smoothing and Mapping Using the Bayes Tree (paper PDF, CMU)](https://www.cs.cmu.edu/~kaess/pub/Kaess12ijrr.pdf)
8. [Kaess et al.: iSAM: Incremental Smoothing and Mapping, IEEE Transactions on Robotics (2008)](https://web.mit.edu/2.166/www/handouts/Kaess08tro.pdf)
9. [gtsam/nonlinear/ISAM2.h documentation (GitHub)](https://github.com/haidai/gtsam/blob/master/gtsam/nonlinear/ISAM2.h)
10. [iSAM2 paper PDF, Michael Kaess @ CSAIL](https://people.csail.mit.edu/kaess/pub/Kaess12ijrr.pdf)
11. [Ryan M. Watson and Jason N. Gross (2018). Evaluation of Kinematic Precise Point Positioning Convergence with an Incremental Graph Optimizer. arXiv:1804.04197.](https://arxiv.org/abs/1804.04197)
12. [Pau Vial et al. (2024). Underwater Pose SLAM using GMM scan matching for a mechanical profiling sonar. Journal of Field Robotics.](https://onlinelibrary.wiley.com/doi/10.1002/rob.22272)
13. [NF-iSAM: Incremental Smoothing and Mapping via Normalizing Flows. arXiv:2105.05045.](https://arxiv.org/abs/2105.05045)
14. [GTSAM Releases (GitHub)](https://github.com/borglab/gtsam/releases)
15. [Frank Dellaert (2026). Incremental Fast Covariance with iSAM2. GTSAM blog.](https://gtsam.org/2026/04/06/incremental-fast-covariance.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › Robot software, AI, and methods › SLAM and visual odometry

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/isam2

English original: https://www.edgepedia.org/isam2
