harmoni_common_lib.service_manager¶
Module Contents¶
Classes¶
The HarmoniService class implements a template class for interfacing between |
- class harmoni_common_lib.service_manager.HarmoniServiceManager(name)¶
Bases:
objectThe HarmoniService class implements a template class for interfacing between a service server and the actual implementation of the logic and functionality of a given node, also known as a Harmoni_Unit.
Children of the service should overwrite the functionality of the parent functions with their own logic and functionality. Not all children should overwrite all functions as it wouldn’t make sense for a microphone node to ‘do’ anything.
- test(self)¶
Tests the setup has successfully completed and the unit is ready to be used
- request(self, rate)¶
Make a request of another service, such as a web service
When request returns it should return the result of the request and set status
- Raises
NotImplementedError – To be used, this function should be overwritten by the child class.
- do(self, data)¶
Will start a atomic action. This could be executing a movement or speech For long actions use do()
When do returns the status should be set to succeeded or failed
- Raises
NotImplementedError – To be used, this function should be overwritten by the child class.
- start(self)¶
Will start a long running action. This could be reading hardware and publishing it to a topic or running a behavior pattern. For atomic actions use do()
Start actions can be long running or indefinate.
- Raises
NotImplementedError – To be used, this function should be overwritten by the child class.
- pause(self)¶
Will interrupt the long running action, preventing it from continuing until start is called again.
- Raises
NotImplementedError – To be used, this function should be overwritten by the child class.
- stop(self)¶
Will interrupt the long running action
- Raises
NotImplementedError – To be used, this function should be overwritten by the child class.
- reset_init(self)¶
Resets variables such that if start is called will start from beginning
- Raises
NotImplementedError – To be used, this function should be overwritten by the child class.