class documentation

Runs a roslaunch. The normal sequence of API calls is L{launch()} followed by L{spin()}. An external thread can call L{stop()}; otherwise the runner will block until an exit signal. Another usage is to call L{launch()} followed by repeated calls to L{spin_once()}. This usage allows the main thread to continue to do work while processes are monitored.

Method __init__ running, this value will be used to initialize /run_id. If the core is already running, this value will be checked against the value stored on the core. L{ROSLaunchRunner} will fail during L{launch()} if they do not match.
Method add_process_listener Add listener to list of listeners. Not threadsafe. Must be called before processes started. @param l: listener @type l: L{ProcessListener}
Method is_node_running Check for running node process. @param node Node: node object to check @return bool: True if process associated with node is running (launched && !dead)
Method launch Run the launch. Depending on usage, caller should call spin_once or spin as appropriate after launch(). @return ([str], [str]): tuple containing list of nodes that
Method launch_node Launch a single node locally. Remote launching is handled separately by the remote module. If node name is not assigned, one will be created for it.
Method run_test Run the test node. Blocks until completion or timeout. @param test: test node to run @type test: Test @raise RLTestTimeoutException: if test fails to launch or test times out
Method spin spin() must be run from the main thread. spin() is very important for roslaunch as it picks up jobs that the process monitor need to be run in the main thread.
Method spin_once Same as spin() but only does one cycle. must be run from the main thread.
Method stop Stop the launch and all associated processes. not thread-safe.
Instance Variable config Undocumented
Instance Variable is_child Undocumented
Instance Variable is_core Undocumented
Instance Variable is_rostest Undocumented
Instance Variable listeners Undocumented
Instance Variable logger Undocumented
Instance Variable master_logger_level Undocumented
Instance Variable num_workers Undocumented
Instance Variable pm Undocumented
Instance Variable remote_runner Undocumented
Instance Variable run_id Undocumented
Instance Variable server_uri Undocumented
Instance Variable sigint_timeout Undocumented
Instance Variable sigterm_timeout Undocumented
Instance Variable timeout Undocumented
Method _check_and_set_run_id Initialize self.run_id to existing value or setup parameter server with /run_id set to default_run_id @param default_run_id: run_id to use if value is not set @type default_run_id: str @param param_server: parameter server proxy @type param_server: xmlrpclib...
Method _launch_core_nodes launch any core services that are not already running. master must be already running @raise RLException: if core launches fail
Method _launch_executable Launch a single L{Executable} object. Blocks until executable finishes. @param e: Executable @type e: L{Executable} @raise RLException: if executable fails. Failure includes non-zero exit code.
Method _launch_master Launches master if requested. @return: True if a master was launched, False if a master was already running. @rtype: bool @raise RLException: if master launch fails
Method _launch_nodes Launch all the declared nodes/master @return: two lists of node names where the first is the nodes that successfully launched and the second is the nodes that failed to launch. @rtype: [[str], [str]]
Method _launch_setup_executables @raise RLException: if executable fails. Failure includes non-zero exit code.
Method _load_parameters Load parameters onto the parameter server
Method _setup Setup the state of the ROS network, including the parameter server state and core services
def __init__(self, run_id, config, server_uri=None, pmon=None, is_core=False, remote_runner=None, is_child=False, is_rostest=False, num_workers=NUM_WORKERS, timeout=None, master_logger_level=False, sigint_timeout=DEFAULT_TIMEOUT_SIGINT, sigterm_timeout=DEFAULT_TIMEOUT_SIGTERM):

@param run_id: /run_id for this launch. If the core is not
running, this value will be used to initialize /run_id. If the core is already running, this value will be checked against the value stored on the core. L{ROSLaunchRunner} will fail during L{launch()} if they do not match.

@type run_id: str @param config: roslauch instance to run @type config: L{ROSLaunchConfig} @param server_uri: XML-RPC URI of roslaunch server. @type server_uri: str @param pmon: optionally override the process

monitor the runner uses for starting and tracking processes

