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

Class LaunchConfig

source code

python_qt_binding.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
str
masteruri(self)
Returns the master URI (host) where the node of this config will be started.
source code
roslaunch.ROSLaunchConfig or None @see load()
Roscfg(self)
Holds 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
boolean
load(self, argv)
Returns: True, if the launch file was loaded
source code
 
resolveArgs(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
 
get_robot_icon(self)
Returns the value of the `/robot_icon` parameter or None
source code
Class Methods
str
interpretPath(cls, path, pwd='.')
Tries to determine the path of the included file.
source code
 
included_files(cls, text_or_path, regexp_retruns=[], regexp_filelist=[QRegExp("\\btextfile\\b"),QRegExp("\\bfile\\b"),QRegExp("\\bd..., recursive=True, unique=True)
:param regexp_retruns: the list with patterns which are returned as result.
source code
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.

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 

Holds a loaded launch configuration. It raises a LaunchConfigException on load error.

Returns: roslaunch.ROSLaunchConfig or None @see load()
Decorators:
  • @property

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(cls, path, pwd='.')
Class Method

source code 

Tries to determine the path of the included file. The statement of $(find 'package') will be resolved. The supported URL begins with `file:///`, `package://` or `pkg://`. The package URL will be resolved to a valid file path. If the file is in a subdirectory, you can replace the subdirectory by `///`.

Parameters:
  • path (str) - the sting which contains the included path
  • pwd (str) - current working path
Returns: str
$(find 'package') will be resolved. The prefixes `file:///`, `package://` or `pkg://` are also resolved. Otherwise the parameter itself will be returned.

included_files(cls, text_or_path, regexp_retruns=[], regexp_filelist=[QRegExp("\\btextfile\\b"),QRegExp("\\bfile\\b"),QRegExp("\\bd..., recursive=True, unique=True)
Class Method

source code 

:param regexp_retruns: the list with patterns which are returned as result. If empy it's the same as 'regexp_filelist' :param regexp_filelist: the list with all patterns to find include files

load(self, argv)

source code 
Parameters:
  • argv ([str]) - the list with argv parameter needed to load the launch file. The name and value are separated by :=
Returns: boolean
True, if the launch file was loaded
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