ClientBaseIndex Class

The ClientBaseIndex class provides a common ROS service abstraction. More...

Ros1 Package: ontologenius
Ros2 Package: ontopy
Inherited By: OntologyIndexClient

Methods

__init__(self, name)
integer nb(self)
resetNb(self)
setVerbose(self, verbose)
str[] call(self, action, param)
integer[] callIndexes(self, action, param)
str callStr(self, action, param)
integer callIndex(self, action, param)
bool callNR(self, action, param)
bool callBool(self, action, param)

Detailed Description

The ClientBaseIndex class provides an abstraction for any ROS services.

This class ensures a persistent connection with the service based on. The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.

At the difference of the usual ClientBase class, this one provides access to the interface based on indexes (integers) for better performances.

See also ClientBase.

Methods Documentation

__init__(self, name)

Constructs a ROS client linked to the service name(str).

nb(self)

Gives the total number (integer) of service calls from all ClientBaseIndex instances since the last reset.

resetNb(self)

Reset Call Counter for all instances of ClientBaseIndex.

setVerbose(self, verbose)

If verbose(bool) is set to True, the clients will post messages about the failure to call the services and about their restoration.

call(self, action, param)

Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the results (str[]).

If the service call fails, the function returns None

callIndexes(self, action, param)

Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the results (integer[]).

If the service call fails, the function returns None

callStr(self, action, param)

Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the first result (str).

If the service call fails, the function returns None

callIndex(self, action, param)

Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the first result (integer).

If the service call fails, the function returns None

callNR(self, action, param)

Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str).

If the service call fails, the function returns False

callBool(self, action, param)

Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str).

Returns False if the service call fails or the result code of the service is different from SUCCESS.