From 4426653ae5b73d10be4ac3348b622cf9b9abb1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Chirico=20Indreb=C3=B8?= Date: Tue, 20 Feb 2024 15:30:29 +0100 Subject: [PATCH] Use orientation and pose in customer tag --- src/isar_exr/robotinterface.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/isar_exr/robotinterface.py b/src/isar_exr/robotinterface.py index 1a7707f..721eb6a 100644 --- a/src/isar_exr/robotinterface.py +++ b/src/isar_exr/robotinterface.py @@ -118,8 +118,9 @@ def update_site_with_tasks(self, tasks: List[Task]) -> List[str]: # Returns a li is_possible_return_to_home_mission = True robot_pose: Pose = step.pose if isinstance(step, InspectionStep): + customer_tag: str = task.tag_id + robot_pose.to_string() existing_poi_id = self.api.get_point_of_interest_by_customer_tag( - customer_tag=task.tag_id, site_id=settings.ROBOT_EXR_SITE_ID + customer_tag=customer_tag, site_id=settings.ROBOT_EXR_SITE_ID ) if existing_poi_id == None: new_stage_id: str = self.create_new_stage() @@ -129,6 +130,7 @@ def update_site_with_tasks(self, tasks: List[Task]) -> List[str]: # Returns a li step=step, robot_pose=robot_pose, # This pose is set by the previously received DriveToStep stage_id=new_stage_id, + customer_tag=customer_tag, ) ) poi_ids.append(poi_id) @@ -190,8 +192,6 @@ def initiate_mission(self, mission: Mission) -> None: poi_ids: List[str] = self.update_site_with_tasks(mission.tasks) except RobotMissionNotSupportedException: return - except Exception as e: - raise e mission_definition_id: str = self.create_mission_definition(mission.id, mission.tasks, poi_ids) @@ -313,7 +313,7 @@ def _create_video(self, step: Union[TakeVideo, TakeThermalVideo]): raise NotImplementedError def _create_and_add_poi( - self, task: Task, step: Step, robot_pose: Pose, stage_id: str + self, task: Task, step: Step, robot_pose: Pose, stage_id: str, customer_tag: str ) -> str: target: Position = self.transform.transform_position( positions=step.target, @@ -352,7 +352,7 @@ def _create_and_add_poi( add_point_of_interest_input: dict[str, PointOfInterestActionPhotoInput] = { "name": task.tag_id if task.tag_id != None else step.id, - "customerTag": task.tag_id, + "customerTag": customer_tag, "frame": "map", "type": PointOfInterestTypeEnum.GENERIC, "site": settings.ROBOT_EXR_SITE_ID,