Skip to content

Commit

Permalink
[PhysicalBody] used pycrap in physical body instead of object.
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanBassiouny committed Dec 2, 2024
1 parent ff7b162 commit ceb34e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/pycram/datastructures/world_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from copy import copy

from trimesh.parent import Geometry3D
from typing_extensions import TYPE_CHECKING, Dict, Optional, List, deprecated, Union
from typing_extensions import TYPE_CHECKING, Dict, Optional, List, deprecated, Union, Type

from pycrap import PhysicalObject
from .dataclasses import State, ContactPointsList, ClosestPointsList, Color, PhysicalBodyState, \
AxisAlignedBoundingBox, RotatedBoundingBox
from ..local_transformer import LocalTransformer
Expand Down Expand Up @@ -159,6 +160,11 @@ class PhysicalBody(WorldEntity, ABC):
A class that represents a physical body in the world that has some related physical properties.
"""

ontology_concept: Type[PhysicalObject] = PhysicalObject
"""
The ontology concept of this entity.
"""

def __init__(self, body_id: int, world: World):
WorldEntity.__init__(self, body_id, world)
self.local_transformer = LocalTransformer()
Expand Down
2 changes: 0 additions & 2 deletions src/pycram/world_concepts/world_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class Object(PhysicalBody, HasConcept):
A dictionary that maps the file extension to the corresponding ObjectDescription type.
"""

ontology_concept: Type[PhysicalObject] = PhysicalObject

def __init__(self, name: str, concept: Type[PhysicalObject], path: Optional[str] = None,
description: Optional[ObjectDescription] = None,
pose: Optional[Pose] = None,
Expand Down
5 changes: 4 additions & 1 deletion src/pycrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
default_pycrap_ontology_file = tempfile.NamedTemporaryFile()
default_pycrap_ontology = owlready2.get_ontology("file://" + default_pycrap_ontology_file.name).load()


class Base(Thing):
comment = __doc__
namespace = default_pycrap_ontology
Expand All @@ -17,5 +18,7 @@ def set_comment_to_docstring(cls):

class PhysicalObject(Base):
"""
Any Object that has a proper space region. The prototypical physical object has also an associated mass, but the nature of its mass can greatly vary based on the epistemological status of the object (scientifically measured, subjectively possible, imaginary).
Any Object that has a proper space region. The prototypical physical object has also an associated mass,
but the nature of its mass can greatly vary based on the epistemological status of the object (scientifically
measured, subjectively possible, imaginary).
"""

0 comments on commit ceb34e3

Please sign in to comment.