Skip to content

Commit

Permalink
[HasConcept] added the has concept as parent to PhysicalBody
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanBassiouny committed Dec 13, 2024
1 parent 838ef77 commit 716a6c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pycram/datastructures/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ class HasConcept:
"""

def __init__(self):
self.ontology_individual = self.ontology_concept()
self.ontology_individual = self.ontology_concept()
4 changes: 3 additions & 1 deletion src/pycram/datastructures/world_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
"""
Expand All @@ -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
Expand Down

0 comments on commit 716a6c4

Please sign in to comment.