Library for manipulating ROS Names. See U{http://ros.org/wiki/Names}.
Function | anonymous |
Generate a ROS-legal 'anonymous' name |
Function | canonicalize |
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 |
@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 |
Test if name is a global graph resource name. |
Function | is |
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 |
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 |
Validates that arg is a legal remap according to U{http://wiki.ros.org/Remapping%20Arguments}. |
Function | is |
Test if name is a private graph resource name. |
Function | isstring |
Undocumented |
Function | load |
Load name mappings encoded in command-line arguments. This will filter out any parameter assignment mappings. |
Function | make |
Resolve a local name to the caller ID based on ROS environment settings (i.e. ROS_NAMESPACE) |
Function | make |
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 a namespace and name. If name is unjoinable (i.e. ~private or /global) it will be returned without joining |
Function | resolve |
Resolve a ROS name to its global, canonical form. Private ~names are resolved relative to the node name. |
Function | script |
Name resolver for scripts. Supports :envvar:`ROS_NAMESPACE`. Does not support remapping arguments. |
Constant | ANYTYPE |
Undocumented |
Constant | BASE |
Undocumented |
Constant | GLOBALNS |
Undocumented |
Constant | MSG |
Undocumented |
Constant | NAME |
Undocumented |
Constant | PRIV |
Undocumented |
Constant | REMAP |
Undocumented |
Constant | REMAP |
Undocumented |
Constant | SEP |
Undocumented |
Constant | SRV |
Undocumented |
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
@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
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
Validates that name is a legal base name for a graph resource. A base name has no namespace context, e.g. "node_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
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)
Load name mappings encoded in command-line arguments. This will filter out any parameter assignment mappings.
@param argv: command-line arguments @type argv: [str] @return: name->name remappings. @rtype: dict {str: str}
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
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
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
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
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