Skip to main content

Module msg

Module msg 

Source
Expand description

The ROS 2 interface definition languages .msg and .srv, parsed.

A .msg file is one field or constant a line, after the ROS 2 documentation “Interfaces”:

# a comment
int32 x                 # a field
int32 y 5               # a field with a default value
string<=10 name "abc"   # a bounded string
float64[3] v            # an array; [] a sequence, [<=N] a bounded one
geometry_msgs/Point p   # a message of another package
Point q                 # a message of the same package
int32 MAX=100           # a constant (its name in capitals)

A .srv file is a request and a response, separated by a line ---. A bare Header is std_msgs/Header, as in ROS 1.

Structs§

ConstantSpec
A constant of a message.
FieldSpec
A field of a message.
MessageSpec
A message, as written.
ServiceSpec
A service, as written.
TypeSpec
The type of a field.

Enums§

ArraySpec
Whether a field is one value, an array or a sequence.
BaseSpec
The type of a field, before the messages it names are found.
Primitive
A primitive type of the interface languages.

Functions§

parse_message
Parses the text of a .msg file of message name.
parse_service
Parses the text of a .srv file of service name (pkg/srv/Name).
parse_type
Parses the type of a field in a message of package.