harmoni_common_lib.service_server

Module Contents

Classes

HarmoniServiceServer

The service server is responsible for exposing the functionality of the service

class harmoni_common_lib.service_server.HarmoniServiceServer(name, service_manager, premption_rate=10)

Bases: harmoni_common_lib.action_server.HarmoniActionServer, object

The service server is responsible for exposing the functionality of the service to clients. As a server it has a callback for when it recieves action requests from the clients. In this callback it uses the handle it has on the service to control the service according to the requests of the client.

ActionServer functions used include: publish_feedback set_succeeded get_preemption_status

start_sending_feedback(self, rate=0.2)
Provides feedback at a constant rate on the status of the server

FIXME: this is a blocking function, so it probably needs to be threaded.

Parameters

rate (float, optional) – Rate feedback on state is sent (hz). Defaults to .2.

send_result(self, do_action, message)

Send the result and action set to succeded

get_preemption_status(self)
_preempt_callback(self)

Used to signal a cancel/pause to the currently running service so that a new goal can be received.

_execute_goal_received_callback(self, goal)

Turns action goals into calls to the service manager. Is passed to the parent class to be used directly by the action server.

Parameters

goal (HarmoniAction) –