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

Class LaunchConfig

source code

       object --+            
                |            
sip.simplewrapper --+        
                    |        
          sip.wrapper --+    
                        |    
     PyQt4.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
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

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __new__

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

Class Methods
str
interpretPath(cls, path, pwd='.')
Tries to determine the path of the included file.
source code
[str,...]
getIncludedFiles(cls, inc_file, regexp_list=[PyQt4.QtCore.QRegExp(u'\\binclude\\b'), PyQt4.QtCore.QRegExp(...)
Reads the configuration file and searches for included files.
source code
Class Variables

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties
str masteruri
Returns the master URI (host) where the node of this config will be started.
roslaunch.ROSLaunchConfig or None @see load() Roscfg
Holds a loaded launch configuration.
str Filename
Returns an existing path with file name or an empty string.
str LaunchName
Returns the name of the launch file with extension, e.g.
str or None PackageName
Returns the name of the package containing the launch file or None.

Inherited from object: __class__

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.
Overrides: object.__init__

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.

getIncludedFiles(cls, inc_file, regexp_list=[PyQt4.QtCore.QRegExp(u'\\binclude\\b'), PyQt4.QtCore.QRegExp(...)
Class Method

source code 

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

Parameters:
  • inc_file - path of the ROS launch file
  • regexp_list - pattern of
Returns: [str,...]
the list with all files needed for the configuration

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

Property Details

masteruri

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

Get Method:
unreachable.masteruri(self) - Returns the master URI (host) where the node of this config will be started.
Type:
str

Roscfg

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

Get Method:
unreachable.Roscfg(self) - Holds a loaded launch configuration.
Type:
roslaunch.ROSLaunchConfig or None @see load()

Filename

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

Get Method:
unreachable.Filename(self) - Returns an existing path with file name or an empty string.
Type:
str

LaunchName

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

Get Method:
unreachable.LaunchName(self) - Returns the name of the launch file with extension, e.g.
Type:
str

PackageName

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

Get Method:
unreachable.PackageName(self) - Returns the name of the package containing the launch file or None.
Type:
str or None