From d04292954c44f4b5822794a92a7ea924ff09e35d Mon Sep 17 00:00:00 2001 From: "OEM Configuration (temporary user)" Date: Thu, 9 Nov 2023 21:55:42 +0100 Subject: [PATCH] [cutting] fixed missing orm and cutting --- demos/pycram_cutting_demo/cutting-demo.py | 1 - src/pycram/orm/action_designator.py | 36 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/demos/pycram_cutting_demo/cutting-demo.py b/demos/pycram_cutting_demo/cutting-demo.py index f6f96f852..892105230 100644 --- a/demos/pycram_cutting_demo/cutting-demo.py +++ b/demos/pycram_cutting_demo/cutting-demo.py @@ -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]) diff --git a/src/pycram/orm/action_designator.py b/src/pycram/orm/action_designator.py index 427dc2eed..411c0d536 100644 --- a/src/pycram/orm/action_designator.py +++ b/src/pycram/orm/action_designator.py @@ -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