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 |
|
Exception for missing $(arg) values |
Exception |
|
Base class for exceptions in substitution_args routines |
Function | resolve |
Resolves substitution args (see wiki spec U{http://ros.org/wiki/roslaunch}). |
Class | _ |
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 |
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 |
Undocumented |
Function | _eval |
Undocumented |
Function | _eval |
Undocumented |
Function | _eval |
Undocumented |
Function | _eval |
Undocumented |
Function | _eval |
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 |
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 |
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 |
Undocumented |
Function | _get |
Undocumented |
Function | _optenv |
process $(optenv) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified |
Function | _resolve |
Undocumented |
Function | _sanitize |
Undocumented |
Function | _separate |
Undocumented |
Function | _split |
Undocumented |
Constant | _DOLLAR |
Undocumented |
Constant | _IN |
Undocumented |
Constant | _LP |
Undocumented |
Constant | _OUT |
Undocumented |
Variable | _eval |
Undocumented |
Variable | _rospack |
Undocumented |
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
process $(anon) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified
process $(arg) arg
Returns | |
updated resolved argument, str | |
Raises | |
Unknown exception | ArgException If arg invalidly specified |
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]
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.
process $(env) arg @return: updated resolved argument @rtype: str @raise SubstitutionException: if arg invalidly specified
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
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
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