The communication of ros is above the os layer and based on the TCP/IP protocol.
The os layer (operating system layer) is irrelevant to developers.
Middle layer: TCPROS/UDPROS, which is re-encapsulated based on the TCP/IP protocol. The Nodelet API is to make up for the shortcomings of the previous two. The Nodelet API is implemented through shared memory instead of network transmission. Sharing of data. ClientLibrary client library refers to encapsulating TCPROS/UDPROS into some specific communication implementation methods of ros, such as topics, services, etc.
Application layer: The first is the master of ros, which is framed with the middle layer because it is the root node that must be present in the ros system. The master is officially provided by ros and is used to manage the node node of the application layer on the right. Node is a independent applications
ROS communication structure-node and master (node and master)
Master: Equivalent to the management center. The nodes are first registered at the master. The communication between nodes is also "wired" by the master before they can communicate point-to-point in pairs. There is only one master in a ROS calculation graph.
Node: An executable program process. Usually a node is responsible for a single function of the robot. Different nodes can use different programming languages, and can also run on different robots under the same LAN.
Specific implementation of communication between nodes: message communication can be achieved through topics, services, actions, and parameters
ros communication structure-topic and service
Topic:
Synchronization/real-time: asynchronous communication/weak,
Implementation principle: ROSTCP and ROSUDP
Communication model: publish/subscribe
Node number relationship: many to many
Application scenarios: data publishing eg: image processing operations
Transmission content: rosmsg (it is the transmission data type defined between the publisher and the subscriber to facilitate communication between the two)
Serviceservice:
Synchronization/real-time: synchronous communication/strong,
Implementation principle: ROSTCP and ROSUDP
Communication model: request/response
Node number relationship: many to one (server side)
Application scenario: logical task processing, eg: light-off operation
Transfer content: rossrv
Action action:
.goal - used to send goals to the server.
.cancel - used to send a cancellation request to the server.
.status - Used to notify client systems of the current status of each target..feedback - Auxiliary information for periodic feedback targets.
.result - used to send the execution result of the task to the client. This topic will only be published once.
Parameter server parameter server:
It is not a node. It runs in the master. It is a place where the node stores parameters. It is used to configure parameters and global shared parameters. It is a dictionary with key-value. It is rarely used.
Original author: Bingda Robot, station b has an official account