# 轨迹优化

轨迹优化是一种数值方法，在满足系统动力学与沿路径约束的前提下，通过最小化代价泛函来计算动力系统最优的状态与控制序列。其输出是一条轨迹，既可以是离散节点上的状态与控制序列，也可以是用分段多项式样条拟合这些节点得到的曲线。该方法既可作为独立工具用于离线轨迹设计，也可嵌入模型预测控制之中——在后者中，每次求解所得轨迹的第一个动作会被执行。<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup><sup> • </sup><sup>[2](https://underactuated.csail.mit.edu/trajopt.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 输出 | 以节点序列或样条形式表示的状态与控制轨迹，用于离线设计或嵌入MPC<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup><sup> • </sup><sup>[2](https://underactuated.csail.mit.edu/trajopt.html)</sup> |
| 决策变量 | 初始与终端时间，以及状态与控制轨迹，受动力学、路径与边界约束<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup> |
| 主要二分法 | 直接法先离散后优化；间接法先优化后离散<sup>[3](https://www.syscop.de/files/2024ws/NOC/book-NOCSE.pdf)</sup> |
| 主流转录方式 | 多重打靶法与直接配点法<sup>[4](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2022.899025/pdf)</sup> |
| 典型求解器 | SNOPT、IPOPT、FMINCON等NLP求解器<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup> |
| 实时规模 | 在GPU上，512个节点以下的问题每次迭代约100微秒；在CPU上，机器人问题需数十毫秒<sup>[5](https://doi.org/10.48550/arxiv.2510.07625)</sup><sup> • </sup><sup>[6](https://arxiv.org/abs/2303.16746)</sup> |
| 主要失效模式 | 局部极小、对初始猜测敏感、长时程问题因大量切换结构而病态<sup>[7](https://onlinelibrary.wiley.com/doi/10.1155/2014/851720)</sup><sup> • </sup><sup>[8](https://motion-planning-workshop.kavrakilab.org/papers/kinodynamic-motion-planning-benchmark.pdf)</sup> |

## 工作原理

其底层问题是连续时间最优控制问题：在区间\( [t_{0}, t_{F}] \)上选择控制输入\( u(t) \)，以最小化某种代价——例如沿路径积分的加性运行代价——同时满足动力学\( \dot{x} = f(x, u) \)、沿轨迹必须成立的路径约束，以及端点处的边界约束。在连续时间下，这是一个无穷维优化问题，不同于变量与约束均为有限的离散时间情形。<sup>[9](https://www.syscop.de/files/2025ss/rmpc25/slides/MPC-book-2nd-edition-5th-printing-Chapter8.pdf)</sup>实用方法将其转录为有限维非线性规划，再用基于牛顿法的迭代求解。<sup>[10](https://epubs.siam.org/doi/book/10.1137/1.9781611976199)</sup>

三大类方法对此问题的处理方式各不相同。直接法的特征是“先离散，后优化”：将问题转化为[非线性规划](https://www.edgepedia.org/zh/nonlinear-programming)，交给NLP求解器。间接法的特征是“先优化，后离散”：先应用最优性条件，再对所得的边值问题离散化。第三类方法求解Hamilton-Jacobi-Bellman偏微分方程，把代价表示为初始条件的函数，但维数灾难使其在实践中仅限于状态维数较小的系统，比如少于五维。<sup>[3](https://www.syscop.de/files/2024ws/NOC/book-NOCSE.pdf)</sup>间接法路线建立在庞特里亚金最大值原理（给出最优控制方程的最优性条件）之上，由此得到伴随（协态）方程、控制方程与横截条件，共同构成两点边值问题。<sup>[10](https://epubs.siam.org/doi/book/10.1137/1.9781611976199)</sup>

在实践中，直接法目前占据主导地位，因为它们可以使用最先进的NLP求解器，并易于处理不等式约束与多点约束，代价只是对连续问题给出近似解。<sup>[11](https://www.imtek.de/professuren/systemtheorie/events/dateien/directshootingmethods)</sup>间接法在收敛时能给出高精度解，但数值不稳定、实现困难、初始化困难，尤其在状态约束较多时。<sup>[12](https://www.matthewpeterkelly.com/research/MattKelly__Transcription_Methods_for_Trajectory_Optimization.pdf)</sup>用于求解间接边值问题的打靶法一旦收敛则极快且精确，但成功的初始化很难。<sup>[13](https://hal.science/hal-03883822/file/000-MainFile.pdf)</sup>

## 实现方法

**打靶法**通过仿真来施加动力学约束。在直接单打靶法中，控制量在固定网格上离散，状态由数值积分获得，因此进入NLP的只有控制参数。这对简单问题有效，但在复杂问题上会失败，因为决策变量与目标、约束之间的关系难以被求解器的线性或二次模型良好近似<sup>[12](https://www.matthewpeterkelly.com/research/MattKelly__Transcription_Methods_for_Trajectory_Optimization.pdf)</sup>，且轨迹前段的小扰动会传播为末端附近的剧烈误差。<sup>[4](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2022.899025/pdf)</sup>

**多重打靶法**将时域切分为若干区间，从人为设定的初值出发在每个区间上求解ODE，并加入连续性约束将各区间端点联系起来。每个节点上的不匹配量称为缺陷，被加入约束向量。<sup>[11](https://www.imtek.de/professuren/systemtheorie/events/dateien/directshootingmethods)</sup><sup> • </sup><sup>[12](https://www.matthewpeterkelly.com/research/MattKelly__Transcription_Methods_for_Trajectory_Optimization.pdf)</sup>单打靶与多重打靶求解的是等价NLP，离散误差相同；区别在于稀疏性，以及每个子问题在求解器看来有多非线性。<sup>[11](https://www.imtek.de/professuren/systemtheorie/events/dateien/directshootingmethods)</sup>

**配点法（联立方法）**将状态与控制都保留为决策变量，并沿轨迹在若干点上施加动力学约束。梯形配点法将动力学与目标近似为分段线性；Hermite-Simpson配点法将其近似为分段二次，得到一阶导数连续的三次Hermite样条状态。<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup>Hermite-Simpson约束可写成压缩形式或分离形式，后者将中点状态也作为决策变量加入，在分段较少时效果更好。<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup>[正交配点法](https://www.edgepedia.org/zh/orthogonal-collocation)用正交多项式表示轨迹，并在多项式根处施加动力学约束，通过提高多项式阶数来收敛。<sup>[12](https://www.matthewpeterkelly.com/research/MattKelly__Transcription_Methods_for_Trajectory_Optimization.pdf)</sup>Gauss-Lobatto方法每段节点少而段数多，伪谱方法则每段节点多。<sup>[7](https://onlinelibrary.wiley.com/doi/10.1155/2014/851720)</sup>

转录后的NLP被交给SNOPT、IPOPT或FMINCON等求解器；FMINCON先寻找可行解，对较差的初始猜测更宽容，[GPOPS-II](https://www.edgepedia.org/zh/gpops-ii)等自适应工具会自动细化网格。<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup><sup> • </sup><sup>[12](https://www.matthewpeterkelly.com/research/MattKelly__Transcription_Methods_for_Trajectory_Optimization.pdf)</sup>用户定义的目标函数与约束函数必须保持一致：确定性、无分支、光滑。<sup>[1](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)</sup>

## 起源

最优控制史研究者将这一学科追溯到最速降线问题，其最优路径为摆线；而传统观点将现代理论追溯到最大值原理的相关工作。<sup>[14](https://sites.math.rutgers.edu/~sussmann/papers/cdc96historypaper.pdf)</sup>两个理论突破奠定了该领域的基础：Euler-Lagrange条件与Weierstrass条件被推广为庞特里亚金最大值原理，后者启发了打靶法；Hamilton-Jacobi-Bellman方程则将最小代价描述为初始条件的函数。<sup>[13](https://hal.science/hal-03883822/file/000-MainFile.pdf)</sup>

在计算方面，Henry J. Kelley的《最优飞行路径的梯度理论》（ARS Journal，1960）复兴了用于最优规划的梯度法<sup>[15](https://doi.org/10.2514/8.5282)</sup>，1962年基于该工作的两点边值问题最速上升法问世。<sup>[16](https://gwern.net/doc/ai/1962-bryson.pdf)</sup>构成大多数现代软件基础的直接配点法公式由C.R. Hargraves与S.W. Paris于1987年在《Journal of Guidance, Control, and Dynamics》上报道<sup>[17](https://doi.org/10.2514/3.20223)</sup>，Enright与Conway于1992年在该刊的论文确立了用非线性规划进行直接转录以求解最优轨迹的方法。<sup>[18](https://doi.org/10.2514/3.20934)</sup>Herman与Conway于1996年将配点法推广到高阶Gauss-Lobatto求积规则<sup>[19](https://doi.org/10.2514/3.21662)</sup>，Fahroo与Ross于2001年提出了Legendre伪谱协态估计。<sup>[20](https://doi.org/10.2514/2.4709)</sup>

## 变体

**微分动态规划（DDP）**与迭代LQR在标称轨迹附近对代价做二次化，并执行时变LQR反向扫描，反复迭代直至收敛；iLQR使用一阶动力学近似，而标准DDP在反向传播中包含二阶动力学效应。<sup>[2](https://underactuated.csail.mit.edu/trajopt.html)</sup><sup> • </sup><sup>[21](https://ocw.mit.edu/courses/6-832-underactuated-robotics-spring-2009/c227804ef2d31ebb60f83acacd9b9ff5_MIT6_832s09_read_ch09.pdf)</sup>Riccati反向递推利用Bellman最优性原理，将单次迭代复杂度从稠密代数下的\( O(N^{3}) \)降至时域长度\( N \)上的\( O(N) \)。<sup>[4](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2022.899025/pdf)</sup>控制受限DDP可处理执行器饱和，ALTRO则是面向约束轨迹优化的快速求解器。<sup>[22](https://dl.acm.org/doi/10.1109/TRO.2023.3324580)</sup>

**接触隐式优化**无需预先给定步态时序即可处理任意接触序列：Posa、Cantu与Tedrake于2013年在《International Journal of Robotics Research》上报道了刚体接触直接法<sup>[23](https://doi.org/10.1177/0278364913506757)</sup>，Patel及其同事于2019年在《IEEE Robotics and Automation Letters》上给出了正交配点变体。<sup>[24](https://doi.org/10.1109/lra.2019.2900840)</sup>

**GPU并行与基于学习的求解器**是近期变体。MPCGPU于2023年展示了在GPU上通过预处理共轭梯度实现实时长时程求解<sup>[25](https://doi.org/10.48550/arxiv.2309.08079)</sup>，GATO将其扩展到数十至低数百次批量求解，且内循环中无需CPU-GPU数据传输。<sup>[5](https://doi.org/10.48550/arxiv.2510.07625)</sup>DiffuSolve是一种在预先收集的局部最优解上训练的扩散模型，提升了鲁棒性，并在三项任务上使计算效率提高到原来的2至11倍。<sup>[26](https://proceedings.mlr.press/v283/li25a.html)</sup>

## 应用

在航空航天领域，低推力轨迹设计被表述为在边界、中点与推力饱和约束下最小化推进剂质量或飞行时间，即使在二体动力学下也没有解析解。<sup>[7](https://onlinelibrary.wiley.com/doi/10.1155/2014/851720)</sup>早期的梯度法示例包括超音速截击机的最短爬升时间与高超声速滑翔器的最大航程路径。<sup>[16](https://gwern.net/doc/ai/1962-bryson.pdf)</sup>

在足式机器人领域，学界已趋于通过求解最优控制问题来生成运动，但由于间歇接触与大量自由度，在线求解最一般的问题仍然难以实现。<sup>[22](https://dl.acm.org/doi/10.1109/TRO.2023.3324580)</sup>FATROP是一种采用广义Riccati递推的IPOPT风格内点求解器，可在数十毫秒内求解机器人轨迹问题。轨迹优化还用作后处理，以去除传统规划器所生成路径中的冗余或抖动运动<sup>[27](https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/iet-csr.2018.0003)</sup>，并且是每一种模型预测控制实现的计算核心。<sup>[9](https://www.syscop.de/files/2025ss/rmpc25/slides/MPC-book-2nd-edition-5th-printing-Chapter8.pdf)</sup>

## 局限与替代方案

轨迹优化是一种局部方法。基于优化的规划器随状态维数呈多项式而非指数增长，但一般只能得到局部最优，且需要轨迹与时域的较好初始猜测。<sup>[8](https://motion-planning-workshop.kavrakilab.org/papers/kinodynamic-motion-planning-benchmark.pdf)</sup>它们不提供完备性保证：可能收敛到不可行的局部极小，或在杂乱环境中无法摆脱糟糕的初始化，因此实践中许多系统将全局规划器用于初始化、轨迹优化用于细化。<sup>[28](https://media.sciltp.com/articles/2602003141/2602003141.pdf)</sup>长时程问题若含有大量开/关推力结构，会出现病态，此时间接同伦法或混合方法可能更合适。<sup>[7](https://onlinelibrary.wiley.com/doi/10.1155/2014/851720)</sup>自适应黑箱积分器还可能使解映射不可微，因此跨积分器调用的有限差分可能给出严重错误的导数。<sup>[3](https://www.syscop.de/files/2024ws/NOC/book-NOCSE.pdf)</sup>

Karaman与Frazzoli于2011年提出的RRT*与PRM*等渐近最优采样规划器<sup>[29](https://doi.org/10.1177/0278364911406761)</sup>，会随着样本积累收敛到全局最优，Informed RRT*<sup>[30](https://doi.org/10.48550/arxiv.1404.2334)</sup>与BIT*<sup>[31](https://doi.org/10.1177/0278364919890396)</sup>等变体则将采样集中于有希望的区域。然而代价是，在高维情形下路线图增长过大，难以快速在线查询，且采样规划器难以处理位姿约束——这类约束在构型空间中诱导出零测度流形，而这正是轨迹优化表现更好的场景。<sup>[27](https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/iet-csr.2018.0003)</sup>这一族中基于优化的机器人规划器包括CHOMP<sup>[32](https://doi.org/10.1177/0278364913488805)</sup>与TrajOpt。<sup>[33](https://doi.org/10.1177/0278364914528132)</sup>

## References

1. [An Introduction to Trajectory Optimization: How to Do Your Own Direct Collocation (Kelly, SIAM Review 2017)](https://www.matthewpeterkelly.com/research/MatthewKelly_IntroTrajectoryOptimization_SIAM_Review_2017.pdf)
2. [Chapter 10: Trajectory Optimization (Russ Tedrake, Underactuated Robotics)](https://underactuated.csail.mit.edu/trajopt.html)
3. [Numerical Optimal Control (Draft) (Diehl et al., textbook draft, 2024ws)](https://www.syscop.de/files/2024ws/NOC/book-NOCSE.pdf)
4. [Horizon: an open-source framework for trajectory optimization (Frontiers in Robotics and AI, 2022)](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2022.899025/pdf)
5. [Du, Alexander, Emre Adabag, Gabriel Bravo, and Brian Plancher. GATO: GPU-Accelerated and Batched Trajectory Optimization for Scalable Edge Model Predictive Control. ICRA 2026.](https://doi.org/10.48550/arxiv.2510.07625)
6. [FATROP: A Fast Constrained Optimal Control Problem Solver for Robot Trajectory Optimization and Control (abstract page)](https://arxiv.org/abs/2303.16746)
7. [Survey of Direct Transcription for Low-Thrust Space Trajectory Optimization with Applications](https://onlinelibrary.wiley.com/doi/10.1155/2014/851720)
8. [A benchmark comparing search-, sampling-, and optimization-based kinodynamic motion planning](https://motion-planning-workshop.kavrakilab.org/papers/kinodynamic-motion-planning-benchmark.pdf)
9. [Numerical Optimal Control - MPC book 2nd edition, Chapter 8](https://www.syscop.de/files/2025ss/rmpc25/slides/MPC-book-2nd-edition-5th-printing-Chapter8.pdf)
10. [Practical Methods for Optimal Control Using Nonlinear Programming, Third Edition (Betts, SIAM)](https://epubs.siam.org/doi/book/10.1137/1.9781611976199)
11. [Direct Single and Direct Multiple Shooting (Diehl, lecture notes)](https://www.imtek.de/professuren/systemtheorie/events/dateien/directshootingmethods)
12. [Transcription Methods for Trajectory Optimization (Kelly report)](https://www.matthewpeterkelly.com/research/MattKelly__Transcription_Methods_for_Trajectory_Optimization.pdf)
13. [An algorithmic guide for finite-dimensional optimal control problems (Bonnans et al., HAL)](https://hal.science/hal-03883822/file/000-MainFile.pdf)
14. [300 Years of Optimal Control: From the Brachystochrone to the Maximum Principle (Sussmann & Willems, 1996)](https://sites.math.rutgers.edu/~sussmann/papers/cdc96historypaper.pdf)
15. [HENRY J. KELLEY (1960). Gradient Theory of Optimal Flight Paths. ARS journal.](https://doi.org/10.2514/8.5282)
16. [A Steepest-Ascent Method for Solving Optimum Programming Problems (Bryson & Denham, 1962)](https://gwern.net/doc/ai/1962-bryson.pdf)
17. [C.R. Hargraves, S.W. Paris (1987). Direct trajectory optimization using nonlinear programming and collocation. Journal of Guidance Control and Dynamics.](https://doi.org/10.2514/3.20223)
18. [Paul J. Enright, Bruce A. Conway (1992). Discrete approximations to optimal trajectories using direct transcription and nonlinear programming. Journal of Guidance Control and Dynamics.](https://doi.org/10.2514/3.20934)
19. [Albert L. Herman, Bruce A. Conway (1996). Direct optimization using collocation based on high-order Gauss-Lobatto quadrature rules. Journal of Guidance Control and Dynamics.](https://doi.org/10.2514/3.21662)
20. [Fariba Fahroo, I. Michael Ross (2001). Costate Estimation by a Legendre Pseudospectral Method. Journal of Guidance Control and Dynamics.](https://doi.org/10.2514/2.4709)
21. [MIT 6.832 Underactuated Robotics, Chapter 9: Optimal Control (Tedrake course notes)](https://ocw.mit.edu/courses/6-832-underactuated-robotics-spring-2009/c227804ef2d31ebb60f83acacd9b9ff5_MIT6_832s09_read_ch09.pdf)
22. [Optimization-Based Control for Dynamic Legged Robots (IEEE Transactions on Robotics survey)](https://dl.acm.org/doi/10.1109/TRO.2023.3324580)
23. [Michael Posa, Cecilia Cantu, Russ Tedrake (2013). A direct method for trajectory optimization of rigid bodies through contact. The International Journal of Robotics Research.](https://doi.org/10.1177/0278364913506757)
24. [Amir Patel and colleagues (2019). Contact-Implicit Trajectory Optimization Using Orthogonal Collocation. IEEE Robotics and Automation Letters.](https://doi.org/10.1109/lra.2019.2900840)
25. [Adabag, Emre and colleagues (2023). MPCGPU: Real-Time Nonlinear Model Predictive Control through Preconditioned Conjugate Gradient on the GPU. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2309.08079)
26. [DiffuSolve: Diffusion-based Solver for Non-convex Trajectory Optimization (L4DC 2025, PMLR v283)](https://proceedings.mlr.press/v283/li25a.html)
27. [Survey of optimal motion planning (IET Cyber-Systems and Robotics)](https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/iet-csr.2018.0003)
28. [Motion planning formulation and trajectory optimization methods (Charles and Xie, J. Artif. Intell. Autom. 2026)](https://media.sciltp.com/articles/2602003141/2602003141.pdf)
29. [Sertac Karaman, Emilio Frazzoli (2011). Sampling-based algorithms for optimal motion planning. The International Journal of Robotics Research.](https://doi.org/10.1177/0278364911406761)
30. [Gammell, Jonathan D., Srinivasa, Siddhartha S., Barfoot, Timothy D. (2014). Informed RRT*: Optimal Sampling-based Path Planning Focused via Direct Sampling of an Admissible Ellipsoidal Heuristic. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1404.2334)
31. [Jonathan D Gammell, Timothy D Barfoot, Siddhartha S Srinivasa (2020). Batch Informed Trees (BIT*): Informed asymptotically optimal anytime search. The International Journal of Robotics Research.](https://doi.org/10.1177/0278364919890396)
32. [Matt Zucker and colleagues (2013). CHOMP: Covariant Hamiltonian optimization for motion planning. The International Journal of Robotics Research.](https://doi.org/10.1177/0278364913488805)
33. [John Schulman and colleagues (2014). Motion planning with sequential convex optimization and convex collision checking. The International Journal of Robotics Research.](https://doi.org/10.1177/0278364914528132)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Optimization and dynamic programming › Applied and graph-based optimization

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/trajectory-optimization

English original: https://www.edgepedia.org/trajectory-optimization
