[Documentation] [TitleIndex] [WordIndex

ROS/Connection Header

The ROS connection header contains important metadata about a connection being established, including typing information and routing information. How it is exchanged depends on the ROS transport being used.

See also:

Encoding Format

4-byte length + [4-byte field length + field=value ]*

All length fields are little-endian integers. Field names and values are strings.

Example encoding of a published message

Raw hex output from rostopic pub /chatter std_msgs/String "hello" (new lines and indenting added for readability):

b0 00 00 00
   20 00 00 00
      6d 65 73 73 61 67 65 5f 64 65 66 69 6e 69 74 69 6f 6e 3d 73 74 72 69 6e 67
      20 64 61 74 61 0a 0a
   25 00 00 00
      63 61 6c 6c 65 72 69 64 3d 2f 72 6f 73 74 6f 70 69 63 5f 34 37 36 37 5f 31
      33 31 36 39 31 32 37 34 31 35 35 37
   0a 00 00 00
      6c 61 74 63 68 69 6e 67 3d 31
   27 00 00 00
      6d 64 35 73 75 6d 3d 39 39 32 63 65 38 61 31 36 38 37 63 65 63 38 63 38 62
      64 38 38 33 65 63 37 33 63 61 34 31 64 31
   0e 00 00 00
      74 6f 70 69 63 3d 2f 63 68 61 74 74 65 72
   14 00 00 00
      74 79 70 65 3d 73 74 64 5f 6d 73 67 73 2f 53 74 72 69 6e 67
09 00 00 00
   05 00 00 00
      68 65 6c 6c 6f

The output can be translated as:

6d 65 73 73 61 67 65 5f 64 65 66 69 6e 69 74 69 6f 6e 3d 73 74 72 69 6e 67-
 m  e  s  s  a  g  e  _  d  e  f  i  n  i  t  i  o  n  =  s  t  r  i  n  g-
20 64 61 74 61 0a 0a
    d  a  t  a \n \n

63 61 6c 6c 65 72 69 64 3d 2f 72 6f 73 74 6f 70 69 63 5f 34 37 36 37 5f 31 33-
 c  a  l  l  e  r  i  d  =  /  r  o  s  t  o  p  i  c  _  4  7  6  7  _  1  3-
31 36 39 31 32 37 34 31 35 35 37
 1  6  9  1  2  7  4  1  5  5  7

6c 61 74 63 68 69 6e 67 3d 31
 l  a  t  c  h  i  n  g  =  1

6d 64 35 73 75 6d 3d 39 39 32 63 65 38 61 31 36 38 37 63 65 63 38 63 38 62 64-
 m  d  5  s  u  m  =  9  9  2  c  e  8  a  1  6  8  7  c  e  c  8  c  8  b  d- 
38 38 33 65 63 37 33 63 61 34 31 64 31
 8  8  3  e  c  7  3  c  a  4  1  d  1

74 6f 70 69 63 3d 2f 63 68 61 74 74 65 72
 t  o  p  i  c  =  /  c  h  a  t  t  e  r

74 79 70 65 3d 73 74 64 5f 6d 73 67 73 2f 53 74 72 69 6e 67
 t  y  p  e  =  s  t  d  _  m  s  g  s  /  S  t  r  i  n  g

68 65 6c 6c 6f
 h  e  l  l  o

Fields

See TCPROS information on the specific fields used when creating TCPROS connections.


2019-07-13 12:23