package documentation

Implements rosmsg/rossrv command-line tools.

The code API of the rosmsg module is unstable.

From __init__.py:

Exception ROSMsgException Undocumented
Exception RosMsgProtoArgsException Undocumented
Exception RosMsgProtoException Undocumented
Function construct_ordered_mapping Undocumented
Function construct_yaml_map_with_ordered_dict Undocumented
Function create_names_filter returns a function to use as filter that returns all objects slots except those with names in list.
Function fullusage No summary
Function get_array_type_instance returns a single instance of field_type, where field_type can be a message or ros primitive or an flexible size array.
Function get_msg_text Get .msg file for type_ as text :param type_: message type, str :param raw: if True, include comments and whitespace (default False), bool :returns: text of .msg file, str :raises ROSMsgException If type_...
Function get_srv_text Get .srv file for type_ as text :param type_: service type, str :param raw: if True, include comments and whitespace (default False), bool :returns: text of .srv file, str @raise ROSMsgException: if type_...
Function get_yaml_for_msg Builds a YAML string of message. @param msg: A object, dict or array @param flow_style_: if True, produces one line with brackets, if false uses multiple lines with indentation, if None uses both using heuristics @param prefix: prefixes all lines with this string @param ...
Function init_rosmsg_proto Undocumented
Function iterate_packages Iterator for packages that contain messages/services :param mode: .msg or .srv, str
Function list_msgs List msgs contained in package :param package: package name, str :param rospack: an optional rospack instance to be reused, rospkg.RosPack :returns: list of msgs in package, [str]
Function list_srvs List srvs contained in package :param package: package name, str :param rospack: an optional rospack instance to be reused, rospkg.RosPack :returns: list of srvs in package, [str]
Function list_types Lists msg/srvs contained in package :param package: package name, str :param mode: MODE_MSG or MODE_SRV. Defaults to msgs, str :param rospack: an optional rospack instance to be reused, rospkg.RosPack :returns: list of msgs/srv in package, ...
Function represent_ordered_mapping Undocumented
Function rosmsg_cmd_list Undocumented
Function rosmsg_cmd_md5 Undocumented
Function rosmsg_cmd_package Undocumented
Function rosmsg_cmd_packages Undocumented
Function rosmsg_cmd_prototype Undocumented
Function rosmsg_cmd_show Undocumented
Function rosmsg_debug Prints contents of msg/srv file :param mode: MODE_MSG or MODE_SRV, str
Function rosmsg_md5 Undocumented
Function rosmsg_search Iterator for all packages that contain a message matching base_type
Function rosmsgmain Main entry point for command-line tools (rosmsg/rossrv).
Function spec_to_str Convert spec into a string representation. Helper routine for MsgSpec. :param indent: internal use only, str :param buff: internal use only, StringIO :returns: string representation of spec, str
Constant MAX_DEFAULT_NON_FLOW_ITEMS Undocumented
Constant MODE_MSG Undocumented
Constant MODE_SRV Undocumented
Function _get_package_paths Undocumented
Function _list_resources List resources in a package directory within a particular subdirectory. This is useful for listing messages, services, etc... :param rfilter: resource filter function that returns true if filename is the desired resource type, ...
Function _list_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 :returns [str]: message type names...
Function _msg_filter Undocumented
Function _stdin_arg Undocumented
Variable _catkin_source_path_to_packages Undocumented
Variable _catkin_workspace_to_source_spaces Undocumented
MODE_MSG: str =

Undocumented

Value
'.msg'
MODE_SRV: str =

Undocumented

Value
'.srv'
MAX_DEFAULT_NON_FLOW_ITEMS: int =

Undocumented

Value
4
def construct_ordered_mapping(self, node, deep=False):

Undocumented

def construct_yaml_map_with_ordered_dict(self, node):

Undocumented

def represent_ordered_mapping(self, tag, mapping, flow_style=None):

Undocumented

def get_array_type_instance(field_type, default_package=None):

returns a single instance of field_type, where field_type can be a message or ros primitive or an flexible size array.

