module documentation

Warning: do not use this library. It is unstable and most of the routines here have been superseded by other libraries (e.g. genmsg). These routines will likely be deleted in future releases.

Function anonymous_name Generate a ROS-legal 'anonymous' name
Function canonicalize_name Put name in canonical form. Extra slashes '//' are removed and name is returned without any trailing slash, e.g. /foo/bar @param name: ROS name @type name: str
Function get_ros_namespace @param env: environment dictionary (defaults to os.environ) @type env: dict @param argv: command-line arguments (defaults to sys.argv) @type argv: [str] @return: ROS namespace of current program @rtype: str...
Function is_global Test if name is a global graph resource name.
Function is_legal_base_name Validates that name is a legal base name for a graph resource. A base name has no namespace context, e.g. "node_name".
Function is_legal_name Check if name is a legal ROS name for graph resources (alphabetical character followed by alphanumeric, underscore, or forward slashes). This constraint is currently not being enforced, but may start getting enforced in later versions of ROS.
Function is_legal_resource_base_name Validates that name is a legal resource base name. A base name has no package context, e.g. "String".
Function is_legal_resource_name Check if name is a legal ROS name for filesystem resources (alphabetical character followed by alphanumeric, underscore, or forward slashes). This constraint is currently not being enforced, but may start getting enforced in later versions of ROS.
Function is_private Test if name is a private graph resource name.
Function isstring Undocumented
Function load_mappings Load name mappings encoded in command-line arguments. This will filter out any parameter assignment mappings (see roslib.param.load_param_mappings()).
Function make_caller_id Resolve a local name to the caller ID based on ROS environment settings (i.e. ROS_NAMESPACE)
Function make_global_ns Convert name to a global name with a trailing namespace separator.
Function namespace Get the namespace of name. The namespace is returned with a trailing slash in order to favor easy concatenation and easier use within the global context.
Function ns_join Join a namespace and name. If name is unjoinable (i.e. ~private or /global) it will be returned without joining
Function package_resource_name Split a name into its package and resource name parts, e.g. 'std_msgs/String -> std_msgs, String'
Function resolve_name Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name.
Function resource_name Convert package name + resource into a fully qualified resource name
Function resource_name_base pkg/typeName -> typeName, typeName -> typeName
Function resource_name_package pkg/typeName -> pkg, typeName -> None
Constant ANYTYPE Undocumented
Constant BASE_NAME_LEGAL_CHARS_P Undocumented
Constant BASE_RESOURCE_NAME_LEGAL_CHARS_P Undocumented
Constant GLOBALNS Undocumented
Constant NAME_LEGAL_CHARS_P Undocumented
Constant PRIV_NAME Undocumented
Constant PRN_SEPARATOR Undocumented
Constant REMAP Undocumented
Constant RESOURCE_NAME_LEGAL_CHARS_P Undocumented
Constant SEP Undocumented
Function _is_safe_name Undocumented
def anonymous_name(id):

Generate a ROS-legal 'anonymous' name

@param id: prefix for anonymous name @type id: str

def canonicalize_name(name):

Put name in canonical form. Extra slashes '//' are removed and name is returned without any trailing slash, e.g. /foo/bar @param name: ROS name @type name: str

def get_ros_namespace(env=None, argv=None):

@param env: environment dictionary (defaults to os.environ) @type env: dict @param argv: command-line arguments (defaults to sys.argv) @type argv: [str] @return: ROS namespace of current program @rtype: str

def is_global(name):

Test if name is a global graph resource name.

@param name: must be a legal name in canonical form @type name: str @return: True if name is a globally referenced name (i.e. /ns/name) @rtype: bool

def is_legal_base_name(name):

Validates that name is a legal base name for a graph resource. A base name has no namespace context, e.g. "node_name".

def is_legal_name(name):

Check if name is a legal ROS name for graph resources (alphabetical character followed by alphanumeric, underscore, or forward slashes). This constraint is currently not being enforced, but may start getting enforced in later versions of ROS.

@param name: Name @type name: str

def is_legal_resource_base_name(name):

Validates that name is a legal resource base name. A base name has no package context, e.g. "String".

def is_legal_resource_name(name):

Check if name is a legal ROS name for filesystem resources (alphabetical character followed by alphanumeric, underscore, or forward slashes). This constraint is currently not being enforced, but may start getting enforced in later versions of ROS.

