module documentation

Undocumented

Class Constant Container class for holding a Constant declaration
Class Field Container class for storing information about a single field in a MsgSpec
Class MsgSpec Container class for storing loaded msg description files. Field types and names are stored in separate lists with 1-to-1 correspondence. MsgSpec can also return an md5 of the source text.
Function bare_msg_type Compute the bare data type, e.g. for arrays, get the underlying array item type
Function is_builtin No summary
Function is_header_type No summary
Function is_valid_constant_type No summary
Function is_valid_msg_field_name No summary
Function is_valid_msg_type No summary
Function parse_type Parse ROS message field type :param msg_type: ROS field type, str :returns: base_type, is_array, array_length, (str, bool, int) :raises: ValueError If msg_type cannot be parsed
Function resolve_type Resolve type name based on current package context.
Constant BUILTIN_TYPES Undocumented
Constant DURATION Undocumented
Constant DURATION_MSG Undocumented
Constant HEADER Undocumented
Constant HEADER_FULL_NAME Undocumented
Constant PRIMITIVE_TYPES Undocumented
Constant TIME Undocumented
Constant TIME_MSG Undocumented
def bare_msg_type(msg_type):

Compute the bare data type, e.g. for arrays, get the underlying array item type

Parameters
msg_typeROS msg type (e.g. 'std_msgs/String'), str
Returns
base type, str
def is_builtin(msg_type_name):
Parameters
msg_type_namename of message type, str
Returns
True if msg_type_name is a builtin/primitive type, bool
def is_header_type(msg_type):
Parameters
msg_typemessage type name, str
Returns
True if msg_type refers to the ROS Header type, bool
def is_valid_constant_type(x):
Returns
True if the name is a legal constant type. Only simple types are allowed, bool
def is_valid_msg_field_name(x):
Returns
True if the name is a syntatically legal message field name, bool
def is_valid_msg_type(x):
Returns
True if the name is a syntatically legal message type name, bool
def parse_type(msg_type):

Parse ROS message field type :param msg_type: ROS field type, str :returns: base_type, is_array, array_length, (str, bool, int) :raises: ValueError If msg_type cannot be parsed

def resolve_type(msg_type, package_context):

Resolve type name based on current package context.

NOTE: in ROS Diamondback, 'Header' resolves to 'std_msgs/Header'. In previous releases, it resolves to 'roslib/Header' (REP 100).

e.g.::
resolve_type('String', 'std_msgs') -> 'std_msgs/String' resolve_type('String[]', 'std_msgs') -> 'std_msgs/String[]' resolve_type('std_msgs/String', 'foo') -> 'std_msgs/String' resolve_type('uint16', 'std_msgs') -> 'uint16' resolve_type('uint16[]', 'std_msgs') -> 'uint16[]'
BUILTIN_TYPES =

Undocumented

Value
PRIMITIVE_TYPES+[TIME, DURATION]
DURATION: str =

Undocumented

Value
'duration'
DURATION_MSG: str =

Undocumented

Value
'''int32 secs
int32 nsecs'''
HEADER: str =

Undocumented

Value
'Header'
HEADER_FULL_NAME: str =

Undocumented

Value
'std_msgs/Header'
PRIMITIVE_TYPES: list[str] =

Undocumented

Value
['int8',
 'uint8',
 'int16',
 'uint16',
 'int32',
 'uint32',
 'int64',
...
TIME: str =

Undocumented

Value
'time'
TIME_MSG: str =

Undocumented

Value
'''uint32 secs
uint32 nsecs'''