# 机器人操作系统

机器人操作系统（Robot Operating System，ROS）是一个开源软件框架，或者说中间件，用于将机器人软件编写为许多通过消息总线通信的小型进程。它并不是内核意义上的操作系统；它是一套库、工具和约定，让开发者能够用称为“节点”的可复用组件来组合机器人应用。它最初由[柳树车库](https://www.edgepedia.org/zh/willow-garage)（Willow Garage）和斯坦福大学（Stanford University）为服务机器人研究而开发，共有两代：ROS 1，其最后一个发行版已于2025年5月31日停止支持；以及[ROS 2](https://www.edgepedia.org/zh/ros-2)，这一面向工业的继任者如今从研究实验室到工厂部署都在使用。<sup>[1](https://spectrum.ieee.org/wizards-of-ros-willow-garage-and-the-making-of-the-robot-operating-system)</sup><sup> • </sup><sup>[2](https://ai.stanford.edu/~mquigley/papers/icra2009-ros.pdf)</sup><sup> • </sup><sup>[3](https://discourse.ros.org/t/ros-noetic-end-of-life-may-31-2025/43160)</sup>

| 关键事实 | 详情 |
|---|---|
| 首次提交 | 2007年11月7日，由柳树车库的ROS平台经理肯·康利（Ken Conley）完成<sup>[1](https://spectrum.ieee.org/wizards-of-ros-willow-garage-and-the-making-of-the-robot-operating-system)</sup> |
| 奠基论文 | 《ROS：一个开源的机器人操作系统》，2009年IEEE ICRA；为斯坦福的STAIR项目和柳树车库的个人机器人计划而设计<sup>[2](https://ai.stanford.edu/~mquigley/papers/icra2009-ros.pdf)</sup> |
| 治理 | 2014年，管理权移交给了开源机器人基金会（Open Source Robotics Foundation，现名Open Robotics），一家501(c)(3)非营利组织<sup>[4](https://nu-msr.github.io/ros_notes/ros2/ros_history.html)</sup> |
| ROS 2发表 | 《机器人操作系统2：设计、架构与实际应用》，Science Robotics第7卷第66期，2022年（马琴斯基、富特、格基、拉朗塞特、伍德尔）<sup>[5](https://arxiv.org/abs/2211.07752)</sup> |
| ROS 1停止支持 | Noetic Ninjemys，最后一个ROS 1发行版，于2025年5月31日停止支持<sup>[3](https://discourse.ros.org/t/ros-noetic-end-of-life-may-31-2025/43160)</sup> |
| 当前发行版 | Jazzy Jalisco（长期支持版，2024年5月23日，支持至2029年5月）和Kilted Kaiju（2025年5月23日）<sup>[6](https://www.openrobotics.org/blog/2024/5/ros-jazzy-jalisco-released)</sup><sup> • </sup><sup>[7](https://repo.test.ros2.org/en/jazzy/Releases.html)</sup> |
| 工业分支 | ROS-Industrial，由西南研究院（Southwest Research Institute）于2013年成立，将ROS扩展到制造自动化领域<sup>[8](https://rosindustrial.org/faq)</sup> |

## 历史

ROS源于斯坦福大学与机器人孵化器柳树车库之间的合作，旨在设计一个新的开源机器人编程框架。斯坦福的研究人员此前一直在构建STAIR（STanford Artificial Intelligence Robot，斯坦福人工智能机器人）平台，柳树车库的个人机器人计划则以PR1家用机器人延续了这项工作；驱动PR1的ROS原型也驱动了多台斯坦福机器人。<sup>[1](https://spectrum.ieee.org/wizards-of-ros-willow-garage-and-the-making-of-the-robot-operating-system)</sup><sup> • </sup><sup>[9](https://news.stanford.edu/stories/2019/01/stanfords-robotics-legacy)</sup> 代码仓库于2007年在[SourceForge](https://www.edgepedia.org/zh/sourceforge)上建立，该框架在2009年ICRA论文中得到了正式描述，论文作者明确阐述了设计目标：点对点、基于工具、多语言、轻量，以及自由且开源。<sup>[2](https://ai.stanford.edu/~mquigley/papers/icra2009-ros.pdf)</sup>

2014年，ROS的管理权移交给了开源机器人基金会，即现在的Open Robotics，该基金会还维护Gazebo仿真器、ros-controls实时控制框架，以及用于协调机器人编队与电梯、门等建筑基础设施的Open Robotics中间件框架（Open-RMF）。<sup>[4](https://nu-msr.github.io/ros_notes/ros2/ros_history.html)</sup><sup> • </sup><sup>[10](https://www.openrobotics.org/)</sup>

## 架构

一个ROS系统是一个由节点构成的图，节点是交换强类型消息的小型进程。ROS 2在其文档中被描述为一种基于强类型、匿名发布/订阅机制的中间件，节点及其连接构成的网络称为ROS图。<sup>[11](https://repo.test.ros2.org/en/jazzy/Concepts/Basic.html)</sup> 应用通过三种接口类型进行通信：

- **话题**承载单向消息流，不期望响应，例如一个传感器节点发布一条`Temperature`消息，其他节点订阅该消息。<sup>[12](https://repo.test.ros2.org/en/jazzy/Concepts/Basic/About-Interfaces.html)</sup>
- **服务**是用于快速完成的计算的请求/响应调用，例如查询节点状态或计算逆运动学。<sup>[12](https://repo.test.ros2.org/en/jazzy/Concepts/Basic/About-Interfaces.html)</sup>
- **动作**是长时间运行的请求/响应交互，可以持续数秒或数分钟，在执行过程中提供反馈，并可被中断；一个动作定义包含目标、结果和反馈三部分。<sup>[12](https://repo.test.ros2.org/en/jazzy/Concepts/Basic/About-Interfaces.html)</sup>

接口用一种简化的接口定义语言来描述：消息用`.msg`文件，服务用`.srv`文件，动作用`.action`文件，可根据这些文件生成多种目标语言的源代码。<sup>[12](https://repo.test.ros2.org/en/jazzy/Concepts/Basic/About-Interfaces.html)</sup>

**客户端库。** 用户代码是针对客户端库编写的。C++库`rclcpp`和Python库`rclpy`是核心团队维护的两个库，二者都构建在一个通用的、与语言无关的核心之上，即ROS客户端库（ROS Client Library，rcl），它一次性为所有语言实现了名称与命名空间、时间（真实或仿真）、参数、日志、线程以及进程内通信。<sup>[13](https://repo.test.ros2.org/en/rolling/Concepts/Basic/About-Client-Libraries.html)</sup> 社区成员为其他语言维护着额外的客户端库。<sup>[13](https://repo.test.ros2.org/en/rolling/Concepts/Basic/About-Client-Libraries.html)</sup>

## ROS 2与中间件

ROS 1在设计时并未考虑许多生产级特性；ROS 2及其相关项目是为现代机器人系统从头重新设计的，案例研究表明它在加速真实机器人系统走向可靠部署方面的作用。<sup>[5](https://arxiv.org/abs/2211.07752)</sup> Open Robotics的宣传册指出，ROS 2的构建目标是达到工业生产使用的级别，包括高可靠性和安全关键系统，并已在Linux、Windows和macOS上得到支持和测试。<sup>[14](https://docs.ros.org/en/kilted/_downloads/dc02ad59ea2569ae6a4f64e9c8797ef4/ros2-brochure-ltr-print.pdf)</sup>

默认通信方法采用行业标准：IDL、DDS（Data Distribution Service，数据分发服务：面向分布式系统的行业消息标准），以及DDS-I RTPS线协议，这些已在从工厂到航空航天等工业应用中得到广泛部署。<sup>[15](https://docs.ros.org/en/rolling/_downloads/92fd4de453c4c54cc6b1b8b41c1abdc6/ros2-brochure-a4-web.pdf)</sup> DDS提供分布式发现机制，不同于ROS 1的集中式主节点，并提供可配置的服务质量选项。<sup>[16](https://docs.ros.org/en/ros2_documentation/kilted/Concepts/Intermediate/About-Different-Middleware-Vendors.html)</sup> 多种实现通过ROS中间件（rmw）接口接入：eProsima [Fast DDS](https://www.edgepedia.org/zh/fast-dds)（默认实现，随二进制发行版打包）、[Eclipse Cyclone DDS](https://www.edgepedia.org/zh/eclipse-cyclone-dds)、RTI Connext DDS、GurumNetworks GurumDDS，以及从Kilted Kaiju开始引入的Eclipse Zenoh——一种更轻量的发布/订阅协议，适合资源受限的边缘设备。<sup>[16](https://docs.ros.org/en/ros2_documentation/kilted/Concepts/Intermediate/About-Different-Middleware-Vendors.html)</sup>

## 发行版

ROS以命名的发行版形式发布。ROS 1的最终发行版是Noetic Ninjemys（2020年5月），支持至2025年5月31日停止，恰逢Ubuntu Focal标准支持结束；ROS PMC当时报告称，80%的社区用户已切换到ROS 2。<sup>[3](https://discourse.ros.org/t/ros-noetic-end-of-life-may-31-2025/43160)</sup> ROS 2发行版每年发布，通常在5月23日，另有一个滚动开发发行版Rolling Ridley，为未来的稳定发行版准备软件包。<sup>[7](https://repo.test.ros2.org/en/jazzy/Releases.html)</sup> Foxy Fitzroy（2020年6月5日）是第一个长期支持的ROS 2发行版；Jazzy Jalisco（2024年5月23日）是第十个ROS 2发行版，支持至2029年5月底；Kilted Kaiju于2025年5月23日跟进，Lyrical Luth预定于2026年5月发布。<sup>[7](https://repo.test.ros2.org/en/jazzy/Releases.html)</sup><sup> • </sup><sup>[6](https://www.openrobotics.org/blog/2024/5/ros-jazzy-jalisco-released)</sup>

## 安全与实时

默认情况下，ROS 2中DDS的安全特性均未启用；启用这些特性的工具统称为SROS 2（Secure ROS 2，安全ROS 2）。安全基于DDS-Security标准的插件：认证（使用x.509证书的PKI）、访问控制（签名的治理和权限文件）以及加密（AES-GCM），通过环境变量`ROS_SECURITY_ENABLE`开启。<sup>[17](https://design.ros2.org/articles/ros2_dds_security)</sup>

实时执行是早期ROS 1未考虑的一项需求，如今已难以在其上补救，因此ROS 2在设计时就将实时约束纳入考量。<sup>[18](https://github.com/ros2/ros2_documentation/blob/rolling/source/Capabilities/Motion-planning/Real-Time-Programming.rst)</sup> 在正确的配置下，ROS 2技术栈具备实时能力，不过创建一个实时Linux系统需要配置方面的专业知识；ROS-Industrial部署通常将ROS用作高层控制器，与原始设备制造商（OEM）的低层实时控制器配合，后者闭合伺服反馈回路并提供急停等安全行为。<sup>[8](https://rosindustrial.org/faq)</sup>

## ROS-Industrial与工业生态

ROS-Industrial是一个开源项目，由[西南研究院](https://www.edgepedia.org/zh/southwest-research-institute)于2013年与行业合作伙伴共同成立，将ROS的能力扩展到工业相关的硬件和应用。它增加了统一机器人描述格式、驱动接口库，以及对制造自动化有用的软件包，并强调代码质量和可靠性，通过自动代码质量指标报告每个软件包的成熟度。<sup>[8](https://rosindustrial.org/faq)</sup><sup> • </sup><sup>[19](https://rosindustrial.org/)</sup> 它不是ROS或工业机器人控制器的替代品：它与现有的工业控制器通信，使机械臂、末端执行器、感知系统和外围设备不论OEM品牌或通信总线如何，都能通过ROS消息实现互操作。<sup>[19](https://rosindustrial.org/)</sup><sup> • </sup><sup>[8](https://rosindustrial.org/faq)</sup>

在核心框架周围，一个更广泛的生态系统已经形成。MoveIt 2于2019年首次发布，是ROS 2的运动规划平台，涵盖操作、三维感知、运动学和控制，规划器通过其`move_group`节点提供的ROS动作或服务来访问。<sup>[20](https://moveit.picknik.ai/)</sup> Gazebo仿真机器人，并通过`ros_gz`桥接以及与仿真器无关的ROS 2仿真接口与ROS 2集成；前者在Gazebo Transport和ROS 2之间转换消息，后者用于实体生成、仿真步进和世界状态查询。<sup>[21](https://gazebosim.org/docs/harmonic/ros2_overview/)</sup><sup> • </sup><sup>[22](https://gazebosim.org/docs/latest/ros2_sim_interfaces/)</sup>

## 采用情况

2020年一项针对ROS-Industrial的红队研究指出，ROS正迅速成为机器人领域的标准，同时警告说，缓慢的行业采用周期将使ROS 2在工业中的广泛采用推迟数年。<sup>[23](https://arxiv.org/abs/2009.08211)</sup>

## References

1. [Wizards of ROS: Willow Garage and the Making of the Robot Operating System, IEEE Spectrum](https://spectrum.ieee.org/wizards-of-ros-willow-garage-and-the-making-of-the-robot-operating-system)
2. [Quigley et al. (2009). ROS: an open-source Robot Operating System, ICRA](https://ai.stanford.edu/~mquigley/papers/icra2009-ros.pdf)
3. [ROS Noetic End-of-Life: May 31, 2025, Open Robotics Discourse](https://discourse.ros.org/t/ros-noetic-end-of-life-may-31-2025/43160)
4. [About ROS: Introduction and History, Northwestern MSR notes](https://nu-msr.github.io/ros_notes/ros2/ros_history.html)
5. [Macenski et al. (2022). Robot Operating System 2: Design, Architecture, and Uses In The Wild, arXiv/Science Robotics](https://arxiv.org/abs/2211.07752)
6. [ROS 2 Jazzy Jalisco Released, Open Robotics](https://www.openrobotics.org/blog/2024/5/ros-jazzy-jalisco-released)
7. [Distributions, ROS 2 Documentation: Jazzy](https://repo.test.ros2.org/en/jazzy/Releases.html)
8. [FAQ, ROS-Industrial](https://rosindustrial.org/faq)
9. [Stanford's robotics legacy, Stanford Report](https://news.stanford.edu/stories/2019/01/stanfords-robotics-legacy)
10. [Open Robotics](https://www.openrobotics.org/)
11. [Basic Concepts, ROS 2 Documentation: Jazzy](https://repo.test.ros2.org/en/jazzy/Concepts/Basic.html)
12. [Interfaces, ROS 2 Documentation: Jazzy](https://repo.test.ros2.org/en/jazzy/Concepts/Basic/About-Interfaces.html)
13. [Client libraries, ROS 2 Documentation: Rolling](https://repo.test.ros2.org/en/rolling/Concepts/Basic/About-Client-Libraries.html)
14. [ROS 2 brochure (Kilted), docs.ros.org](https://docs.ros.org/en/kilted/_downloads/dc02ad59ea2569ae6a4f64e9c8797ef4/ros2-brochure-ltr-print.pdf)
15. [ROS 2 brochure (Rolling), docs.ros.org](https://docs.ros.org/en/rolling/_downloads/92fd4de453c4c54cc6b1b8b41c1abdc6/ros2-brochure-a4-web.pdf)
16. [Different ROS 2 middleware vendors, ROS 2 Documentation: Kilted](https://docs.ros.org/en/ros2_documentation/kilted/Concepts/Intermediate/About-Different-Middleware-Vendors.html)
17. [DDS-Security integration with ROS 2: SROS 2, ROS 2 Design](https://design.ros2.org/articles/ros2_dds_security)
18. [Real-Time Programming, ros2_documentation (GitHub)](https://github.com/ros2/ros2_documentation/blob/rolling/source/Capabilities/Motion-planning/Real-Time-Programming.rst)
19. [ROS-Industrial](https://rosindustrial.org/)
20. [MoveIt 2 Documentation](https://moveit.picknik.ai/)
21. [ROS 2 integration overview, Gazebo Harmonic documentation](https://gazebosim.org/docs/harmonic/ros2_overview/)
22. [Use ROS 2 Simulation Interfaces to Interact with Gazebo, Gazebo documentation](https://gazebosim.org/docs/latest/ros2_sim_interfaces/)
23. [Can ROS be used securely in industry? Red teaming ROS-Industrial, arXiv](https://arxiv.org/abs/2009.08211)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/robot-operating-system

English original: https://www.edgepedia.org/robot-operating-system
