From 442e45e88acb0330fe293751f6dc328a2047ba8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Chirico=20Indreb=C3=B8?= Date: Fri, 26 Jan 2024 14:59:36 +0100 Subject: [PATCH] Fixed missing map transform --- src/isar_exr/api/graphql_client.py | 7 +++++-- .../config/maps/exr_k\303\245rst\303\270.json" | 0 src/isar_exr/config/settings.py | 2 +- src/isar_exr/robotinterface.py | 12 +++++++++--- 4 files changed, 15 insertions(+), 6 deletions(-) rename src/isar_exr/config/maps/alitra_transform_exr.json => "src/isar_exr/config/maps/exr_k\303\245rst\303\270.json" (100%) diff --git a/src/isar_exr/api/graphql_client.py b/src/isar_exr/api/graphql_client.py index cb63bd9..39cb19f 100644 --- a/src/isar_exr/api/graphql_client.py +++ b/src/isar_exr/api/graphql_client.py @@ -13,7 +13,7 @@ TransportAlreadyConnected, ) from graphql import DocumentNode, GraphQLError, GraphQLSchema, build_ast_schema, parse -from httpx import ReadTimeout +from httpx import ConnectTimeout, ReadTimeout from isar_exr.api.authentication import get_access_token from isar_exr.config.settings import settings @@ -122,7 +122,10 @@ def query( self.logger.error(f"The transport is already connected: {e}") raise except ReadTimeout as e: - self.logger.error(f"Request GraphQL API timed out: {e}") + self.logger.error(f"Request to GraphQL API timed out: {e}") + raise + except ConnectTimeout as e: + self.logger.error(f"Connection to GraphQL API timed out: {e}") raise except Exception as e: self.logger.error(f"Unknown error in GraphQL client: {e}") diff --git a/src/isar_exr/config/maps/alitra_transform_exr.json "b/src/isar_exr/config/maps/exr_k\303\245rst\303\270.json" similarity index 100% rename from src/isar_exr/config/maps/alitra_transform_exr.json rename to "src/isar_exr/config/maps/exr_k\303\245rst\303\270.json" diff --git a/src/isar_exr/config/settings.py b/src/isar_exr/config/settings.py index fdea0d3..0ba5a7f 100644 --- a/src/isar_exr/config/settings.py +++ b/src/isar_exr/config/settings.py @@ -25,7 +25,7 @@ def __init__(self) -> None: ROBOT_EXR_SITE_ID: str = Field(default="61a0a1f45f71913ebbb4657d") # Map to be used for creation of alitra transformation - MAP: str = Field(default="exr_default") + MAP: str = Field(default="exr_kårstø") # URL for Ex-Robotics API ROBOT_API_URL: str = Field(default="https://developer.energy-robotics.com/graphql/") diff --git a/src/isar_exr/robotinterface.py b/src/isar_exr/robotinterface.py index 2587ebc..fac7ce3 100644 --- a/src/isar_exr/robotinterface.py +++ b/src/isar_exr/robotinterface.py @@ -288,11 +288,17 @@ def _create_and_add_poi( ), ) + transformed_robot_pose = self.transform.transform_position( + positions=robot_pose.position, + from_=robot_pose.position.frame, + to_=Frame("robot"), + ) + photo_input_pose: Pose3DInput = Pose3DInput( position=Point3DInput( - x=robot_pose.position.x, - y=robot_pose.position.y, - z=robot_pose.position.z, + x=transformed_robot_pose.x, + y=transformed_robot_pose.y, + z=transformed_robot_pose.z, ), orientation=QuaternionInput( w=robot_pose.orientation.w,