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

Class XmlLoader

source code

   object --+    
            |    
loader.Loader --+
                |
               XmlLoader

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

Instance Methods
 
__init__(self, resolve_anon=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
resolve_args(self, args, context)
Wrapper around 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
 
add_param(self, ros_config, param_name, param_value, verbose=True)
Add Param instances to launch config. (Inherited from roslaunch.loader.Loader)
source code
 
load_env(self, context, ros_config, name, value)
Load environment variable setting (Inherited from roslaunch.loader.Loader)
source code
 
load_rosparam(self, context, ros_config, cmd, param, file_, text, verbose=True)
Load rosparam setting (Inherited from roslaunch.loader.Loader)
source code
 
param_value(self, verbose, name, ptype, value, textfile, binfile, command)
Parse text representation of param spec into Python value (Inherited from roslaunch.loader.Loader)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  ROSPARAM_OPT_ATTRS = ('command', 'ns', 'file', 'param', 'subst...
  PARAM_ATTRS = ('name', 'value', 'type', 'value', 'textfile', '...
  ARG_ATTRS = ('name', 'value', 'default', 'doc')
  NODE_ATTRS = ['pkg', 'type', 'machine', 'name', 'args', 'outpu...
  TEST_ATTRS = ['pkg', 'type', 'machine', 'name', 'args', 'outpu...
  MACHINE_ATTRS = ('name', 'address', 'env-loader', 'ssh-port', ...
  REMAP_ATTRS = ('from', 'to')
  ENV_ATTRS = ('name', 'value')
  INCLUDE_ATTRS = ('file', 'ns', 'clear_params', 'pass_all_args')
  GROUP_ATTRS = ('ns', 'clear_params')
Properties

Inherited from object: __class__

Method Details

__init__(self, resolve_anon=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

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

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

ROSPARAM_OPT_ATTRS

Value:
('command', 'ns', 'file', 'param', 'subst_value')

PARAM_ATTRS

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

NODE_ATTRS

Value:
['pkg',
 'type',
 'machine',
 'name',
 'args',
 'output',
 'respawn',
 'respawn_delay',
...

TEST_ATTRS

Value:
['pkg',
 'type',
 'machine',
 'name',
 'args',
 'output',
 'respawn',
 'respawn_delay',
...

MACHINE_ATTRS

Value:
('name',
 'address',
 'env-loader',
 'ssh-port',
 'user',
 'password',
 'default',
 'timeout')