Skip to content

Commit

Permalink
Merge pull request #12 from sunava/main
Browse files Browse the repository at this point in the history
[cutting] fixed missing orm and cutting
  • Loading branch information
sunava authored Nov 9, 2023
2 parents 202ace3 + d042929 commit 460c779
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
1 change: 0 additions & 1 deletion demos/pycram_cutting_demo/cutting-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from pycram.designators.object_designator import *
from pycram.designators.object_designator import BelieveObject
import pycram.helper as helper
from pycram.resolver.action.cutting import CuttingActionSPARQL

world = BulletWorld()
world.set_gravity([0, 0, -9.8])
Expand Down
36 changes: 36 additions & 0 deletions src/pycram/orm/action_designator.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,39 @@ class CloseAction(Action):
__mapper_args__ = {
"polymorphic_identity": __tablename__,
}


class CuttingAction(Action):
"""ORM Class of pycram.designators.action_designator.PickUpAction."""
__tablename__ = "Cutting"
id = sqlalchemy.Column(sqlalchemy.types.Integer, sqlalchemy.ForeignKey("Action.id"), primary_key=True)
arm = sqlalchemy.Column(sqlalchemy.types.String(255))
grasp = sqlalchemy.Column(sqlalchemy.types.String(255))
object = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("Object.id"))

__mapper_args__ = {
"polymorphic_identity": __tablename__,
}

def __init__(self, arm: str, grasp: str):
super(CuttingAction, self).__init__()
self.arm = arm
self.grasp = grasp


class MixingAction(Action):
"""ORM Class of pycram.designators.action_designator.PickUpAction."""
__tablename__ = "Mixing"
id = sqlalchemy.Column(sqlalchemy.types.Integer, sqlalchemy.ForeignKey("Action.id"), primary_key=True)
arm = sqlalchemy.Column(sqlalchemy.types.String(255))
grasp = sqlalchemy.Column(sqlalchemy.types.String(255))
object = sqlalchemy.Column(sqlalchemy.Integer, sqlalchemy.ForeignKey("Object.id"))

__mapper_args__ = {
"polymorphic_identity": __tablename__,
}

def __init__(self, arm: str, grasp: str):
super(MixingAction, self).__init__()
self.arm = arm
self.grasp = grasp

0 comments on commit 460c779

Please sign in to comment.