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.
Exception MsgSpecException Undocumented
Function base_msg_type Compute the base data type, e.g. for arrays, get the underlying array item type @param type_: ROS msg type (e.g. 'std_msgs/String') @type type_: str @return: base type @rtype: str
Function get_pkg_msg_specs List all messages that a package contains.
Function get_registered @param msg_type_name: name of message type @type msg_type_name: str @return: msg spec for msg type name @rtype: L{MsgSpec}
Function is_builtin @param msg_type_name: name of message type @type msg_type_name: str @return: True if msg_type_name is a builtin/primitive type @rtype: bool
Function is_header_type @param type_: message type name @type type_: str @return: True if \x07 type_ refers to the ROS Header type @rtype: bool
Function is_registered @param msg_type_name: name of message type @type msg_type_name: str @return: True if msg spec for specified msg type name is registered. NOTE: builtin types are not registered. @rtype: bool
Function is_valid_constant_type @return: True if the name is a legal constant type. Only simple types are allowed. @rtype: bool
Function is_valid_msg_field_name @return: True if the name is a syntatically legal message field name @rtype: bool
Function is_valid_msg_type @return: True if the name is a syntatically legal message type name @rtype: bool
Function is_verbose Undocumented
Function list_msg_types List all messages in the specified package @param package str: name of package to search @param include_depends bool: if True, will also list messages in package dependencies @return [str]: message type names...
Function load_by_type Load message specification for specified type
Function load_from_file Convert the .msg representation in the file to a MsgSpec instance. This does not register the object. @param file_path: path of file to load from @type file_path: str: @param package_context: package name to prepend to type name or...
Function load_from_string Load message specification from a string. @param text: .msg text @type text: str @param package_context: package name to use for the type name or
Function load_package Load package into the local registered namespace. All messages found in the package will be registered if they are successfully loaded. This should only be done with one package (i.e. the 'main' package) per Python instance.
Function load_package_dependencies Register all messages that the specified package depends on.
Function msg_file Determine the file system path for the specified .msg resource. .msg resource does not have to exist.
Function parse_type Parse ROS message field type @param type_: ROS field type @type type_: str @return: base_type, is_array, array_length @rtype: str, bool, int @raise MsgSpecException: if type_ cannot be parsed
Function register Load MsgSpec into the type dictionary
Function reinit Reinitialize roslib.msgs. This API is for message generators (e.g. genpy) that need to re-initialize the registration table.
Function resolve_type Resolve type name based on current package context.
Function set_verbose Undocumented
Constant BUILTIN_TYPES Undocumented
Constant COMMENTCHAR Undocumented
Constant CONSTCHAR Undocumented
Constant DURATION Undocumented
Constant DURATION_MSG Undocumented
Constant EXT Undocumented
Constant EXTENDED_BUILTINS Undocumented
Constant HEADER Undocumented
Constant PRIMITIVE_TYPES Undocumented
Constant REGISTERED_TYPES Undocumented
Constant RESERVED_TYPES Undocumented
Constant SEP Undocumented
Constant TIME Undocumented
Constant TIME_MSG Undocumented
Constant VERBOSE Undocumented
Function _convert_val Convert constant value declaration to python value. Does not do type-checking, so ValueError or other exceptions may be raised.
Function _init Undocumented
Function _msg_filter Predicate for filtering directory list. matches message files @param f: filename @type f: str
Function _strify_spec Convert spec into a string representation. Helper routine for MsgSpec. @param indent: internal use only @type indent: str @param buff: internal use only @type buff: StringIO @return: string representation of spec @rtype: str...
Variable _initialized Undocumented
Variable _loaded_packages Undocumented
def base_msg_type(type_):

Compute the base data type, e.g. for arrays, get the underlying array item type @param type_: ROS msg type (e.g. 'std_msgs/String') @type type_: str @return: base type @rtype: str

def get_pkg_msg_specs(package):

List all messages that a package contains.

@param package: package to load messages from @type package: str @return: list of message type names and specs for package, as well as a list

of message names that could not be processed.

@rtype: [(str, L{MsgSpec}), [str]]

def get_registered(msg_type_name, default_package=None):

@param msg_type_name: name of message type @type msg_type_name: str @return: msg spec for msg type name @rtype: L{MsgSpec}

def is_builtin(msg_type_name):

@param msg_type_name: name of message type @type msg_type_name: str @return: True if msg_type_name is a builtin/primitive type @rtype: bool

def is_header_type(type_):

@param type_: message type name @type type_: str @return: True if \x07 type_ refers to the ROS Header type @rtype: bool

def is_registered(msg_type_name):

@param msg_type_name: name of message type @type msg_type_name: str @return: True if msg spec for specified msg type name is registered. NOTE: builtin types are not registered. @rtype: bool

