feat: added pause functionality
Storms code wasnt fully included in Bjorns branch ref: N25B-400
This commit is contained in:
@@ -3,12 +3,14 @@ import json
|
||||
|
||||
import zmq
|
||||
import zmq.asyncio as azmq
|
||||
from pydantic import ValidationError
|
||||
from zmq.asyncio import Context
|
||||
|
||||
from control_backend.agents import BaseAgent
|
||||
from control_backend.agents.actuation.robot_gesture_agent import RobotGestureAgent
|
||||
from control_backend.core.config import settings
|
||||
from control_backend.schemas.internal_message import InternalMessage
|
||||
from control_backend.schemas.ri_message import PauseCommand
|
||||
|
||||
from ..actuation.robot_speech_agent import RobotSpeechAgent
|
||||
from ..perception import VADAgent
|
||||
@@ -320,12 +322,9 @@ class RICommunicationAgent(BaseAgent):
|
||||
self.connected = True
|
||||
|
||||
async def handle_message(self, msg: InternalMessage):
|
||||
"""
|
||||
Handle an incoming message.
|
||||
|
||||
Currently not implemented for this agent.
|
||||
|
||||
:param msg: The received message.
|
||||
:raises NotImplementedError: Always, since this method is not implemented.
|
||||
"""
|
||||
self.logger.warning("custom warning for handle msg in ri coms %s", self.name)
|
||||
try:
|
||||
pause_command = PauseCommand.model_validate_json(msg.body)
|
||||
self._req_socket.send_json(pause_command.model_dump())
|
||||
self.logger.debug(self._req_socket.recv_json())
|
||||
except ValidationError:
|
||||
self.logger.warning("Incorrect message format for PauseCommand.")
|
||||
|
||||
@@ -179,7 +179,6 @@ class UserInterruptAgent(BaseAgent):
|
||||
await self._send_experiment_update(payload)
|
||||
self.logger.info(f"UI Update: Goal {goal_name} started (ID: {ui_id})")
|
||||
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("() '\",")]
|
||||
|
||||
await self._broadcast_cond_norms(norm_list)
|
||||
|
||||
Reference in New Issue
Block a user