Skip to content

Commit

Permalink
Fixed missing map transform
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jan 29, 2024
1 parent eaefe20 commit 442e45e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/isar_exr/api/graphql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}")
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/isar_exr/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down
12 changes: 9 additions & 3 deletions src/isar_exr/robotinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 442e45e

Please sign in to comment.