# MATLAB机器人工具箱

**MATLAB机器人工具箱**（Robotics Toolbox for MATLAB，RTB）是一套免费、开源的MATLAB函数与类集合，用于研究和仿真机器人机械臂与移动机器人，由昆士兰理工大学（Queensland University of Technology）教授彼得·科克（Peter Corke）创建。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup><sup> • </sup><sup>[2](https://www.mathworks.com/campaigns/offers/next/teaching-robotics.html)</sup> 它为串联连杆机械臂提供运动学、动力学与轨迹生成功能，为移动机器人提供运动模型、路径规划、定位与SLAM功能，并作为科克所著教材《机器人学、视觉与控制》（*Robotics, Vision & Control*）的配套软件。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup><sup> • </sup><sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup>

| 关键事实 | 详情 |
|---|---|
| 作者 | 彼得·科克，昆士兰理工大学教授；最初是他在1990—1994年博士研究期间编写的代码<sup>[2](https://www.mathworks.com/campaigns/offers/next/teaching-robotics.html)</sup><sup> • </sup><sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup> |
| 首次公开发布 | 1995年，与第一篇发表的论文同时问世；1996年通过“匿名FTP”方式随一篇IEEE RAM论文公开<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup><sup> • </sup><sup>[5](https://petercorke.com/open-source-toolboxes/)</sup> |
| 最新版本 | Release 10（2017年6月），配合《机器人学、视觉与控制》第二版；10.4是当前MATLAB版本<sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup><sup> • </sup><sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> |
| 机械臂覆盖范围 | 串联连杆机械臂的运动学、动力学与轨迹生成，以MATLAB对象表示；示例模型包括Puma 560、斯坦福臂（Stanford arm），以及Kinova、Universal Robotics和Rethink的机器人<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> |
| 移动机器人覆盖范围 | 运动模型（独轮车、自行车）、路径规划（虫行法、距离变换、D*、PRM）、运动动力学规划（格点、RRT）、定位（EKF、粒子滤波）、地图构建与SLAM（EKF），以及一个四旋翼Simulink模型<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> |
| 许可证与状态 | GNU LGPL；已不再积极开发，新工作已转移到Python机器人工具箱<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup><sup> • </sup><sup>[6](https://petercorke.com/general/future-of-the-robotics-toolbox-for-matlab/)</sup> |
| 文档 | 一份可打印的PDF手册，超过400页，由MATLAB代码注释自动生成并带超链接<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup> |

## 历史

该工具箱最初是科克在1990年至1994年间为辅助博士研究而编写的一组函数。<sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup> 第一个版本于1995年随第一篇发表的论文问世，那是1995年在墨尔本举行的澳大利亚机器人协会全国会议上的会议论文。<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup> 工具箱于1996年随《IEEE机器人与自动化杂志》上的一篇文章公开，当时软件通过“匿名FTP”分发。<sup>[5](https://petercorke.com/open-source-toolboxes/)</sup>

**版本时间线。** 主要版本包括：<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup>

- v4，1996年8月，对应《IEEE机器人与自动化杂志》上的文章<sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup>
- v5，1999年4月，首个采用对象的版本；在此之前一切都是矩阵<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup><sup> • </sup><sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup>
- v6，2001年4月<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup>
- v7，2002年4月，加入MEX文件、Simulink模型和修改版Denavit-Hartenberg支持；发布以支持约翰·克雷格（John Craig）教材的第三版，该版习题使用了此工具箱<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup><sup> • </sup><sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup>
- v8，2008年12月，自2002年以来的首次更新，也是首次使用MATLAB classdef对象语法，并集成到MATLAB桌面帮助和演示系统中，新增Motoman、ABB和Fanuc的机器人模型<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup><sup> • </sup><sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup>
- v9，2011年9月，为支持《机器人学、视觉与控制》第一版而大幅扩展，加入移动机器人控制、规划与定位、四旋翼控制，并改进文档<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup><sup> • </sup><sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup>
- v10，2017年6月，配合该书第二版<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup>

这一时期两次重大重构产生了独立的工具箱：2004年的机器视觉工具箱（Machine Vision Toolbox）和2018年的空间数学工具箱（Spatial Math Toolbox），后者是在学术休假期间访问Natick的[MathWorks](https://www.edgepedia.org/zh/mathworks)时写成的。<sup>[5](https://petercorke.com/open-source-toolboxes/)</sup>

## 功能

**机械臂。** 工具箱将串联连杆机械臂的运动学与动力学表示为MATLAB对象。用户可为任意串联连杆机械臂创建机器人对象，发行版中包含Kinova、Universal Robotics和Rethink的知名机器人模型，以及Puma 560和斯坦福臂等经典机器人。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> 典型工作流程是加载模型并调用其方法，例如用`p560.fkine([0 0 0 0 0 0])`求Puma 560在零关节构型下的正运动学。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> Release 10在`SerialLink`类上新增了`twists`方法，为每个关节返回一个`Twist`对象，支持正运动学与雅可比矩阵的指数积公式，并附带一个URDF解析器原型。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup>

**姿态与位姿。** 工具箱提供函数与类，用于以矩阵、四元数、旋量、三角度和矩阵指数表示二维与三维中的姿态和位姿，并支持向量、齐次变换和单位四元数等数据类型之间的转换。<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup> Release 10引入了名为SO2、SE2、SO3和SE3的类，用于表示位置、姿态和位姿，另有一个独立的UnitQuaternion类。<sup>[4](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)</sup> 在Release 10中，所有位姿表示代码被拆分到独立的空间数学工具箱，后者成为机器人工具箱的依赖项。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup>

**移动机器人。** 移动机器人支持涵盖车辆运动模型（独轮车、自行车）、路径规划方法（虫行法、距离变换、D*、PRM）、运动动力学规划器（格点、RRT）、基于EKF和粒子滤波的定位、基于EKF的地图构建，以及基于EKF的同步定位与建图；工具箱还包含一个非完整约束车辆的Simulink模型，以及一个飞行四旋翼的详细Simulink模型。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> 示例脚本以动画演示了一辆汽车式车辆执行由Reeds-Shepp规划器计算的三点掉头，以及一个移动机器人用粒子滤波从信标定位。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup>

## 设计与预期用途

这些例程以直白的方式编写，便于理解，作者指出这或许以计算效率为代价；需要速度的用户可以重写函数、用MATLAB编译器编译M文件，或创建MEX版本。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> 由于源代码可得，工具箱被定位为理解与教学的工具，其成熟的代码可作为同一算法其他实现的对照基准。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup>

工具箱充分利用MATLAB在线性代数、可移植性和图形方面的原生能力。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> 从GitHub安装需要MATLAB R2016b或更高版本，工具箱依赖另外两个仓库`spatialmath-matlab`和`toolbox-common-matlab`；打包的`RTB.mltbx`文件在MATLAB中打开时会自行安装。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup>

## 与MathWorks机器人系统工具箱的关系

MATLAB机器人工具箱与MathWorks自家的机器人系统工具箱（Robotics System Toolbox）不同，后者是受支持的商业产品，为机械臂与移动机器人应用提供算法，包括碰撞检测、路径规划、轨迹生成、正逆运动学和基于刚体树表示的动力学。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup><sup> • </sup><sup>[7](https://www.mathworks.com/help/robotics/)</sup> 科克的工具箱可追溯到1993年，远早于MathWorks产品；前者免费、开源且不受支持，后者则完全受支持且商业化。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> 一些功能目的重叠但名称不同；例如欧拉角到旋转矩阵的转换在MathWorks工具箱中是`eul2rotm`，在科克的工具箱中是`eul2tr`。<sup>[8](https://robotics.stackexchange.com/questions/11909/about-official-robotics-system-toolbox-matlab-and-peter-corke-robotics-toolbox-m)</sup> 对于《机器人学、视觉与控制》第三版（2023年）MATLAB版的用户，推荐软件是MathWorks的机器人系统工具箱及相关工具箱，而非此工具箱。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup>

## 当前状态

MATLAB机器人工具箱、机器视觉工具箱和空间数学工具箱于2022年1月停止维护，源代码仍可在GitHub上免费获取。<sup>[6](https://petercorke.com/general/future-of-the-robotics-toolbox-for-matlab/)</sup><sup> • </sup><sup>[5](https://petercorke.com/open-source-toolboxes/)</sup> 仓库README声明工具箱已不再积极开发，其中的问题与议题可能无人回应。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> 对于新工作，积极开发的继任者是[Python机器人工具箱](https://www.edgepedia.org/zh/robotics-toolbox-for-python)，它也被《机器人学、视觉与控制》第三版使用。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup> GitHub仓库约有1.6k星标和463次复刻。<sup>[1](https://github.com/petercorke/robotics-toolbox-matlab)</sup>

该工具箱在作者所在机构之外的教学中也得到广泛使用。约翰·克雷格《机器人学导论》（*Introduction to Robotics*，第3版，2004年）中的习题基于该工具箱的早期版本，MathWorks将其列为与机器人教学相关的社区工具箱之一。<sup>[3](https://petercorke.com/toolboxes/robotics-toolbox/)</sup><sup> • </sup><sup>[2](https://www.mathworks.com/campaigns/offers/next/teaching-robotics.html)</sup>

## References

1. [Robotics Toolbox for MATLAB, GitHub repository (petercorke/robotics-toolbox-matlab)](https://github.com/petercorke/robotics-toolbox-matlab)
2. [Teaching Robotics with MATLAB and Simulink, MathWorks white paper](https://www.mathworks.com/campaigns/offers/next/teaching-robotics.html)
3. [Robotics Toolbox, Peter Corke](https://petercorke.com/toolboxes/robotics-toolbox/)
4. [Toolbox History, petercorke/robotics-toolbox-matlab Wiki](https://github.com/petercorke/robotics-toolbox-matlab/wiki/Toolbox-History)
5. [Open-source MATLAB Toolboxes, Peter Corke](https://petercorke.com/open-source-toolboxes/)
6. [Future of the Robotics Toolbox for MATLAB, Peter Corke](https://petercorke.com/general/future-of-the-robotics-toolbox-for-matlab/)
7. [Robotics System Toolbox Documentation, MathWorks](https://www.mathworks.com/help/robotics/)
8. [About official Robotics System Toolbox MATLAB and Peter Corke Robotics Toolbox MATLAB, Robotics Stack Exchange](https://robotics.stackexchange.com/questions/11909/about-official-robotics-system-toolbox-matlab-and-peter-corke-robotics-toolbox-m)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › 机器人软件、人工智能与方法 › 机器人中间件、框架与行为架构

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/robotics-toolbox-for-matlab

English original: https://www.edgepedia.org/robotics-toolbox-for-matlab