@param name: Name @type name: str

def is_private(name):

Test if name is a private graph resource name.

@param name: must be a legal name in canonical form @type name: str @return bool: True if name is a privately referenced name (i.e. ~name)

def isstring(s):

Undocumented

def load_mappings(argv):

Load name mappings encoded in command-line arguments. This will filter out any parameter assignment mappings (see roslib.param.load_param_mappings()).

@param argv: command-line arguments @type argv: [str] @return: name->name remappings. @rtype: dict {str: str}

def make_caller_id(name):

Resolve a local name to the caller ID based on ROS environment settings (i.e. ROS_NAMESPACE)

@param name: local name to calculate caller ID from, e.g. 'camera', 'node' @type name: str @return: caller ID based on supplied local name @rtype: str

def make_global_ns(name):

Convert name to a global name with a trailing namespace separator.

@param name: ROS resource name. Cannot be a ~name. @type name: str @return str: name as a global name, e.g. 'foo' -> '/foo/'.

This does NOT resolve a name.

@rtype: str @raise ValueError: if name is a ~name

def namespace(name):

Get the namespace of name. The namespace is returned with a trailing slash in order to favor easy concatenation and easier use within the global context.

@param name: name to return the namespace of. Must be a legal
name. NOTE: an empty name will return the global namespace.

@type name: str @return str: Namespace of name. For example, '/wg/node1' returns '/wg/'. The

global namespace is '/'.

@rtype: str @raise ValueError: if name is invalid

def ns_join(ns, name):

Join a namespace and name. If name is unjoinable (i.e. ~private or /global) it will be returned without joining

@param ns: namespace ('/' and '~' are both legal). If ns is the empty string, name will be returned. @type ns: str @param name str: a legal name @return str: name concatenated to ns, or name if it is

unjoinable.

@rtype: str

def package_resource_name(name):

Split a name into its package and resource name parts, e.g. 'std_msgs/String -> std_msgs, String'

@param name: package resource name, e.g. 'std_msgs/String' @type name: str @return: package name, resource name @rtype: str @raise ValueError: if name is invalid

def resolve_name(name, namespace_, remappings=None):

Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name.

@param name: name to resolve. @type name: str @param namespace_: node name to resolve relative to. @type namespace_: str @param remappings: Map of resolved remappings. Use None to indicate no remapping. @return: Resolved name. If name is empty/None, resolve_name returns parent namespace_. If namespace_ is empty/None, @rtype: str

def resource_name(res_pkg_name, name, my_pkg=None):

Convert package name + resource into a fully qualified resource name

@param res_pkg_name: name of package resource is located in @type res_pkg_name: str @param name: resource base name @type name: str @param my_pkg: name of package resource is being referred to

in. If specified, name will be returned in local form if res_pkg_name is my_pkg

@type my_pkg: str @return: name for resource @rtype: str

def resource_name_base(name):

pkg/typeName -> typeName, typeName -> typeName

Convert fully qualified resource name into the package-less resource name @param name: package resource name, e.g. 'std_msgs/String' @type name: str @return: resource name sans package-name scope @rtype: str

def resource_name_package(name):

pkg/typeName -> pkg, typeName -> None

@param name: package resource name, e.g. 'std_msgs/String' @type name: str @return: package name of resource @rtype: str

ANYTYPE: str =

Undocumented

Value
'*'
BASE_NAME_LEGAL_CHARS_P =

Undocumented

Value
re.compile(r'^[A-Za-z][\w_]*$')
BASE_RESOURCE_NAME_LEGAL_CHARS_P =

Undocumented

Value
re.compile(r'^[A-Za-z][\w_]*$')
GLOBALNS: str =

Undocumented

Value
'/'
NAME_LEGAL_CHARS_P =

Undocumented

Value
re.compile(r'^[~/A-Za-z][\w_/]*$')
PRIV_NAME: str =

Undocumented

Value
'~'
PRN_SEPARATOR: str =

Undocumented

Value
'/'
REMAP: str =

Undocumented

Value
':='
RESOURCE_NAME_LEGAL_CHARS_P =

Undocumented

Value
re.compile(r'^[A-Za-z][\w_/]*$')
SEP: str =

Undocumented

Value
'/'
def _is_safe_name(name, type_name):

Undocumented