From a799b953d2c45a0b0ac34e1181dbce91c35a18f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Tue, 12 Mar 2024 01:24:40 -0700 Subject: [PATCH 1/2] Update assembled tasks --- .../assembling_furniture/problem0.bddl | 20 +++++++--- .../make_a_clothes_line/problem0.bddl | 17 ++++---- .../make_cabinet_doors/problem0.bddl | 11 +++-- .../putting_up_shelves/problem0.bddl | 40 +++++++++++++------ .../setup_a_trampoline/problem0.bddl | 17 +++++--- bddl/bddl_verification.py | 7 +++- 6 files changed, 73 insertions(+), 39 deletions(-) diff --git a/bddl/activity_definitions/assembling_furniture/problem0.bddl b/bddl/activity_definitions/assembling_furniture/problem0.bddl index f6e6b692..7ad0d901 100644 --- a/bddl/activity_definitions/assembling_furniture/problem0.bddl +++ b/bddl/activity_definitions/assembling_furniture/problem0.bddl @@ -2,23 +2,31 @@ (:domain omnigibson) (:objects - desk.n.01_1 - desk.n.01 + desk_top.n.01_1 - desk_top.n.01 + desk_bracket.n.01_1 - desk_bracket.n.01 + desk_leg.n.01_1 desk_leg.n.01_2 desk_leg.n.01_3 desk_leg.n.01_4 - desk_leg.n.01 floor.n.01_1 - floor.n.01 agent.n.01_1 - agent.n.01 ) (:init - (not - (assembled desk.n.01_1) - ) (inroom floor.n.01_1 living_room) - (ontop desk.n.01_1 floor.n.01_1) + (ontop desk_top.n.01_1 floor.n.01_1) + (ontop desk_bracket.n.01_1 floor.n.01_1) + (ontop desk_leg.n.01_1 floor.n.01_1) + (ontop desk_leg.n.01_2 floor.n.01_1) + (ontop desk_leg.n.01_3 floor.n.01_1) + (ontop desk_leg.n.01_4 floor.n.01_1) (ontop agent.n.01_1 floor.n.01_1) ) (:goal (and - (assembled ?desk.n.01_1) + (attached ?desk_bracket.n.01_1 ?desk_top.n.01_1) + (forall + (?desk_leg.n.01 - desk_leg.n.01) + (attached ?desk_leg.n.01 ?desk_bracket.n.01_1) + ) ) ) ) \ No newline at end of file diff --git a/bddl/activity_definitions/make_a_clothes_line/problem0.bddl b/bddl/activity_definitions/make_a_clothes_line/problem0.bddl index 7adb1288..3fe088d9 100644 --- a/bddl/activity_definitions/make_a_clothes_line/problem0.bddl +++ b/bddl/activity_definitions/make_a_clothes_line/problem0.bddl @@ -2,25 +2,26 @@ (:domain omnigibson) (:objects - cabinet.n.01_1 - cabinet.n.01 - clothesline.n.01_1 - clothesline.n.01 + clothesline_rope.n.01_1 - clothesline_rope.n.01 + pole.n.01_1 pole.n.01_2 - pole.n.01 floor.n.01_1 - floor.n.01 agent.n.01_1 - agent.n.01 ) (:init - (ontop clothesline.n.01_1 floor.n.01_1) - (not - (assembled clothesline.n.01_1) - ) - (inroom cabinet.n.01_1 utility_room) + (inroom pole.n.01_1 garden) + (inroom pole.n.01_2 garden) (inroom floor.n.01_1 utility_room) + (ontop clothesline_rope.n.01_1 floor.n.01_1) (ontop agent.n.01_1 floor.n.01_1) ) (:goal (and - (assembled ?clothesline.n.01_1) + (exists + (?pole.n.01 - pole.n.01) + (attached ?clothesline_rope.n.01_1 ?pole.n.01_1) + ) ) ) ) \ No newline at end of file diff --git a/bddl/activity_definitions/make_cabinet_doors/problem0.bddl b/bddl/activity_definitions/make_cabinet_doors/problem0.bddl index a87ac59c..269d500c 100644 --- a/bddl/activity_definitions/make_cabinet_doors/problem0.bddl +++ b/bddl/activity_definitions/make_cabinet_doors/problem0.bddl @@ -2,23 +2,22 @@ (:domain omnigibson) (:objects - cabinet.n.01_1 - cabinet.n.01 + cabinet_base.n.01_1 - cabinet_base.n.01 + cabinet_door.n.01_1 - cabinet_door.n.01 floor.n.01_1 - floor.n.01 agent.n.01_1 - agent.n.01 ) (:init - (not - (assembled cabinet.n.01_1) - ) (inroom floor.n.01_1 living_room) - (inroom cabinet.n.01_1 living_room) + (ontop cabinet_base.n.01_1 floor.n.01_1) + (ontop cabinet_door.n.01_1 floor.n.01_1) (ontop agent.n.01_1 floor.n.01_1) ) (:goal (and - (assembled ?cabinet.n.01_1) + (attached ?cabinet_door.n.01_1 ?cabinet_base.n.01_1) ) ) ) \ No newline at end of file diff --git a/bddl/activity_definitions/putting_up_shelves/problem0.bddl b/bddl/activity_definitions/putting_up_shelves/problem0.bddl index b1cd4d22..d79dbedf 100644 --- a/bddl/activity_definitions/putting_up_shelves/problem0.bddl +++ b/bddl/activity_definitions/putting_up_shelves/problem0.bddl @@ -2,29 +2,45 @@ (:domain omnigibson) (:objects - shelf.n.01_1 shelf.n.01_2 - shelf.n.01 + shelf_back.n.01_1 - shelf_back.n.01 + shelf_side.n.01_1 shelf_side.n.01_2 - shelf_side.n.01 + shelf_shelf.n.01_1 shelf_shelf.n.01_2 shelf_shelf.n.01_3 shelf_shelf.n.01_4 shelf_shelf.n.01_5 shelf_shelf.n.01_6 - shelf_shelf.n.01 + shelf_top.n.01_1 - shelf_top.n.01 + shelf_baseboard.n.01_1 - shelf_baseboard.n.01 floor.n.01_1 - floor.n.01 agent.n.01_1 - agent.n.01 ) (:init - (not - (assembled shelf.n.01_1) - ) - (not - (assembled shelf.n.01_2) - ) (inroom floor.n.01_1 bathroom) - (inroom shelf.n.01_1 bathroom) - (inroom shelf.n.01_2 bathroom) (ontop agent.n.01_1 floor.n.01_1) + (ontop shelf_back.n.01_1 floor.n.01_1) + (ontop shelf_side.n.01_1 floor.n.01_1) + (ontop shelf_side.n.01_2 floor.n.01_1) + (ontop shelf_shelf.n.01_1 floor.n.01_1) + (ontop shelf_shelf.n.01_2 floor.n.01_1) + (ontop shelf_shelf.n.01_3 floor.n.01_1) + (ontop shelf_shelf.n.01_4 floor.n.01_1) + (ontop shelf_shelf.n.01_5 floor.n.01_1) + (ontop shelf_shelf.n.01_6 floor.n.01_1) + (ontop shelf_top.n.01_1 floor.n.01_1) + (ontop shelf_baseboard.n.01_1 floor.n.01_1) ) (:goal (and - (forall - (?shelf.n.01 - shelf.n.01) - (assembled ?shelf.n.01) + (forall + (?shelf_shelf.n.01 - shelf_shelf.n.01) + (attached ?shelf_shelf.n.01 ?shelf_back.n.01_1) + ) + (forall + (?shelf_side.n.01 - shelf_side.n.01) + (attached ?shelf_side.n.01 ?shelf_back.n.01_1) + ) + (attached ?shelf_top.n.01_1 ?shelf_back.n.01_1) + (exists + (?shelf_side.n.01 - shelf_side.n.01) + (attached ?shelf_baseboard.n.01_1 ?shelf_side.n.01) ) ) ) diff --git a/bddl/activity_definitions/setup_a_trampoline/problem0.bddl b/bddl/activity_definitions/setup_a_trampoline/problem0.bddl index c599990d..43ea5845 100644 --- a/bddl/activity_definitions/setup_a_trampoline/problem0.bddl +++ b/bddl/activity_definitions/setup_a_trampoline/problem0.bddl @@ -2,23 +2,28 @@ (:domain omnigibson) (:objects - trampoline.n.01_1 - trampoline.n.01 + trampoline_top.n.01_1 - trampoline_top.n.01 + trampoline_leg.n.01_1 trampoline_leg.n.01_2 trampoline_leg.n.01_3 trampoline_leg.n.01_4 - trampoline_leg.n.01 floor.n.01_1 - floor.n.01 agent.n.01_1 - agent.n.01 ) (:init - (not - (assembled trampoline.n.01_1) - ) - (ontop trampoline.n.01_1 floor.n.01_1) + (ontop trampoline_top.n.01_1 floor.n.01_1) + (ontop trampoline_leg.n.01_1 floor.n.01_1) + (ontop trampoline_leg.n.01_2 floor.n.01_1) + (ontop trampoline_leg.n.01_3 floor.n.01_1) + (ontop trampoline_leg.n.01_4 floor.n.01_1) (inroom floor.n.01_1 garden) (ontop agent.n.01_1 floor.n.01_1) ) (:goal (and - (assembled ?trampoline.n.01_1) + (forall + (?trampoline_leg.n.01 - trampoline_leg.n.01) + (attached ?trampoline_leg.n.01 ?trampoline_top.n.01_1) + ) ) ) ) \ No newline at end of file diff --git a/bddl/bddl_verification.py b/bddl/bddl_verification.py index 0c15fcde..ab0f0f5b 100644 --- a/bddl/bddl_verification.py +++ b/bddl/bddl_verification.py @@ -81,8 +81,13 @@ ("skateboard_wheel.n.01", "skateboard_deck.n.01"), ("shelf_shelf.n.01", "shelf_back.n.01"), ("shelf_side.n.01", "shelf_back.n.01"), - ("shelf_baseboard.n.01", "shelf_back.n.01"), + ("shelf_baseboard.n.01", "shelf_side.n.01"), ("shelf_top.n.01", "shelf_back.n.01"), + ("desk_leg.n.01", "desk_bracket.n.01"), + ("desk_bracket.n.01", "desk_top.n.01"), + ("trampoline_leg.n.01", "trampoline_top.n.01"), + ("clothesline_rope.n.01", "pole.n.01"), + ("cabinet_door.n.01", "cabinet_base.n.01"), ]) VALID_ROOMS = set() From c0f746ec82676438239ccc7334a75dd0adaa69ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Tue, 12 Mar 2024 01:26:58 -0700 Subject: [PATCH 2/2] Fully remove the assembled predicate --- .../domain_omnigibson.bddl | 1 - bddl/bddl_verification.py | 3 --- .../get_syn_prop_annots_canonical.py | 2 +- .../synsets_to_descriptors.json | 20 -------------- bddl/knowledge_base/models.py | 2 +- bddl/trivial_backend.py | 27 ------------------- 6 files changed, 2 insertions(+), 53 deletions(-) diff --git a/bddl/activity_definitions/domain_omnigibson.bddl b/bddl/activity_definitions/domain_omnigibson.bddl index 12e88cf1..30515da5 100644 --- a/bddl/activity_definitions/domain_omnigibson.bddl +++ b/bddl/activity_definitions/domain_omnigibson.bddl @@ -26,7 +26,6 @@ (insource ?obj1 ?obj2) (inroom ?obj1 ?obj2) (broken ?obj1) - (assembled ?obj1) (grasped ?obj1 ?obj2) ) ) diff --git a/bddl/bddl_verification.py b/bddl/bddl_verification.py index ab0f0f5b..d84160ac 100644 --- a/bddl/bddl_verification.py +++ b/bddl/bddl_verification.py @@ -298,9 +298,6 @@ def check_synset_predicate_alignment(atom, syns_to_props): if pred == "on_fire": assert "nonSubstance" in syns_to_props[objects[0]], f"Inapplicable on_fire: {atom}" assert "flammable" in syns_to_props[objects[0]], f"Inapplicable on_fire: {atom}" - if pred == "assembled": - assert "rigidBody" in syns_to_props[objects[0]], f"Inapplicable assembled: {atom}" - assert "assembleable" in syns_to_props[objects[0]], f"Inapplicable assembled: {atom}" if pred == "broken": assert "rigidBody" in syns_to_props[objects[0]], f"Inapplicable broken: {atom}" assert "breakable" in syns_to_props[objects[0]], f"Inapplicable broken: {atom}" diff --git a/bddl/data_generation/get_syn_prop_annots_canonical.py b/bddl/data_generation/get_syn_prop_annots_canonical.py index f426a3dc..c95604a7 100644 --- a/bddl/data_generation/get_syn_prop_annots_canonical.py +++ b/bddl/data_generation/get_syn_prop_annots_canonical.py @@ -47,7 +47,7 @@ "soakable": None, "wetable": "wet", "flammable": "on_fire", - "assembleable": "assembled", + "assembleable": None, "heatable" : "hot", "boilable": "boiling", "meltable" : "melted", diff --git a/bddl/generated_data/synsets_to_descriptors.json b/bddl/generated_data/synsets_to_descriptors.json index 72a6043b..6ff7648b 100644 --- a/bddl/generated_data/synsets_to_descriptors.json +++ b/bddl/generated_data/synsets_to_descriptors.json @@ -25552,10 +25552,6 @@ ] ], "cabinet.n.01": [ - [ - "assembled", - "assembled" - ], [ "disinfected", "disinfected" @@ -35186,10 +35182,6 @@ ] ], "clothesline.n.01": [ - [ - "assembled", - "assembled" - ], [ "disinfected", "disinfected" @@ -47360,10 +47352,6 @@ ] ], "desk.n.01": [ - [ - "assembled", - "assembled" - ], [ "disinfected", "disinfected" @@ -127086,10 +127074,6 @@ ] ], "shelf.n.01": [ - [ - "assembled", - "assembled" - ], [ "disinfected", "disinfected" @@ -144292,10 +144276,6 @@ ] ], "trampoline.n.01": [ - [ - "assembled", - "assembled" - ], [ "disinfected", "disinfected" diff --git a/bddl/knowledge_base/models.py b/bddl/knowledge_base/models.py index 832f74b4..caee806f 100644 --- a/bddl/knowledge_base/models.py +++ b/bddl/knowledge_base/models.py @@ -624,7 +624,7 @@ def uses_physical_substance(self): return any("physicalSubstance" in synset.property_names for synset in self.synsets) def uses_attachment(self): - return any(pred.name in ['assembled', 'attached'] for pred in self.uses_predicates) + return any(pred.name == 'attached' for pred in self.uses_predicates) def uses_cloth(self): return any(pred.name in ['folded', 'draped', 'unfolded'] for pred in self.uses_predicates) diff --git a/bddl/trivial_backend.py b/bddl/trivial_backend.py index 2a1dab3a..aaf49e70 100644 --- a/bddl/trivial_backend.py +++ b/bddl/trivial_backend.py @@ -39,7 +39,6 @@ def get_predicate_class(self, predicate_name): "draped": TrivialDrapedPredicate, "insource": TrivialInsourcePredicate, "broken": TrivialBrokenPredicate, - "assembled": TrivialAssembledPredicate, "grasped": TrivialGraspedPredicate, } return PREDICATE_MAPPING[predicate_name] @@ -61,7 +60,6 @@ def __init__(self): self.real = set() self.broken = set() self.closed = set() - self.assembled = set() # Binaries - populated with 2-tuples of string names self.saturated = set() self.covered = set() @@ -92,7 +90,6 @@ def create_predicate_to_setters(self): "on_fire": self.set_on_fire, "empty": self.set_empty, "broken": self.set_broken, - "assembled": self.set_assembled, "closed": self.set_closed, "future": self.set_future, "real": self.set_real, @@ -249,16 +246,6 @@ def set_broken(self, objs, is_broken): def get_broken(self, objs): return tuple(obj.name for obj in objs) in self.broken - def set_assembled(self, objs, is_assembled): - assert len(objs) == 1, f"`objs` has len other than 1: {objs}" - if is_assembled: - self.assembled.add(objs) - else: - self.assembled.discard(objs) - - def get_assembled(self, objs): - return tuple(obj.name for obj in objs) in self.assembled - def set_future(self, objs, is_future): assert len(objs) == 1, f"`objs` has len other than 1: {objs}" if is_future: @@ -458,9 +445,6 @@ def get_empty(self): def get_broken(self): return self.simulator.get_broken((self,)) - def get_assembled(self): - return self.simulator.get_assembled((self,)) - def get_future(self): return self.simulator.get_future((self,)) @@ -640,17 +624,6 @@ def _sample(self, obj1, binary_state): pass -class TrivialAssembledPredicate(UnaryAtomicFormula): - STATE_NAME = "assembled" - - def _evaluate(self, obj): - print(self.STATE_NAME, obj.name, obj.get_assembled()) - return obj.get_assembled() - - def _sample(self, obj1, binary_state): - pass - - class TrivialFuturePredicate(UnaryAtomicFormula): STATE_NAME = "future"