def is_valid_constant_type(x):

@return: True if the name is a legal constant type. Only simple types are allowed. @rtype: bool

def is_valid_msg_field_name(x):

@return: True if the name is a syntatically legal message field name @rtype: bool

def is_valid_msg_type(x):

@return: True if the name is a syntatically legal message type name @rtype: bool

def is_verbose():

Undocumented

def list_msg_types(package, include_depends):

List all messages in the specified package @param package str: name of package to search @param include_depends bool: if True, will also list messages in package dependencies @return [str]: message type names

def load_by_type(msgtype, package_context=''):

Load message specification for specified type

@param package_context: package name to use for the type name or
'' to use the local (relative) naming convention.

@type package_context: str @return: Message type name and message specification @rtype: (str, L{MsgSpec})

def load_from_file(file_path, package_context=''):

Convert the .msg representation in the file to a MsgSpec instance. This does not register the object. @param file_path: path of file to load from @type file_path: str: @param package_context: package name to prepend to type name or

'' to use local (relative) naming convention.

@type package_context: str @return: Message type name and message specification @rtype: (str, L{MsgSpec}) @raise MsgSpecException: if syntax errors or other problems are detected in file

def load_from_string(text, package_context='', full_name='', short_name=''):

Load message specification from a string. @param text: .msg text @type text: str @param package_context: package name to use for the type name or

'' to use the local (relative) naming convention.

@type package_context: str @return: Message specification @rtype: L{MsgSpec} @raise MsgSpecException: if syntax errors or other problems are detected in file

def load_package(package):

Load package into the local registered namespace. All messages found in the package will be registered if they are successfully loaded. This should only be done with one package (i.e. the 'main' package) per Python instance.

@param package: package name @type package: str

def load_package_dependencies(package, load_recursive=False):

Register all messages that the specified package depends on.

@param load_recursive: (optional) if True, load all dependencies,
not just direct dependencies. By default, this is false to prevent packages from incorrectly inheriting dependencies.

@type load_recursive: bool

def msg_file(package, type_):

Determine the file system path for the specified .msg resource. .msg resource does not have to exist.

@param package: name of package .msg file is in @type package: str @param type_: type name of message, e.g. 'Point2DFloat32' @type type_: str @return: file path of .msg file in specified package @rtype: str

def parse_type(type_):

Parse ROS message field type @param type_: ROS field type @type type_: str @return: base_type, is_array, array_length @rtype: str, bool, int @raise MsgSpecException: if type_ cannot be parsed

def register(msg_type_name, msg_spec):

Load MsgSpec into the type dictionary

@param msg_type_name: name of message type @type msg_type_name: str @param msg_spec: spec to load @type msg_spec: L{MsgSpec}

def reinit():

Reinitialize roslib.msgs. This API is for message generators (e.g. genpy) that need to re-initialize the registration table.

def resolve_type(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[]'
def set_verbose(v):

Undocumented

BUILTIN_TYPES =

Undocumented

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

Undocumented

Value
'#'
CONSTCHAR: str =

Undocumented

Value
'='
DURATION: str =

Undocumented

Value
'duration'
DURATION_MSG: str =

Undocumented

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

Undocumented

Value
'.msg'
EXTENDED_BUILTINS =
HEADER: str =

Undocumented

Value
'Header'
PRIMITIVE_TYPES: list[str] =

Undocumented

Value
['int8',
 'uint8',
 'int16',
 'uint16',
 'int32',
 'uint32',
 'int64',
...
REGISTERED_TYPES: dict =

Undocumented

Value
{}
RESERVED_TYPES =

Undocumented

Value
BUILTIN_TYPES+[HEADER]
SEP: str =

Undocumented

Value
'/'
TIME: str =

Undocumented

Value
'time'
TIME_MSG: str =

Undocumented

Value
'''uint32 secs
uint32 nsecs'''
VERBOSE: bool =

Undocumented

Value
False
def _convert_val(type_, val):

Convert constant value declaration to python value. Does not do type-checking, so ValueError or other exceptions may be raised.

@param type_: ROS field type @type type_: str @param val: string representation of constant @type val: str: @raise ValueError: if unable to convert to python representation @raise MsgSpecException: if value exceeds specified integer width

def _init():

Undocumented

def _msg_filter(f):

Predicate for filtering directory list. matches message files @param f: filename @type f: str

def _strify_spec(spec, buff=None, indent=''):

Convert spec into a string representation. Helper routine for MsgSpec. @param indent: internal use only @type indent: str @param buff: internal use only @type buff: StringIO @return: string representation of spec @rtype: str

_initialized: bool =

Undocumented

_loaded_packages: list =

Undocumented