@type pmon: L{ProcessMonitor}

@param is_core: if True, this runner is a roscore
instance. This affects the error behavior if a master is already running -- aborts if is_core is True and a core is detected.

@type is_core: bool @param remote_runner: remote roslaunch process runner @param is_rostest: if True, this runner is a rostest

instance. This affects certain validation checks.

@type is_rostest: bool @param num_workers: If this is the core, the number of worker-threads to use. @type num_workers: int @param timeout: If this is the core, the socket-timeout to use. @type timeout: Float or None @param master_logger_level: Specify roscore's rosmaster.master logger level, use default if it is False. @type master_logger_level: str or False @param sigint_timeout: The SIGINT timeout used when killing nodes (in seconds). @type sigint_timeout: float @param sigterm_timeout: The SIGTERM timeout used when killing nodes if SIGINT does not stop the node (in seconds). @type sigterm_timeout: float @raise RLException: If sigint_timeout or sigterm_timeout are nonpositive.

def add_process_listener(self, l):

Add listener to list of listeners. Not threadsafe. Must be called before processes started. @param l: listener @type l: L{ProcessListener}

def is_node_running(self, node):

Check for running node process. @param node Node: node object to check @return bool: True if process associated with node is running (launched && !dead)

def launch(self):

Run the launch. Depending on usage, caller should call spin_once or spin as appropriate after launch(). @return ([str], [str]): tuple containing list of nodes that

successfully launches and list of nodes that failed to launch

@rtype: ([str], [str]) @raise RLException: if launch fails (e.g. run_id parameter does not match ID on parameter server)

def launch_node(self, node, core=False):

Launch a single node locally. Remote launching is handled separately by the remote module. If node name is not assigned, one will be created for it.

@param node Node: node to launch @param core bool: if True, core node @return obj, bool: Process handle, successful launch. If success, return actual Process instance. Otherwise return name.

def run_test(self, test):

Run the test node. Blocks until completion or timeout. @param test: test node to run @type test: Test @raise RLTestTimeoutException: if test fails to launch or test times out

def spin(self):

spin() must be run from the main thread. spin() is very important for roslaunch as it picks up jobs that the process monitor need to be run in the main thread.

def spin_once(self):

Same as spin() but only does one cycle. must be run from the main thread.

def stop(self):

Stop the launch and all associated processes. not thread-safe.

config =

Undocumented

is_child =

Undocumented

is_core =

Undocumented

is_rostest =

Undocumented

listeners =

Undocumented

logger =

Undocumented

master_logger_level =

Undocumented

num_workers =

Undocumented

pm =

Undocumented

remote_runner =

Undocumented

run_id =

Undocumented

server_uri =

Undocumented

sigint_timeout =

Undocumented

sigterm_timeout =

Undocumented

timeout =

Undocumented

def _check_and_set_run_id(self, param_server, run_id):

Initialize self.run_id to existing value or setup parameter server with /run_id set to default_run_id @param default_run_id: run_id to use if value is not set @type default_run_id: str @param param_server: parameter server proxy @type param_server: xmlrpclib.ServerProxy

def _launch_core_nodes(self):

launch any core services that are not already running. master must be already running @raise RLException: if core launches fail

def _launch_executable(self, e):

Launch a single L{Executable} object. Blocks until executable finishes. @param e: Executable @type e: L{Executable} @raise RLException: if executable fails. Failure includes non-zero exit code.

def _launch_master(self):

Launches master if requested. @return: True if a master was launched, False if a master was already running. @rtype: bool @raise RLException: if master launch fails

def _launch_nodes(self):

Launch all the declared nodes/master @return: two lists of node names where the first is the nodes that successfully launched and the second is the nodes that failed to launch. @rtype: [[str], [str]]

def _launch_setup_executables(self):

@raise RLException: if executable fails. Failure includes non-zero exit code.

def _load_parameters(self):

Load parameters onto the parameter server

def _setup(self):

Setup the state of the ROS network, including the parameter server state and core services