Skip to content

Commit

Permalink
Move mediaconfig to prevent circular dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Dec 9, 2024
1 parent ca0b795 commit cc5f0cc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
5 changes: 0 additions & 5 deletions src/isar/apis/models/media_connection_type.py

This file was deleted.

9 changes: 0 additions & 9 deletions src/isar/apis/models/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from dataclasses import dataclass
from typing import List, Optional

from alitra import Frame, Orientation, Pose, Position
from isar.apis.models.media_connection_type import MediaConnectionType
from pydantic import BaseModel, Field

from robot_interface.models.mission.task import TaskTypes
Expand Down Expand Up @@ -35,13 +33,6 @@ class RobotInfoResponse(BaseModel):
plant_short_name: str


@dataclass
class MediaConfig:
url: str
token: str
media_connection_type: MediaConnectionType


class InputOrientation(BaseModel):
x: float
y: float
Expand Down
2 changes: 1 addition & 1 deletion src/isar/services/utilities/robot_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from injector import inject

from isar.apis.models.models import MediaConfig
from robot_interface.models.robots.media import MediaConfig
from robot_interface.robot_interface import RobotInterface


Expand Down
13 changes: 13 additions & 0 deletions src/robot_interface/models/robots/media.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from dataclasses import dataclass
from enum import Enum


class MediaConnectionType(str, Enum):
LiveKit: str = "LiveKit"


@dataclass
class MediaConfig:
url: str
token: str
media_connection_type: MediaConnectionType
2 changes: 1 addition & 1 deletion src/robot_interface/robot_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from threading import Thread
from typing import Callable, List

from isar.apis.models.models import MediaConfig
from robot_interface.models.robots.media import MediaConfig
from robot_interface.models.initialize import InitializeParams
from robot_interface.models.inspection.inspection import Inspection
from robot_interface.models.mission.mission import Mission
Expand Down
5 changes: 2 additions & 3 deletions tests/mocks/robot_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from alitra import Frame, Orientation, Pose, Position

from isar.apis.models.media_connection_type import MediaConnectionType
from isar.apis.models.models import MediaConfig
from robot_interface.models.robots.media import MediaConnectionType
from robot_interface.models.robots.media import MediaConfig
from robot_interface.models.initialize import InitializeParams
from robot_interface.models.inspection.inspection import (
Image,
Expand All @@ -22,7 +22,6 @@


class MockRobot(RobotInterface):

def __init__(
self,
mission_status: MissionStatus = MissionStatus.Successful,
Expand Down

0 comments on commit cc5f0cc

Please sign in to comment.