feat: added pause functionality

Storms code wasnt fully included in Bjorns branch

ref: N25B-400
This commit is contained in:
Pim Hutting
2026-01-13 00:52:04 +01:00
parent 72c2c57f26
commit d499111ea4
2 changed files with 8 additions and 10 deletions

View File

@@ -3,12 +3,14 @@ import json
import zmq import zmq
import zmq.asyncio as azmq import zmq.asyncio as azmq
from pydantic import ValidationError
from zmq.asyncio import Context from zmq.asyncio import Context
from control_backend.agents import BaseAgent from control_backend.agents import BaseAgent
from control_backend.agents.actuation.robot_gesture_agent import RobotGestureAgent from control_backend.agents.actuation.robot_gesture_agent import RobotGestureAgent
from control_backend.core.config import settings from control_backend.core.config import settings
from control_backend.schemas.internal_message import InternalMessage from control_backend.schemas.internal_message import InternalMessage
from control_backend.schemas.ri_message import PauseCommand
from ..actuation.robot_speech_agent import RobotSpeechAgent from ..actuation.robot_speech_agent import RobotSpeechAgent
from ..perception import VADAgent from ..perception import VADAgent
@@ -320,12 +322,9 @@ class RICommunicationAgent(BaseAgent):
self.connected = True self.connected = True
async def handle_message(self, msg: InternalMessage): async def handle_message(self, msg: InternalMessage):
""" try:
Handle an incoming message. pause_command = PauseCommand.model_validate_json(msg.body)
self._req_socket.send_json(pause_command.model_dump())
Currently not implemented for this agent. self.logger.debug(self._req_socket.recv_json())
except ValidationError:
:param msg: The received message. self.logger.warning("Incorrect message format for PauseCommand.")
:raises NotImplementedError: Always, since this method is not implemented.
"""
self.logger.warning("custom warning for handle msg in ri coms %s", self.name)

View File

@@ -179,7 +179,6 @@ class UserInterruptAgent(BaseAgent):
await self._send_experiment_update(payload) await self._send_experiment_update(payload)
self.logger.info(f"UI Update: Goal {goal_name} started (ID: {ui_id})") self.logger.info(f"UI Update: Goal {goal_name} started (ID: {ui_id})")
case "active_norms_update": case "active_norms_update":
self.logger.info(f"msg.bodyy{msg.body}")
norm_list = [s.strip("() '\",") for s in msg.body.split(",") if s.strip("() '\",")] norm_list = [s.strip("() '\",") for s in msg.body.split(",") if s.strip("() '\",")]
await self._broadcast_cond_norms(norm_list) await self._broadcast_cond_norms(norm_list)