ClientBaseIndex Class

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

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

Methods

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).

integernb(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.

str[]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

integer[]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

strcallStr(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

integercallIndex(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

boolcallNR(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

boolcallBool(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.