feat: add tests and better model validation for gesture commands
ref: N25B-334
This commit is contained in:
@@ -86,8 +86,8 @@ class RobotGestureAgent(BaseAgent):
|
||||
:param msg: The internal message containing the command.
|
||||
"""
|
||||
try:
|
||||
speech_command = GestureCommand.model_validate_json(msg.body)
|
||||
await self.pubsocket.send_json(speech_command.model_dump())
|
||||
gesture_command = GestureCommand.model_validate_json(msg.body)
|
||||
await self.pubsocket.send_json(gesture_command.model_dump())
|
||||
except Exception:
|
||||
self.logger.exception("Error processing internal message.")
|
||||
|
||||
@@ -107,3 +107,129 @@ class RobotGestureAgent(BaseAgent):
|
||||
await self.pubsocket.send_json(message.model_dump())
|
||||
except Exception:
|
||||
self.logger.exception("Error processing ZMQ message.")
|
||||
|
||||
def availableTags(self):
|
||||
"""
|
||||
Returns the available gesture tags.
|
||||
|
||||
:return: List of available gesture tags.
|
||||
"""
|
||||
return [
|
||||
"above",
|
||||
"affirmative",
|
||||
"afford",
|
||||
"agitated",
|
||||
"all",
|
||||
"allright",
|
||||
"alright",
|
||||
"any",
|
||||
"assuage",
|
||||
"assuage",
|
||||
"attemper",
|
||||
"back",
|
||||
"bashful",
|
||||
"beg",
|
||||
"beseech",
|
||||
"blank",
|
||||
"body language",
|
||||
"bored",
|
||||
"bow",
|
||||
"but",
|
||||
"call",
|
||||
"calm",
|
||||
"choose",
|
||||
"choice",
|
||||
"cloud",
|
||||
"cogitate",
|
||||
"cool",
|
||||
"crazy",
|
||||
"disappointed",
|
||||
"down",
|
||||
"earth",
|
||||
"empty",
|
||||
"embarrassed",
|
||||
"enthusiastic",
|
||||
"entire",
|
||||
"estimate",
|
||||
"except",
|
||||
"exalted",
|
||||
"excited",
|
||||
"explain",
|
||||
"far",
|
||||
"field",
|
||||
"floor",
|
||||
"forlorn",
|
||||
"friendly",
|
||||
"front",
|
||||
"frustrated",
|
||||
"gentle",
|
||||
"gift",
|
||||
"give",
|
||||
"ground",
|
||||
"happy",
|
||||
"hello",
|
||||
"her",
|
||||
"here",
|
||||
"hey",
|
||||
"hi",
|
||||
"him",
|
||||
"hopeless",
|
||||
"hysterical",
|
||||
"I",
|
||||
"implore",
|
||||
"indicate",
|
||||
"joyful",
|
||||
"me",
|
||||
"meditate",
|
||||
"modest",
|
||||
"negative",
|
||||
"nervous",
|
||||
"no",
|
||||
"not know",
|
||||
"nothing",
|
||||
"offer",
|
||||
"ok",
|
||||
"once upon a time",
|
||||
"oppose",
|
||||
"or",
|
||||
"pacify",
|
||||
"pick",
|
||||
"placate",
|
||||
"please",
|
||||
"present",
|
||||
"proffer",
|
||||
"quiet",
|
||||
"reason",
|
||||
"refute",
|
||||
"reject",
|
||||
"rousing",
|
||||
"sad",
|
||||
"select",
|
||||
"shamefaced",
|
||||
"show",
|
||||
"show sky",
|
||||
"sky",
|
||||
"soothe",
|
||||
"sun",
|
||||
"supplicate",
|
||||
"tablet",
|
||||
"tall",
|
||||
"them",
|
||||
"there",
|
||||
"think",
|
||||
"timid",
|
||||
"top",
|
||||
"unless",
|
||||
"up",
|
||||
"upstairs",
|
||||
"void",
|
||||
"warm",
|
||||
"winner",
|
||||
"yeah",
|
||||
"yes",
|
||||
"yoo-hoo",
|
||||
"you",
|
||||
"your",
|
||||
"zero",
|
||||
"zestful",
|
||||
]
|
||||
|
||||
@@ -193,6 +193,7 @@ class RICommunicationAgent(BaseAgent):
|
||||
gesture_data=gesture_data,
|
||||
)
|
||||
await robot_speech_agent.start()
|
||||
await asyncio.sleep(0.1) # Small delay
|
||||
await robot_gesture_agent.start()
|
||||
case _:
|
||||
self.logger.warning("Unhandled negotiation id: %s", id)
|
||||
|
||||
Reference in New Issue
Block a user