Package roshlaunch :: Module xmlloader :: Class XmlLoader
[frames] | no frames]

Class XmlLoader

source code

roslaunch.loader.Loader --+
                          |
                         XmlLoader

Parser for roslaunch XML format. Loads parsed representation into ROSConfig model.

Instance Methods
 
__init__(self, resolve_anon=True) source code
 
resolve_args(self, args, context)
Wrapper around roslaunch.substitution_args.resolve_args to set common parameters
source code
 
opt_attrs(self, tag, context, attrs)
Helper routine for fetching and resolving optional tag attributes @param tag DOM tag @param context LoaderContext
source code
 
reqd_attrs(self, tag, context, attrs)
Helper routine for fetching and resolving required tag attributes
source code
 
load(self, filename, ros_config, core=False, argv=None, verbose=True)
load XML file into launch configuration
source code
 
load_string(self, xml_text, ros_config, core=False, verbose=True)
Load XML text into launch configuration
source code
Class Variables
  ROSPARAM_OPT_ATTRS = 'command', 'ns', 'file', 'param'
  PARAM_ATTRS = 'name', 'value', 'type', 'value', 'textfile', 'b...
  ARG_ATTRS = 'name', 'value', 'default'
  NODE_ATTRS = ['pkg', 'type', 'machine', 'name', 'args', 'outpu...
  TEST_ATTRS = NODE_ATTRS+ ['test-name', 'time-limit', 'retry']
  MACHINE_ATTRS = 'name', 'address', 'ros-root', 'ros-package-pa...
  REMAP_ATTRS = 'from', 'to'
  ENV_ATTRS = 'name', 'value'
  INCLUDE_ATTRS = 'file', NS, CLEAR_PARAMS
  GROUP_ATTRS = NS, CLEAR_PARAMS
Method Details

__init__(self, resolve_anon=True)
(Constructor)

source code 
Parameters:
  • resolve_anon (bool) - If True (default), will resolve $(anon foo). If false, will leave these args as-is.

opt_attrs(self, tag, context, attrs)

source code 

Helper routine for fetching and resolving optional tag attributes @param tag DOM tag @param context LoaderContext

Parameters:
  • attrs, (str) - list of attributes to resolve

reqd_attrs(self, tag, context, attrs)

source code 

Helper routine for fetching and resolving required tag attributes

Parameters:
  • tag - DOM tag
  • attrs ((str)) - list of attributes to resolve
Raises:
  • KeyError - if required attribute is missing

load(self, filename, ros_config, core=False, argv=None, verbose=True)

source code 

load XML file into launch configuration

Parameters:
  • filename (str) - XML config file to load
  • ros_config (ROSLaunchConfig) - launch configuration to load XML file into
  • core (bool) - if True, load file using ROS core rules
  • argv ([str]) - override command-line arguments (mainly for arg testing)

load_string(self, xml_text, ros_config, core=False, verbose=True)

source code 

Load XML text into launch configuration

Parameters:
  • xml_text (str) - XML configuration
  • ros_config (ROSLaunchConfig) - launch configuration to load XML file into
  • core (bool) - if True, load file using ROS core rules

Class Variable Details

PARAM_ATTRS

Value:
'name', 'value', 'type', 'value', 'textfile', 'binfile', 'command'

NODE_ATTRS

Value:
['pkg', 'type', 'machine', 'name', 'args', 'output', 'respawn', 'cwd',\
 NS, CLEAR_PARAMS, 'launch-prefix', 'required']

MACHINE_ATTRS

Value:
'name', 'address', 'ros-root', 'ros-package-path', 'ros-ip', 'ros-host\
-name', 'ssh-port', 'user', 'password', 'default', 'timeout'