def get_yaml_for_msg(msg, prefix='', time_offset=None, current_time=None, field_filter=None, flow_style_=None, fill_arrays_=False):

Builds a YAML string of message. @param msg: A object, dict or array @param flow_style_: if True, produces one line with brackets, if false uses multiple lines with indentation, if None uses both using heuristics @param prefix: prefixes all lines with this string @param fill_arrays_: if True, for all flexible size arrays an element will be generated @param current_time: currently not used. Only provided for API compatibility. current_time passes in the current time with respect to the message. @type current_time: Time @param field_filter: filter the fields that are strified for Messages. @type field_filter: fn(Message)->iter(str) @type flow_style_: bool @return: a string

def create_names_filter(names):

returns a function to use as filter that returns all objects slots except those with names in list.

def init_rosmsg_proto():

Undocumented

def rosmsg_cmd_prototype(args):

Undocumented

def spec_to_str(msg_context, spec, buff=None, indent=''):

Convert spec into a string representation. Helper routine for MsgSpec. :param indent: internal use only, str :param buff: internal use only, StringIO :returns: string representation of spec, str

def get_srv_text(type_, raw=False, rospack=None):

Get .srv file for type_ as text :param type_: service type, str :param raw: if True, include comments and whitespace (default False), bool :returns: text of .srv file, str @raise ROSMsgException: if type_ is unknown

def get_msg_text(type_, raw=False, rospack=None):

Get .msg file for type_ as text :param type_: message type, str :param raw: if True, include comments and whitespace (default False), bool :returns: text of .msg file, str :raises ROSMsgException If type_ is unknown

def rosmsg_debug(rospack, mode, type_, raw=False):

Prints contents of msg/srv file :param mode: MODE_MSG or MODE_SRV, str

def list_srvs(package, rospack=None):

List srvs contained in package :param package: package name, str :param rospack: an optional rospack instance to be reused, rospkg.RosPack :returns: list of srvs in package, [str]

def list_msgs(package, rospack=None):

List msgs contained in package :param package: package name, str :param rospack: an optional rospack instance to be reused, rospkg.RosPack :returns: list of msgs in package, [str]

def list_types(package, mode=MODE_MSG, rospack=None):

Lists msg/srvs contained in package :param package: package name, str :param mode: MODE_MSG or MODE_SRV. Defaults to msgs, str :param rospack: an optional rospack instance to be reused, rospkg.RosPack :returns: list of msgs/srv in package, [str]

def _msg_filter(ext):

Undocumented

def _list_types(path, subdir, ext):

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 :returns [str]: message type names

def _list_resources(path, rfilter=os.path.isfile):

List resources in a package directory within a particular subdirectory. This is useful for listing messages, services, etc... :param rfilter: resource filter function that returns true if filename is the desired resource type, fn(filename)->bool

def iterate_packages(rospack, mode):

Iterator for packages that contain messages/services :param mode: .msg or .srv, str

_catkin_workspace_to_source_spaces: dict =

Undocumented

_catkin_source_path_to_packages: dict =

Undocumented

def _get_package_paths(pkgname, rospack):

Undocumented

def rosmsg_search(rospack, mode, base_type):

Iterator for all packages that contain a message matching base_type

Parameters
rospackUndocumented
modeUndocumented
base_typemessage base type to match, e.g. 'String' would match std_msgs/String, str
def _stdin_arg(parser, full):

Undocumented

def rosmsg_cmd_show(mode, full, alias='show'):

Undocumented

def rosmsg_md5(mode, type_):

Undocumented

def rosmsg_cmd_md5(mode, full):

Undocumented

def rosmsg_cmd_package(mode, full):

Undocumented

def rosmsg_cmd_packages(mode, full, argv=None):

Undocumented

def rosmsg_cmd_list(mode, full, argv=None):

Undocumented

def fullusage(mode):
Parameters
modeUndocumented
cmdcommand name, str
Returns
usage text for cmd, str
def rosmsgmain(mode=MODE_MSG):

Main entry point for command-line tools (rosmsg/rossrv).

rosmsg can interact with either ros messages or ros services. The mode param indicates which :param mode: MODE_MSG or MODE_SRV, str