play_interaction()
  • 1 Minute to read

play_interaction()


Article summary

Play a predefined interaction in the robot

Arguments

ArgumentsType
interaction_namestrName of the predefined interaction.
callback_feedbackcallableCallback synchronous method.
callback_feedback_asynccallableCallback asynchronous method.
callback_finishcallableCallback synchronous finish method.
callback_finish_asynccallableCallback asynchronous finish method.
waitboolWait until the end of the interaction before mooving to the next line of code. Default value is False.

Return

None

Exceptions

  • RayaInteractionsWrongName
  • RayaInteractionsAlreadyRunning

See the complete interactions exceptions.

Usage example

from raya.application_base import RayaApplicationBase

class RayaApplication(RayaApplicationBase):
    async def setup(self):
        self.interactions = await self.enable_controller('interactions')

    async def loop(self):
        self.interactions.play_predefined_interaction(interaction_name = 'task_received')
        self.finish_app()

    async def finish(self):
        self.log.info(f'Hello from finish()')

Was this article helpful?

What's Next