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
 
killall_roscore(self, host, auto_pw_request=False, user=None, pw=None)
Kills all roscore processes on given host.
source code
 
poweroff(self, host, auto_pw_request=False, user=None, pw=None)
poweroff given host.
source code
 
rosclean(self, host, auto_pw_request=False, user=None, pw=None)
rosclean purge 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, runcfg)
Start the node with given name from the given configuration.
source code
 
runNodeWithoutConfig(cls, host, package, binary, 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
 
get_log_path(cls, host, nodes=[], auto_pw_request=False, user=None, pw=None) source code
bool
openLog(cls, nodename, host, user=None, only_screen=False)
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, path, auto_pw_request=False, user=None, pw=None)
Copies the given file to the remote host.
source code
bool
ntpdate(cls, host, cmd, user=None, pw=None)
Opens the log file associated with the given node in a new terminal.
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, runcfg)
Class Method

source code 

Start the node with given name from the given configuration.

Parameters:
  • runcfg (AdvRunCfg) - the configuration containing the start parameter
Raises:
  • StartException - if the screen is not available on host.
  • Exception - on errors while resolving host

runNodeWithoutConfig(cls, host, package, binary, 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
  • binary (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
  • service_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:
Returns: dict(param:value, ...)
the list with names of the global parameter

openLog(cls, nodename, host, user=None, only_screen=False)
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

killall_roscore(self, host, auto_pw_request=False, user=None, pw=None)

source code 

Kills all roscore processes on given host.

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

poweroff(self, host, auto_pw_request=False, user=None, pw=None)

source code 

poweroff given host.

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

rosclean(self, host, auto_pw_request=False, user=None, pw=None)

source code 

rosclean purge on given host.

Parameters:
  • host (str) - the name or address of the host, where rosclean is called.
Raises:
  • StartException - on error
  • Exception - on errors while resolving host

transfer_files(cls, host, path, 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.

ntpdate(cls, host, cmd, user=None, pw=None)
Class Method

source code 

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

Parameters:
  • host (str) - the host name or ip where the log file are
  • cmd (str) - command to set the time
Returns: bool
True, if a log file was found
Raises:
  • Exception - on errors while resolving host