ROS实现原理
ROSCon 2017 Vancouver Day 2: Determinism in ROS – or when things break /sometimes / and how to fix it… from Open Robotics on Vimeo.
ROSCon 2019 Macau: Concurrency in ROS 1 and 2: from AsyncSpinner to MultithreadedExecutor from Open Robotics on Vimeo.
Cite: Concurrency and parallelism in ROS 1 and ROS 2: application APIs
ROS主节点采用 XMLRPC 实现。主节点为发布者、订阅者和服务提供者提供需注册 APIs。主节点的统一资源标识符存储在 ROS_MASTER_URI
,对应正在运行的 XML-RPC server 服务器,默认端口是 11311
。
话题传输
话题连接的步骤
- Subscriber starts. It reads its command-line remapping arguments to resolve which topic name it will use. (Remapping Arguments)
- Publisher starts. It reads its command-line remapping arguments to resolve which topic name it will use. (Remapping Arguments)
- Subscriber registers with the Master. (XMLRPC)
- Publisher registers with the Master. (XMLRPC)
- Master informs Subscriber of new Publisher. (XMLRPC)
- Subscriber contacts Publisher to request a topic connection and negotiate the transport protocol. (XMLRPC)
- Publisher sends Subscriber the settings for the selected transport protocol. (XMLRPC)
- Subscriber connects to Publisher using the selected transport protocol. (TCPROS, etc…)
服务连接的步骤
- Service registers with Master
- Service client looks up service on the Master
- Service client creates TCP/IP to the service
- Service client and service exchange a Connection Header
- Service client sends serialized request message
- Service replies with serialized response message.
References
- XML-RPC - Introduction
- ROS Spinning, Threading, Queuing
- Concurrency and parallelism in ROS 1 and ROS 2: application APIs
- Real-time Linux communications
- Tracing tools for ROS
- ROS/Technical Overview
- Speed Up Your Python Program With Concurrency
- RossROS
- Operation Costs in CPU Clock Cycles
- Determinism in ROS – or when things break /sometimes / and how to fix it…