module documentation

Library for processing XML substitution args. This is currently used by roslaunch and xacro, but it is not yet a top-level ROS feature.

Exception ArgException Exception for missing $(arg) values
Exception SubstitutionException Base class for exceptions in substitution_args routines
Function resolve_args Resolves substitution args (see wiki spec U{http://ros.org/wiki/roslaunch}).
Class _DictWrapper Undocumented
Function _anon process $(anon) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified
Function _arg process $(arg) arg
Function _collect_args State-machine parser for resolve_args. Substitution args are of the form: $(find package_name)/scripts/foo.py $(export some/attribute blar) non-relevant stuff
Function _dirname process $(dirname) @return: updated resolved argument @rtype: str @raise SubstitutionException: if no information about the current launch file is available, for example
Function _env process $(env) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified
Function _eval Undocumented
Function _eval_anon Undocumented
Function _eval_arg Undocumented
Function _eval_dirname Undocumented
Function _eval_env Undocumented
Function _eval_find Undocumented
Function _eval_optenv Undocumented
Function _find process $(find PKG) Resolves the path while considering the path following the command to provide backward compatible results. If it is followed by a path it first tries to resolve it as an executable and than as a normal file under share...
Function _find_executable process $(find-executable PKG PATH) It finds the executable with the basename(PATH) in the libexec folder or under the PATH relative to the package.xml file. :returns: updated resolved argument, str :raises: SubstitutionException: if PKG/PATH invalidly specified or executable is not found for PKG...
Function _find_resource process $(find-resource PKG PATH) Resolves the relative PATH from the share folder of the PKG either from install space, devel space or from the source folder. :returns: updated resolved argument, str :raises: SubstitutionException: if PKG and PATH invalidly specified or relative PATH is not found for PKG...
Function _get_executable_path Undocumented
Function _get_rospack Undocumented
Function _optenv process $(optenv) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified
Function _resolve_args Undocumented
Function _sanitize_path Undocumented
Function _separate_first_path Undocumented
Function _split_command Undocumented
Constant _DOLLAR Undocumented
Constant _IN Undocumented
Constant _LP Undocumented
Constant _OUT Undocumented
Variable _eval_dict Undocumented
Variable _rospack Undocumented
def resolve_args(arg_str, context=None, resolve_anon=True, filename=None):

Resolves substitution args (see wiki spec U{http://ros.org/wiki/roslaunch}).

@param arg_str: string to resolve zero or more substitution args
in. arg_str may be None, in which case resolve_args will return None

@type arg_str: str @param context dict: (optional) dictionary for storing results of

the 'anon' and 'arg' substitution args. multiple calls to resolve_args should use the same context so that 'anon' substitions resolve consistently. If no context is provided, a new one will be created for each call. Values for the 'arg' context should be stored as a dictionary in the 'arg' key.

@type context: dict @param resolve_anon bool: If True (default), will resolve $(anon

foo). If false, will leave these args as-is.

@type resolve_anon: bool

@return str: arg_str with substitution args resolved @rtype: str @raise SubstitutionException: if there is an error resolving substitution args

def _anon(resolved, a, args, context):

process $(anon) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified

def _arg(resolved, a, args, context):

process $(arg) arg

Returns
updated resolved argument, str
Raises
Unknown exceptionArgException If arg invalidly specified
def _collect_args(arg_str):

State-machine parser for resolve_args. Substitution args are of the form: $(find package_name)/scripts/foo.py $(export some/attribute blar) non-relevant stuff

@param arg_str: argument string to parse args from @type arg_str: str @raise SubstitutionException: if args are invalidly specified @return: list of arguments @rtype: [str]

def _dirname(resolved, a, args, context):

process $(dirname) @return: updated resolved argument @rtype: str @raise SubstitutionException: if no information about the current launch file is available, for example

if XML was passed via stdin, or this is a remote launch.
def _env(resolved, a, args, context):

process $(env) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified

def _eval(s, context):

Undocumented

def _eval_anon(id, anons):

Undocumented

def _eval_arg(name, args):

Undocumented

def _eval_dirname(filename):

Undocumented

def _eval_env(name):

Undocumented

def _eval_find(pkg):

Undocumented

def _eval_optenv(name, default=''):

Undocumented

def _find(resolved, a, args, context):

process $(find PKG) Resolves the path while considering the path following the command to provide backward compatible results. If it is followed by a path it first tries to resolve it as an executable and than as a normal file under share. Else it resolves to the source share folder of the PKG. :returns: updated resolved argument, str :raises: SubstitutionException: if PKG invalidly specified :raises: rospkg.ResourceNotFound If PKG requires resource (e.g. package) that does not exist

def _find_executable(resolved, a, args, _context, source_path_to_packages=None):

process $(find-executable PKG PATH) It finds the executable with the basename(PATH) in the libexec folder or under the PATH relative to the package.xml file. :returns: updated resolved argument, str :raises: SubstitutionException: if PKG/PATH invalidly specified or executable is not found for PKG

def _find_resource(resolved, a, args, _context, source_path_to_packages=None):

process $(find-resource PKG PATH) Resolves the relative PATH from the share folder of the PKG either from install space, devel space or from the source folder. :returns: updated resolved argument, str :raises: SubstitutionException: if PKG and PATH invalidly specified or relative PATH is not found for PKG

def _get_executable_path(base_path, path):

Undocumented

def _get_rospack():

Undocumented

def _optenv(resolved, a, args, context):

process $(optenv) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified

def _resolve_args(arg_str, context, resolve_anon, commands):

Undocumented

def _sanitize_path(path):

Undocumented

def _separate_first_path(value):

Undocumented

def _split_command(resolved, command_with_args):

Undocumented

_DOLLAR: int =

Undocumented

Value
1
_IN: int =

Undocumented

Value
3
_LP: int =

Undocumented

Value
2
_OUT: int =

Undocumented

Value
0
_eval_dict =

Undocumented

_rospack =

Undocumented