From 716a6c4f9e895a118024176efd406f8dc2cc9f73 Mon Sep 17 00:00:00 2001 From: Abdelrhman Bassiouny Date: Fri, 13 Dec 2024 17:16:56 +0100 Subject: [PATCH] [HasConcept] added the has concept as parent to PhysicalBody --- src/pycram/datastructures/mixins.py | 2 +- src/pycram/datastructures/world_entity.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pycram/datastructures/mixins.py b/src/pycram/datastructures/mixins.py index 5ff4dc555..eef06e1cb 100644 --- a/src/pycram/datastructures/mixins.py +++ b/src/pycram/datastructures/mixins.py @@ -19,4 +19,4 @@ class HasConcept: """ def __init__(self): - self.ontology_individual = self.ontology_concept() \ No newline at end of file + self.ontology_individual = self.ontology_concept() diff --git a/src/pycram/datastructures/world_entity.py b/src/pycram/datastructures/world_entity.py index 8b0185781..1a1bf9296 100644 --- a/src/pycram/datastructures/world_entity.py +++ b/src/pycram/datastructures/world_entity.py @@ -11,6 +11,7 @@ from pycrap import PhysicalObject from .dataclasses import State, ContactPointsList, ClosestPointsList, Color, PhysicalBodyState, \ AxisAlignedBoundingBox, RotatedBoundingBox +from .mixins import HasConcept from ..local_transformer import LocalTransformer from ..ros.data_types import Time @@ -155,7 +156,7 @@ def __hash__(self) -> int: return hash((self.id, self.name, self.parent_entity)) -class PhysicalBody(WorldEntity, ABC): +class PhysicalBody(WorldEntity, HasConcept, ABC): """ A class that represents a physical body in the world that has some related physical properties. """ @@ -167,6 +168,7 @@ class PhysicalBody(WorldEntity, ABC): def __init__(self, body_id: int, world: World): WorldEntity.__init__(self, body_id, world) + HasConcept.__init__(self) self.local_transformer = LocalTransformer() self._is_translating: Optional[bool] = None self._is_rotating: Optional[bool] = None