The Server Module¶
This module implements the Capability server.
The Capability server provides access to queries and services related to capabilities.
-
class
capabilities.server.
CapabilityInstance
(provider, provider_path, started_by='unknown')[source]¶ Encapsulates the state of an instance of a Capability Provider
This class encapsulates the state of the capability instance and provides methods for changing the states of the instance.
-
cancel
()[source]¶ Cancels the instance, which can only be done while it is still ‘waiting’
Fails to cancel if the current state is not ‘waiting’. “Canceling” is achieved by setting the canceled member variable to True.
Returns: True if canceling is successful, False otherwise Return type: bool
-
launch
()[source]¶ Change to the ‘launching’ state
Fails to transition if the current state is not ‘waiting’.
Returns: True if transition is successful, False otherwise Return type: bool
-
launched
(pid)[source]¶ Called once the instance is “launched”, changes state to ‘running’
Fails to transition if the current state is not ‘launching’. If successful, the state changes to ‘running’.
Parameters: pid (int) – process ID of the instance being tracked Returns: True if transition is successful, False otherwise Return type: bool
-
state
¶ Get the current state of the CapabilityInstance
-
-
class
capabilities.server.
CapabilityServer
(package_paths, screen=None)[source]¶ A class to expose the
discovery.SpecIndex
over a ROS API
-
capabilities.server.
get_reverse_depends
(name, capability_instances)[source]¶ Gets the reverse dependencies of a given Capability
Parameters: - name (str) – Name of the Capability which the instances might depend on
- capability_instances (
list
ofCapabilityInstance
) – list of instances to search for having a dependency on the given Capability
Returns: A list of
CapabilityInstance
‘s which depend on the given Capability nameReturn type: