From 69f7dfe60dcdf60371662483cfdb5db2569ac4d1 Mon Sep 17 00:00:00 2001 From: Eddasol Date: Thu, 29 Aug 2024 15:14:11 +0200 Subject: [PATCH] Add configurable documentation variable --- src/isar/config/settings.py | 12 +++++++++++- .../service_connections/mqtt/robot_info_publisher.py | 1 + src/robot_interface/telemetry/payloads.py | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/isar/config/settings.py b/src/isar/config/settings.py index 86a0e0f5..c8439320 100644 --- a/src/isar/config/settings.py +++ b/src/isar/config/settings.py @@ -8,7 +8,7 @@ from isar.config import predefined_missions from robot_interface.models.robots.robot_model import RobotModel -from robot_interface.telemetry.payloads import VideoStream +from robot_interface.telemetry.payloads import VideoStream, DocumentInfo class Settings(BaseSettings): @@ -190,6 +190,16 @@ def __init__(self) -> None: # Serial number of the robot ISAR is connected to SERIAL_NUMBER: str = Field(default="0001") + # Info about robot documentation + DOCUMENTATION: List[DocumentInfo] = Field( + default=[ + DocumentInfo( + name="Some document", + url="Some URL", + ), + ] + ) + # Endpoints to reach video streams for the robot VIDEO_STREAMS: List[VideoStream] = Field( default=[ diff --git a/src/isar/services/service_connections/mqtt/robot_info_publisher.py b/src/isar/services/service_connections/mqtt/robot_info_publisher.py index e854e927..38540b8b 100644 --- a/src/isar/services/service_connections/mqtt/robot_info_publisher.py +++ b/src/isar/services/service_connections/mqtt/robot_info_publisher.py @@ -21,6 +21,7 @@ def run(self) -> None: robot_model=robot_settings.ROBOT_MODEL, # type: ignore robot_serial_number=settings.SERIAL_NUMBER, robot_asset=settings.PLANT_SHORT_NAME, + documentation=settings.DOCUMENTATION, video_streams=settings.VIDEO_STREAMS, host=settings.API_HOST_VIEWED_EXTERNALLY, port=settings.API_PORT, diff --git a/src/robot_interface/telemetry/payloads.py b/src/robot_interface/telemetry/payloads.py index a557d882..a90a1ac6 100644 --- a/src/robot_interface/telemetry/payloads.py +++ b/src/robot_interface/telemetry/payloads.py @@ -42,6 +42,12 @@ class TelemetryPressurePayload(TelemetryPayload): pressure_level: float +@dataclass +class DocumentInfo: + name: str + url: str + + @dataclass class VideoStream: name: str @@ -69,6 +75,7 @@ class RobotInfoPayload: robot_model: str robot_serial_number: str robot_asset: str + documentation: List[DocumentInfo] video_streams: List[VideoStream] host: str port: int