Merge branch 'dev' of https://git.science.uu.nl/ics/sp/2025/n25b/pepperplus-cb into feat/10-basic-gestures
This commit is contained in:
@@ -19,7 +19,9 @@ class RobotGestureAgent(BaseAgent):
|
||||
:ivar pubsocket: ZMQ PUB socket for sending commands to the Robot Interface.
|
||||
:ivar address: Address to bind/connect the PUB socket.
|
||||
:ivar bind: Whether to bind or connect the PUB socket.
|
||||
:ivar gesture_data: A list of strings for available gestures
|
||||
:ivar gesture_tags: A list of strings for available gesture tags
|
||||
:ivar gesture_basic: A list of strings for 10 basisc gestures
|
||||
:ivar gesture_single: A list of strings for all available gestures
|
||||
"""
|
||||
|
||||
subsocket: azmq.Socket
|
||||
@@ -98,15 +100,20 @@ class RobotGestureAgent(BaseAgent):
|
||||
"""
|
||||
try:
|
||||
gesture_command = GestureCommand.model_validate_json(msg.body)
|
||||
# if gesture_command.endpoint == RIEndpoint.GESTURE_TAG:
|
||||
# if gesture_command.data not in self.gesture_data:
|
||||
# self.logger.warning(
|
||||
# "Received gesture tag '%s' which is not in available tags.
|
||||
# Early returning",
|
||||
# gesture_command.data,
|
||||
# )
|
||||
# return
|
||||
|
||||
if gesture_command.endpoint == RIEndpoint.GESTURE_TAG:
|
||||
if gesture_command.data not in self.gesture_tags:
|
||||
self.logger.warning(
|
||||
"Received gesture tag '%s' which is not in available tags. Early returning",
|
||||
gesture_command.data,
|
||||
)
|
||||
return
|
||||
elif gesture_command.endpoint == RIEndpoint.GESTURE_SINGLE:
|
||||
if gesture_command.data not in self.gesture_single:
|
||||
self.logger.warning(
|
||||
"Received gesture '%s' which is not in available gestures. Early returning",
|
||||
gesture_command.data,
|
||||
)
|
||||
return
|
||||
await self.pubsocket.send_json(gesture_command.model_dump())
|
||||
except Exception:
|
||||
self.logger.exception("Error processing internal message.")
|
||||
|
||||
Reference in New Issue
Block a user