Package master_discovery_fkie :: Module master_info :: Class ServiceInfo
[frames] | no frames]

Class ServiceInfo

source code

object --+
         |
        ServiceInfo

The ServiceInfo class stores informations about a ROS service.

Instance Methods
 
__init__(self, name, masteruri)
Creates a new instance of the ServiceInfo.
source code
ServiceDefinition: service class
get_service_class(self, allow_get_type=False)
Get the service class using the type of the service.
source code

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

Instance Variables
  type
the type of the service.
Properties
str name
Returns the name of the service.
str uri
Returns the URI of the RPC API of the service
str masteruri
Returns the URI of the ROS master of the service
boolean isLocal
Returns True, if this service and the master are on the same machine.
[str, ...] serviceProvider
Return the list of the node names, which provide this service.

Inherited from object: __class__

Method Details

__init__(self, name, masteruri)
(Constructor)

source code 

Creates a new instance of the ServiceInfo.

Parameters:
  • name (str) - the name of the service
  • masteruri (str) - the URI of the ROS master, where the service is registered. This masteruri will be used to determine, whether the ROS master and the service are running on the same machine.
Overrides: object.__init__

get_service_class(self, allow_get_type=False)

source code 

Get the service class using the type of the service. NOTE: this method is from 'rosservice' and changed to avoid a probe call to the service.

Parameters:
  • allow_get_type (boolean) - allow to connect to service and get the type if the type is not valid (in case of other host e.g.)
Returns: ServiceDefinition: service class
service class
Raises:
  • ROSServiceException - if service class cannot be retrieved

Instance Variable Details

type

the type of the service. (Default: None)

Property Details

name

Returns the name of the service.

Get Method:
unreachable.name(self) - Returns the name of the service.
Type:
str

uri

Returns the URI of the RPC API of the service

Get Method:
unreachable.uri(self) - Returns the URI of the RPC API of the service
Set Method:
unreachable.uri(self, uri) - Sets the uri of the service RPC interface and determine whether this service and the ROS master are running on the same machine.
Type:
str

masteruri

Returns the URI of the ROS master of the service

Get Method:
unreachable.masteruri(self) - Returns the URI of the ROS master of the service
Set Method:
unreachable.masteruri(self, uri) - Sets the uri of the origin ROS master and determine whether this service and the ROS master are running on the same machine.
Type:
str

isLocal

Returns True, if this service and the master are on the same machine. This will be determine on setting the uri-parameter.

Get Method:
unreachable.isLocal(self) - Returns True, if this service and the master are on the same machine.
Type:
boolean

serviceProvider

Return the list of the node names, which provide this service.

Get Method:
unreachable.serviceProvider(self) - Return the list of the node names, which provide this service.
Set Method:
unreachable.serviceProvider(self, name) - Adds a new service provider, if no one with given name exists.
Delete Method:
unreachable.serviceProvider(self)
Type:
[str, ...]