Table Of Contents

Previous topic

Parallel Utilities for ROS

Next topic

Programs

This Page

parallel_util Modules

workmanager Module

Managers multiple processors running on the ROS network completing a task.

The manager takes in a module that provides and processes the work items, it is oblivious of the ROS network. The module needs to provide the following functions:

# service side
def service_start(args):

# service side
def service_processrequest(request):

# server side
def server_processresponse(response):

# server side
def server_requestwork():

# server side
def server_start(args):

# server side
def server_end():

# launcher initialization
def launcher_start(args):

There are 3 modes when launching the worker: initial launch setup, server manager, service runner.

class parallel_util.workmanager.EvaluationServer(module, servicenames, numbatchjobs=1)

Bases: object

QueryServiceInfo(req)
processResult(responses)
run()
setservices(servicenames)
shutdownservices()
class parallel_util.workmanager.EvaluationServerThread(service, finishcb)

Bases: threading.Thread

run()
parallel_util.workmanager.LaunchNodes(module, serviceaddrs=[('localhost', '')], rosnamespace=None, args='', numbatchjobs=1, log_level='info', programname=None, feedbackfn=None, rosuser=None)

feedbackfn is called once in a while inside the loop. If it returns True, then will shutdown the roslaunch process

parallel_util.workmanager.StartService(module, args)

cpuinfo Module

class parallel_util.cpuinfo.CPUInfoClient

wrapper class of collect_cpuinfo for threading.Thread

get_result()
exception parallel_util.cpuinfo.ROSNotInstalled

Bases: exceptions.Exception

parallel_util.cpuinfo.collect_cpuinfo(host, ros_port, user_test_commands, verbose, timeout, username, ros_filter)
parallel_util.cpuinfo.cpuinfos(hosts=[], from_cssh_file=None, cssh_group=None, timeout=None, ros_port=11311, verbose=False, ros_filter=True, arch_filter=True, user_test_commands=[], username=None)

cpuinfos returns the hosts and the information of cpu and memory. it also check if a port is available for roscore or not.

cpuinfos returns the tuple of (dict, boolean).

boolean indicates if the port specified by ros_port is available for roscore or not.

the keys of dict is hostname and the values of it is the list of the number of cpu, the total size of memory and the string of architecture.

TODO: user_test_commands is not supported yet.

parallel_util.cpuinfo.parse_cssh_config(config_file, group)
parallel_util.cpuinfo.split_host_user(host)

roslaunch_caller Module

class parallel_util.roslaunch_caller.ScriptRoslaunch(launch_str, process_listener=None)

Bases: roslaunch.parent.ROSLaunchParent

parallel_util.roslaunch_caller.launch_core()