From ea39f444353b577581a3c711994b4bf4b2802f6a Mon Sep 17 00:00:00 2001 From: Lukas Baecker Date: Fri, 6 Sep 2024 16:18:36 +0200 Subject: [PATCH] fixing Point3d error --- field_friend/interface/components/camera_card.py | 4 ++-- field_friend/interface/components/plant_object.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/field_friend/interface/components/camera_card.py b/field_friend/interface/components/camera_card.py index f77d5ad5..d593a962 100644 --- a/field_friend/interface/components/camera_card.py +++ b/field_friend/interface/components/camera_card.py @@ -219,8 +219,8 @@ def build_svg_for_implement(self) -> str: def build_svg_for_plant_provider(self) -> str: if self.camera is None or self.camera.calibration is None: return '' - position = rosys.geometry.Point(x=self.camera.calibration.extrinsics.translation[0], - y=self.camera.calibration.extrinsics.translation[1]) + position = rosys.geometry.Point3d(x=self.camera.calibration.extrinsics.translation[0], + y=self.camera.calibration.extrinsics.translation[1]) svg = '' for plant in self.plant_provider.get_relevant_weeds(position): position_3d = rosys.geometry.Point3d(x=plant.position.x, y=plant.position.y, z=0) diff --git a/field_friend/interface/components/plant_object.py b/field_friend/interface/components/plant_object.py index c5a8b827..3db2265a 100644 --- a/field_friend/interface/components/plant_object.py +++ b/field_friend/interface/components/plant_object.py @@ -18,7 +18,7 @@ def __init__(self, plant_provider: PlantProvider, weed_category_names: list[str] self.plant_provider.PLANTS_CHANGED.register_ui(self.update) def update(self) -> None: - origin = rosys.geometry.Point(x=0, y=0) + origin = rosys.geometry.Point3d(x=0, y=0, z=0) in_world = {p.id: p for p in self.plant_provider.get_relevant_weeds(origin, max_distance=1000) + self.plant_provider.get_relevant_crops(origin, max_distance=1000)}