Package node_manager_fkie :: Module start_handler :: Class StartHandler
[frames] | no frames]

Class StartHandler

source code

object --+
         |
        StartHandler

This class contains the methods to run the nodes on local and remote machines in a screen terminal.

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
(request object, response object)
callService(self, service_uri, service, service_type, service_args=[])
Calls the service and return the response.
source code
 
kill(self, host, pid, auto_pw_request=False, user=None, pw=None)
Kills the process with given process id on given host.
source code

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

Class Methods
 
runNode(cls, node, launch_config, force2host=None, masteruri=None, auto_pw_request=False, user=None, pw=None, item=None)
Start the node with given name from the given configuration.
source code
 
runNodeWithoutConfig(cls, host, package, type, name, args=[], masteruri=None, auto_pw_request=False, user=None, pw=None)
Start a node with using a launch configuration.
source code
dict(param:value, ...)
getGlobalParams(cls, roscfg)
Return the parameter of the configuration file, which are not associated with any nodes in the configuration.
source code
 
copylogPath2Clipboards(cls, host, nodes=[], auto_pw_request=False, user=None, pw=None) source code
bool
openLog(cls, nodename, host, user=None)
Opens the log file associated with the given node in a new terminal.
source code
 
deleteLog(cls, nodename, host, auto_pw_request=False, user=None, pw=None)
Deletes the log file associated with the given node.
source code
 
transfer_files(cls, host, file, auto_pw_request=False, user=None, pw=None)
Copies the given file to the remote host.
source code
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

runNode(cls, node, launch_config, force2host=None, masteruri=None, auto_pw_request=False, user=None, pw=None, item=None)
Class Method

source code 

Start the node with given name from the given configuration.

Parameters:
  • node (str) - the name of the node (with name space)
  • launch_config (LaunchConfig) - the configuration containing the node
  • force2host (str) - start the node on given host.
  • masteruri (str) - force the masteruri.
  • auto_pw_request (bool) - opens question dialog directly, use True only if the method is called from the main GUI thread
Raises:
  • StartException - if the screen is not available on host.
  • Exception - on errors while resolving host

runNodeWithoutConfig(cls, host, package, type, name, args=[], masteruri=None, auto_pw_request=False, user=None, pw=None)
Class Method

source code 

Start a node with using a launch configuration.

Parameters:
  • host (str) - the host or ip to run the node
  • package (str) - the ROS package containing the binary
  • type (str) - the binary of the node to execute
  • name (str) - the ROS name of the node (with name space)
  • args ([str, ...]) - the list with arguments passed to the binary
  • auto_pw_request (bool) - opens question dialog directly, use True only if the method is called from the main GUI thread
Raises:
  • Exception - on errors while resolving host

callService(self, service_uri, service, service_type, service_args=[])

source code 

Calls the service and return the response. To call the service the ServiceProxy can't be used, because it uses environment variables to determine the URI of the running service. In our case this service can be running using another ROS master. The changes on the environment variables is not thread safe. So the source code of the rospy.SerivceProxy (tcpros_service.py) was modified.

Parameters:
  • service_uri (str) - the URI of the service
  • service (str) - full service name (with name space)
  • service_type (ServiceDefinition: service class) - service class
  • args - arguments
Returns: (request object, response object)
the tuple of request and response.
Raises:

See Also: rospy.SerivceProxy

getGlobalParams(cls, roscfg)
Class Method

source code 

Return the parameter of the configuration file, which are not associated with any nodes in the configuration.

Parameters:
  • roscfg (roslaunch.ROSLaunchConfig) - the launch configuration
Returns: dict(param:value, ...)
the list with names of the global parameter

openLog(cls, nodename, host, user=None)
Class Method

source code 

Opens the log file associated with the given node in a new terminal.

Parameters:
  • nodename (str) - the name of the node (with name space)
  • host (str) - the host name or ip where the log file are
Returns: bool
True, if a log file was found
Raises:
  • Exception - on errors while resolving host

deleteLog(cls, nodename, host, auto_pw_request=False, user=None, pw=None)
Class Method

source code 

Deletes the log file associated with the given node.

Parameters:
  • nodename (str) - the name of the node (with name space)
  • host (str) - the host name or ip where the log file are to delete
Raises:
  • Exception - on errors while resolving host

kill(self, host, pid, auto_pw_request=False, user=None, pw=None)

source code 

Kills the process with given process id on given host.

Parameters:
  • host (str) - the name or address of the host, where the process must be killed.
  • pid (int) - the process id
Raises:
  • StartException - on error
  • Exception - on errors while resolving host

transfer_files(cls, host, file, auto_pw_request=False, user=None, pw=None)
Class Method

source code 

Copies the given file to the remote host. Uses caching of remote paths.