Content deleted Content added
added ROS equation image. |
Added design computation graph sections. |
||
Line 59:
=== Philosophy ===
[[File:Ros Equation.png|thumb|An image depicting the ROS equation: Plumbing + Tools + Capabilities + Ecosystem = ROS!|alt=An image depicting the ROS equation: Plumbing + Tools + Capabilities + Ecosystem = ROS!|500x500px]]
ROS was designed with open-source in mind, intending that users would be able to chose the configuration of tools and libraries which interacted with the core of ROS so that users could shift their software stacks to fit their robot and application area. As such, there is very little which is actually core to ROS, beyond the general structure within which programs must exist and communicate. In one sense, all ROS is is the underlying plumbing behind nodes and message passing. However, in reality, ROS is that plumbing, a rich and mature set of tools, a wide ranging set of robot-agnostic capabilities provided by packages, and a greater ecosystem of additions to ROS.
=== Computation Graph Model ===▼
ROS processes are represented as nodes in a graph structure, connected by edges called topics.<ref name=":3">{{Cite web|url=http://wiki.ros.org/ROS/Tutorials/UnderstandingNodes|title=ROS/Tutorials/UnderstandingNodes - ROS Wiki|website=wiki.ros.org|access-date=2019-04-29}}</ref> ROS nodes can pass messages to on another through topics, make service calls to other nodes, provide a service for other nodes, or set or retrieve shared data from a communal database called the parameter server. A process called the ROS Master<ref name=":3" /> makes all of this possible by registering nodes to itself, setting up node-to-node communication for topics, and controlling parameter server updates. Messages and service calls do not pass through the master, rather the master sets up peer-to-peer communication between all node processes after they register themselves with the master. This decentralized architecture lends itself well to robots, which are often comprise of a subset of networked computer hardware, and may communicate with off board computers for heavy computation or commands.
A node represents a single process running the ROS graph. Every node has a name, which it registers with the ROS master before it can take any other actions. Multiple nodes with different names can exist under different [[Namespace|namespaces]], or a node can be defined as anonymous, in which case it will randomly generate an additional identifier to add to its given name. Nodes are at the center of ROS programming, as most ROS client code is in the form of a ROS node which takes actions based on information received from other nodes, sends information to other nodes, or sends and receives requests for actions to and from other nodes.
▲=== Computation Graph ===
====
Topics are named [[Software bus|buses]] over which nodes send and receive messages.<ref>{{Cite web|url=http://wiki.ros.org/ROS/Tutorials/UnderstandingTopics|title=ROS/Tutorials/UnderstandingTopics - ROS Wiki|website=wiki.ros.org|access-date=2019-04-29}}</ref> Topic names must be unique within their namespace as well. To send messages to a topic, a node must publish to said topic, while to receive messages it must subscribe. The publish/subscribe model is anonymous: no node knows which nodes are sending or receiving on a topic, only that it is sending/receiving on that topic. The types of messages passed on a topic vary widely and can be user-defined. The content of these messages can be sensor data, motor control commands, state information, actuator commands, or anything else.
▲==== ROS Master ====
==== Services ====
A node may also advertise services<ref name=":4">{{Cite web|url=http://wiki.ros.org/ROS/Tutorials/UnderstandingServicesParams|title=ROS/Tutorials/UnderstandingServicesParams - ROS Wiki|website=wiki.ros.org|access-date=2019-04-29}}</ref>. A service represents an action that a node can take which will have a single result. As such, services are often used for actions which have a defined beginning and end, such as capturing a single-frame image, rather than processing velocity commands to a wheel motor or odometer data from a wheel encoder. Nodes advertise services and call services from one another.
==== Parameter Server ====
The parameter server<ref name=":4" /> is a database shared between nodes which allows for communal access to static or semi-static information. Data which does not change frequently and as such will be infrequently accessed, such as the distance between two fixed points in the environment, or the weight of the robot, are good candidates for storage in the parameter server.
==Tools==
|