diff --git a/src/isar/apis/models/start_mission_definition.py b/src/isar/apis/models/start_mission_definition.py index 59c896f9..67d95b6b 100644 --- a/src/isar/apis/models/start_mission_definition.py +++ b/src/isar/apis/models/start_mission_definition.py @@ -19,6 +19,7 @@ TakeThermalImage, TakeThermalVideo, TakeVideo, + ZoomDescription, ) @@ -52,6 +53,7 @@ class StartMissionTaskDefinition(BaseModel): inspection: Optional[StartMissionInspectionDefinition] = None tag: Optional[str] = None id: Optional[str] = None + zoom: Optional[ZoomDescription] = None class StartMissionDefinition(BaseModel): @@ -148,6 +150,7 @@ def create_inspection_task( tag_id=start_mission_task_definition.tag, robot_pose=start_mission_task_definition.pose.to_alitra_pose(), metadata=start_mission_task_definition.inspection.metadata, + zoom=start_mission_task_definition.zoom, ) elif start_mission_task_definition.inspection.type == InspectionTypes.video: return TakeVideo( @@ -156,6 +159,7 @@ def create_inspection_task( tag_id=start_mission_task_definition.tag, robot_pose=start_mission_task_definition.pose.to_alitra_pose(), metadata=start_mission_task_definition.inspection.metadata, + zoom=start_mission_task_definition.zoom, ) elif start_mission_task_definition.inspection.type == InspectionTypes.thermal_image: @@ -164,6 +168,7 @@ def create_inspection_task( tag_id=start_mission_task_definition.tag, robot_pose=start_mission_task_definition.pose.to_alitra_pose(), metadata=start_mission_task_definition.inspection.metadata, + zoom=start_mission_task_definition.zoom, ) elif start_mission_task_definition.inspection.type == InspectionTypes.thermal_video: @@ -173,6 +178,7 @@ def create_inspection_task( tag_id=start_mission_task_definition.tag, robot_pose=start_mission_task_definition.pose.to_alitra_pose(), metadata=start_mission_task_definition.inspection.metadata, + zoom=start_mission_task_definition.zoom, ) elif start_mission_task_definition.inspection.type == InspectionTypes.audio: @@ -182,6 +188,7 @@ def create_inspection_task( tag_id=start_mission_task_definition.tag, robot_pose=start_mission_task_definition.pose.to_alitra_pose(), metadata=start_mission_task_definition.inspection.metadata, + zoom=start_mission_task_definition.zoom, ) else: raise ValueError( diff --git a/src/robot_interface/models/mission/task.py b/src/robot_interface/models/mission/task.py index ed289ed3..623fe97b 100644 --- a/src/robot_interface/models/mission/task.py +++ b/src/robot_interface/models/mission/task.py @@ -29,6 +29,12 @@ class TaskTypes(str, Enum): DockingProcedure = "docking_procedure" +@dataclass +class ZoomDescription: + objectWidth: float + objectHeight: float + + @dataclass class Task: status: TaskStatus = field(default=TaskStatus.NotStarted, init=False) @@ -59,6 +65,7 @@ class InspectionTask(Task): inspection: Inspection = field(default=None, init=True) robot_pose: Pose = field(default=None, init=True) metadata: Optional[dict] = field(default_factory=dict, init=True) + zoom: Optional[ZoomDescription] = field(default=None) @staticmethod def get_inspection_type() -> Type[Inspection]: