UDPROS is a transport layer (in development) for ROS Messages and Services. It uses standard UDP datagram packets to transport serialized message data. The UDPROS transport is useful when latency is more important than reliable transport. Examples in the robotics domain include teleoperation as well as streaming audio.
UDPROS exchanges the connection header in the XML-RPC negotiation. For more general information about the ROS connection header format, see Connection Header.
ROS messages are sent across the network as a series of UDPROS datagrams. The maximum size of the UDPROS datagram is negotiated in the XML-RPC connection (see above).
Each UDP datagram contains a UDPROS header, followed by message data. The format of the header is as follows:
+---------------------------------+ | Connection ID | +---------------------------------+ |Opcode | Msg ID | Block # | +---------------------------------+
- Connection ID - This 32-bit value is determined during connection negotiation and is used to denote which connection the datagram is destined for. This parameter allows a single socket to service multiple UDPROS connections.
- Opcode - UDPROS supports multiple datagram types. The opcode specifies the datagram type. This 8-bit field can have the following possible values:
- DATA0 (0) - This opcode is sent in the first datagram of a ROS message
- DATAN (1) - All subsequent datagrams of a ROS message use this opcode
- PING (2) - A heartbeat packet is sent periodically to let the other side know that the connection is still alive
- ERR (3) - An error packet is used to signal that a connection is closing unexpectedly
- Message ID - This 8-bit value is incremented for each new message and is used to determine if datagrams have been dropped.
- Block # - This 16-bit value is 0 unless the opcode is DATA0, then this field contains the total number of UDPROS datagrams expected to complete the ROS message. When the opcode is DATAN, this field contains the current datagram number.
ROS messages are sent to the subscriber in one or more UDPROS datagrams. The first datagram contains the total number of datagrams to expect. Each datagram contains a header followed by serialized ROS message data. The maximum amount of message data per datagram is determined during the connection negotiation. Only the final datagram of a message will contain fewer than the maximum number of bytes.
- Normal usage:
- small datagrams
- large datagrams
- normal connect/disconnect
- Additional cases:
- unclean shutdown
- multiple udp topics simultaneosly
- mixing UDP and TCP
- bad md5sum
- publisher doesn't support UDP
- max datagram size