Skip to content

Commit

Permalink
Pass on task zoom value from API
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Dec 10, 2024
1 parent cc5f0cc commit 961f8dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/isar/apis/models/start_mission_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
TakeThermalImage,
TakeThermalVideo,
TakeVideo,
ZoomDescription,
)


Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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(
Expand Down
7 changes: 7 additions & 0 deletions src/robot_interface/models/mission/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]:
Expand Down

0 comments on commit 961f8dc

Please sign in to comment.