Package roshlaunch :: Module core
[frames] | no frames]

Module core

source code

Core roslaunch model and lower-level utility routines.

Classes
  RLException
Base roslaunch exception type
  Master
Data structure for representing and querying state of master
  Machine
Data structure for storing information about a machine in the ROS system.
  Param
Data structure for storing information about a desired parameter in the ROS system Corresponds to the 'param' tag in the launch specification.
  Node
Data structure for storing information about a desired node in the ROS system Corresponds to the 'node' tag in the launch specification.
  Test
A Test is a Node with special semantics that it performs a unit/integration test.
  Executable
Executable is a generic container for exectuable commands.
  RosbinExecutable
RosbinExecutables are exectuables stored in ROS_ROOT/bin.
Functions
bool
is_child_mode()
Returns: True if roslaunch is running in remote child mode
source code
 
set_child_mode(child_mode) source code
bool
is_machine_local(machine)
Check to see if machine is local.
source code
 
printlog(msg)
Core utility for printing message to stdout as well as printlog handlers
source code
 
printlog_bold(msg)
Similar to printlog(), but the message printed to screen is bolded for greater clarity
source code
 
printerrlog(msg)
Core utility for printing message to stderr as well as printerrlog handlers
source code
 
add_printlog_handler(h)
Register additional handler for printlog()
source code
 
add_printerrlog_handler(h)
Register additional handler for printerrlog()
source code
 
clear_printlog_handlers()
Delete all printlog handlers.
source code
 
clear_printerrlog_handlers()
Delete all printerrlog handlers.
source code
dict
setup_env(node, machine, master_uri)
Create dictionary of environment variables to set for launched process.
source code
fn
rle_wrapper(fn)
Wrap lower-level exceptions in RLException class
source code
str
get_ros_package_path()
Returns: ROS_PACKAGE_PATH value
source code
 
remap_localhost_uri(uri, force_localhost=False)
Resolve localhost addresses to an IP address so that
source code
Machine
local_machine()
Returns: Machine instance representing the local machine
source code
str
generate_run_id()
Utility routine for generating run IDs (UUIDs)
source code
Variables
  PHASE_SETUP = 'setup'
  PHASE_RUN = 'run'
  PHASE_TEARDOWN = 'teardown'
  get_ros_root = rle_wrapper(roslib.rosenv.get_ros_root)
  get_master_uri_env = rle_wrapper(roslib.rosenv.get_master_uri)
  TEST_TIME_LIMIT_DEFAULT = 1* 60
Function Details

is_child_mode()

source code 
Returns: bool
True if roslaunch is running in remote child mode

set_child_mode(child_mode)

source code 
Parameters:
  • child_mode (bool) - True if roslaunch is running in remote child mode

is_machine_local(machine)

source code 

Check to see if machine is local. NOTE: a machine is not local if its user credentials do not match the current user.

Parameters:
Returns: bool
True if machine is local and doesn't require remote login

printlog(msg)

source code 

Core utility for printing message to stdout as well as printlog handlers

Parameters:
  • msg (str) - message to print

printlog_bold(msg)

source code 

Similar to printlog(), but the message printed to screen is bolded for greater clarity

Parameters:
  • msg (str) - message to print

printerrlog(msg)

source code 

Core utility for printing message to stderr as well as printerrlog handlers

Parameters:
  • msg (str) - message to print

clear_printlog_handlers()

source code 

Delete all printlog handlers. required for testing

clear_printerrlog_handlers()

source code 

Delete all printerrlog handlers. required for testing

setup_env(node, machine, master_uri)

source code 

Create dictionary of environment variables to set for launched process.

setup_env() will only set ROS_*, PYTHONPATH, and user-specified environment variables.

Parameters:
  • machine (Machine), Machine - machine being launched on
  • node (Node) - node that is being launched or None
  • master_uri (str) - ROS master URI
Returns: dict
process env dictionary

rle_wrapper(fn)

source code 

Wrap lower-level exceptions in RLException class

Returns: fn
function wrapper that throws an RLException if the wrapped function throws an Exception

get_ros_package_path()

source code 
Returns: str
ROS_PACKAGE_PATH value

remap_localhost_uri(uri, force_localhost=False)

source code 

Resolve localhost addresses to an IP address so that

Parameters:
  • uri (str) - XML-RPC URI
  • force_localhost (bool) - if True, URI is mapped onto the local machine no matter what

local_machine()

source code 
Returns: Machine
Machine instance representing the local machine

generate_run_id()

source code 

Utility routine for generating run IDs (UUIDs)

Returns: str
guid