From 98fbfbdde9d01a004b9a6746f95b6da0896a9bcd Mon Sep 17 00:00:00 2001 From: Apolo151 Date: Thu, 3 Apr 2025 22:38:41 +0200 Subject: [PATCH] update dummyclient (working) --- manager/libs/launch_world_model.py | 5 +++-- test/dummyclient.py | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/manager/libs/launch_world_model.py b/manager/libs/launch_world_model.py index 6b13e3f..881f677 100644 --- a/manager/libs/launch_world_model.py +++ b/manager/libs/launch_world_model.py @@ -1,12 +1,13 @@ from dataclasses import dataclass -from typing import Optional +from typing import Optional, Union from pydantic import BaseModel, ValidationError # Clase de configuración utilizando Pydantic para validación class ConfigurationModel(BaseModel): - world: str + world: Union[str, dict] + robot: Optional[Union[str, dict]] = None launch_file_path: str # Definición de la clase de datos diff --git a/test/dummyclient.py b/test/dummyclient.py index 20a6cee..9961161 100755 --- a/test/dummyclient.py +++ b/test/dummyclient.py @@ -15,14 +15,27 @@ class LaunchWorldCmd(ManagerConsumerMessage): id: str = '2' command: str = 'launch_world' data: ConfigurationModel = ConfigurationModel( - world='gazebo', + world = { + "world": "gazebo", + "robot": "rae", + "launch_file_path":'/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py' + }, + robot = { + "world": "gazebo", + "robot": "rae", + "start_pose": [0.0, 0.0, 0.05, 0.0, 0.0, 0.0], # [x, y, z, roll, pitch, yaw], + "launch_file_path":'/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py' + }, launch_file_path='/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py') class LaunchPrepareViz(ManagerConsumerMessage): id: str = '3' command: str = 'prepare_visualization' - data: str = 'gazebo_rae' + data: str = { + "type": 'gazebo_rae', + "file": None + } websocket.enableTrace(True) ws = websocket.create_connection("ws://localhost:7163")