Package node_manager_fkie :: Module launch_config :: Class LaunchConfig
[frames] | no frames]

Class LaunchConfig

source code

PySide.QtCore.QObject --+
                        |
                       LaunchConfig

A class to handle the ROS configuration stored in launch file.

Instance Methods
 
__init__(self, launch_file, package=None, masteruri=None, argv=[])
Creates the LaunchConfig object.
source code
 
__del__(self) source code
 
on_file_changed(self, file)
callback method, which is called by QtCore.QFileSystemWatcher if the launch file or included files are changed.
source code
str
masteruri(self)
Returns the master URI (host) where the node of this config will be started.
source code
roslaunch.ROSLaunchConfig or None
Roscfg(self)
Returns a loaded launch configuration
source code
str
Filename(self)
Returns an existing path with file name or an empty string.
source code
str
LaunchName(self)
Returns the name of the launch file with extension, e.g.
source code
str or None
PackageName(self)
Returns the name of the package containing the launch file or None.
source code
str
interpretPath(self, path, pwd='.')
Tries to determine the path of the included file.
source code
[str,...]
getIncludedFiles(self, file)
Reads the configuration file and searches for included files.
source code
 
load(self, argv) source code
[str]
getArgs(self)
Returns: a list with args being used in the roslaunch file.
source code
dict(robot:dict('type' :str, 'name': str, 'images' : [str], 'description': str))
getRobotDescr(self)
Parses the launch file for robots parameter to get the description of the robot.
source code
dict(machine : dict(namespace: dict(group:dict('type' : str, 'images' : [str], 'description' : str, 'nodes' : [str]))))
getCapabilitiesDesrc(self)
Parses the launch file for capabilities and capability_group parameter and creates dictionary for grouping the nodes.
source code
 
argvToDict(self, argv) source code
roslaunch.Node or None
getNode(self, name)
Returns a configuration node for a given node name.
source code
Class Methods
(name, path)
packageName(cls, dir)
Returns for given directory a tuple of package name and package path or None values.
source code
Instance Variables
  file_changed = QtCore.Signal(str, str)
a signal to inform the receiver about the changes on launch file or included file.
Method Details

__init__(self, launch_file, package=None, masteruri=None, argv=[])
(Constructor)

source code 

Creates the LaunchConfig object. The launch file will be not loaded on creation, first on request of Roscfg value.

Parameters:
  • launch_file (str) - The absolute or relative path with the launch file. By using relative path a package must be valid for remote launches.
  • package (str or None) - the package containing the launch file. If None the launch_file will be used to determine the launch file. No remote launches a possible without a valid package.
  • masteruri (str or None) - The URL of the ROS master.
  • argv ([str]) - the list the arguments needed for loading the given launch file
Raises:
  • roslaunch.XmlParseException - if the launch file can't be found.

on_file_changed(self, file)

source code 

callback method, which is called by QtCore.QFileSystemWatcher if the launch file or included files are changed. In this case LaunchConfig.file_changed signal will be emitted.

masteruri(self)

source code 

Returns the master URI (host) where the node of this config will be started.

Returns: str
Decorators:
  • @property

Roscfg(self)

source code 

Returns a loaded launch configuration

Returns: roslaunch.ROSLaunchConfig or None
Decorators:
  • @property
Raises:

Filename(self)

source code 

Returns an existing path with file name or an empty string.

Returns: str
Decorators:
  • @property

LaunchName(self)

source code 

Returns the name of the launch file with extension, e.g. 'test.launch'

Returns: str
Decorators:
  • @property

PackageName(self)

source code 

Returns the name of the package containing the launch file or None.

Returns: str or None
Decorators:
  • @property

interpretPath(self, path, pwd='.')

source code 

Tries to determine the path of the included file. The statement of $(find 'package') will be resolved.

Parameters:
  • path (str) - the sting which contains the included path
  • pwd (str) - current working path
Returns: str
if no leading os.sep is detected, the path set by setCurrentPath() will be prepend. $(find 'package') will be resolved. Otherwise the parameter itself will be returned

getIncludedFiles(self, file)

source code 

Reads the configuration file and searches for included files. This files will be returned in a list.

Returns: [str,...]
the list with all files needed for the configuration

load(self, argv)

source code 
Parameters:
  • argv ([str] @return True, if the launch file was loaded @rtype boolean) - the list with argv parameter needed to load the launch file. The name and value are separated by :=
Raises:

getArgs(self)

source code 
Returns: [str]
a list with args being used in the roslaunch file. Only arg tags that are a direct child of <launch> will be returned
Raises:
  • roslaunch.XmlParseException - on parse errors

getRobotDescr(self)

source code 

Parses the launch file for robots parameter to get the description of the robot.

Returns: dict(robot:dict('type' :str, 'name': str, 'images' : [str], 'description': str))
the robot description stored in the configuration

getCapabilitiesDesrc(self)

source code 

Parses the launch file for capabilities and capability_group parameter and creates dictionary for grouping the nodes.

Returns: dict(machine : dict(namespace: dict(group:dict('type' : str, 'images' : [str], 'description' : str, 'nodes' : [str]))))
the capabilities description stored in this configuration

getNode(self, name)

source code 

Returns a configuration node for a given node name.

Parameters:
  • name (str) - the name of the node.
Returns: roslaunch.Node or None
the configuration node stored in this configuration

Instance Variable Details

file_changed

a signal to inform the receiver about the changes on launch file or included file. Parameter: (changed file, launch file)
Value:
QtCore.Signal(str, str)