Skip to content

Commit

Permalink
Merge pull request #262 from StanfordVL/only-scene-object-inroom
Browse files Browse the repository at this point in the history
only scene objects are allowed to have inroom predicate in bddls
  • Loading branch information
ChengshuLi authored Feb 23, 2024
2 parents 83a07e1 + ffb3a97 commit 1f8472b
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions bddl/activity_definitions/changing_light_bulbs/problem0.bddl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
(attached light_bulb.n.01_2 table_lamp.n.01_2)
)
(inroom floor.n.01_1 bedroom)
(inroom floor.n.01_2 dining_room)
(inroom table_lamp.n.01_1 bedroom)
(inroom floor.n.01_2 dining_room)
(ontop table_lamp.n.01_1 breakfast_table.n.01_1)
(inroom breakfast_table.n.01_1 dining_room)
(ontop agent.n.01_1 floor.n.01_2)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
monitor.n.04_1 - monitor.n.04
dust.n.01_1 - dust.n.01
water.n.06_1 - water.n.06
table.n.02_1 - table.n.02
floor.n.01_1 - floor.n.01
agent.n.01_1 - agent.n.01
)
Expand All @@ -16,7 +17,8 @@
(insource sink.n.01_1 water.n.06_1)
(covered monitor.n.04_1 dust.n.01_1)
(inroom sink.n.01_1 bathroom)
(inroom monitor.n.04_1 computer_lab)
(inroom table.n.02_1 computer_lab)
(ontop monitor.n.04_1 table.n.02_1)
(inroom floor.n.01_1 computer_lab)
(ontop agent.n.01_1 floor.n.01_1)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
stain.n.01_1 - stain.n.01
water.n.06_1 - water.n.06
floor.n.01_1 - floor.n.01
table.n.02_1 - table.n.02
agent.n.01_1 - agent.n.01
)

Expand All @@ -21,8 +22,9 @@
(covered monitor.n.04_1 dust.n.01_1)
(covered monitor.n.04_1 stain.n.01_1)
(insource sink.n.01_1 water.n.06_1)
(inroom sink.n.01_1 bathroom)
(inroom monitor.n.04_1 shared_office)
(inroom sink.n.01_1 bathroom)
(ontop monitor.n.04_1 table.n.02_1)
(inroom table.n.02_1 shared_office)
(inroom floor.n.01_1 shared_office)
(ontop agent.n.01_1 floor.n.01_1)
)
Expand Down
3 changes: 1 addition & 2 deletions bddl/activity_definitions/clean_cement/problem0.bddl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
(:init
(ontop cement.n.01_1 floor.n.01_1)
(covered cement.n.01_1 dirt.n.02_1)
(ontop rail_fence.n.01_1 floor.n.01_1)
(ontop watering_can.n.01_1 floor.n.01_1)
(ontop watering_can.n.01_1 floor.n.01_1)
(ontop scrub_brush.n.01_1 floor.n.01_1)
(insource watering_can.n.01_1 water.n.06_1)
(filled detergent__bottle.n.01_1 detergent.n.02_1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
(ontop lawn_chair.n.01_2 floor.n.01_1)
(ontop lawn_chair.n.01_3 floor.n.01_1)
(ontop lawn_chair.n.01_4 floor.n.01_1)
(ontop coffee_table.n.01_1 floor.n.01_1)
(ontop bucket.n.01_1 coffee_table.n.01_1)
(ontop bucket.n.01_1 coffee_table.n.01_1)
(filled bucket.n.01_1 water.n.06_1)
(filled liquid_soap__bottle.n.01_1 liquid_soap.n.01_1)
(ontop liquid_soap__bottle.n.01_1 coffee_table.n.01_1)
Expand Down
1 change: 0 additions & 1 deletion bddl/activity_definitions/cleaning_the_yard/problem0.bddl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
)

(:init
(ontop rail_fence.n.01_1 floor.n.01_1)
(ontop scrub.n.01_1 lawn.n.01_1)
(ontop entire_leaf.n.01_1 lawn.n.01_1)
(ontop ashcan.n.01_1 lawn.n.01_1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
(ontop wreath.n.01_1 coffee_table.n.01_1)
(ontop holly.n.03_1 coffee_table.n.01_1)
(ontop bow.n.08_1 coffee_table.n.01_1)
(ontop wall.n.01_1 floor.n.01_1)
(not
(attached wreath.n.01_1 wall.n.01_1)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
(inside egg.n.02_2 tupperware.n.01_1)
(filled olive_oil__bottle.n.01_1 olive_oil.n.01_1)
(ontop olive_oil__bottle.n.01_1 countertop.n.01_1)
(inside cabinet.n.01_1 countertop.n.01_1)
(inside bowl.n.01_1 cabinet.n.01_1)
(inside bowl.n.01_1 cabinet.n.01_1)
(inside bowl.n.01_2 cabinet.n.01_1)
(inside frying_pan.n.01_1 cabinet.n.01_1)
(inside tupperware.n.01_1 electric_refrigerator.n.01_1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
(attached mirror.n.01_1 wall.n.01_1)
(inroom floor.n.01_1 bathroom)
(inroom wall.n.01_1 bathroom)
(inroom mirror.n.01_1 bathroom)
(ontop agent.n.01_1 floor.n.01_1)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
blackboard.n.01_1 - blackboard.n.01
table.n.02_1 table.n.02_10 table.n.02_2 table.n.02_3 table.n.02_4 table.n.02_5 table.n.02_6 table.n.02_7 table.n.02_8 table.n.02_9 - table.n.02
wall_clock.n.01_1 - wall_clock.n.01
map.n.01_1 - map.n.01
chair.n.01_1 chair.n.01_10 chair.n.01_2 chair.n.01_3 chair.n.01_4 chair.n.01_5 chair.n.01_6 chair.n.01_7 chair.n.01_8 chair.n.01_9 - chair.n.01
agent.n.01_1 - agent.n.01
)
Expand Down Expand Up @@ -58,7 +57,6 @@
(inroom table.n.02_9 classroom)
(inroom table.n.02_10 classroom)
(inroom wall_clock.n.01_1 classroom)
(inroom map.n.01_1 classroom)
(inroom chair.n.01_1 classroom)
(inroom chair.n.01_2 classroom)
(inroom chair.n.01_3 classroom)
Expand Down
1 change: 0 additions & 1 deletion bddl/activity_definitions/stock_a_bar_cart/problem0.bddl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
(ontop serving_cart.n.01_1 floor.n.01_1)
(inroom shelf.n.01_1 kitchen)
(inroom cabinet.n.01_1 kitchen)
(inroom serving_cart.n.01_1 kitchen)
(ontop agent.n.01_1 floor.n.01_1)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(inside belt.n.02_1 wicker_basket.n.01_1)
(inside underwear.n.01_1 wicker_basket.n.01_1)
(inside scarf.n.01_1 wicker_basket.n.01_1)
(inroom wicker_basket.n.01_1 closet)
(ontop wicker_basket.n.01_1 floor.n.01_1)
(inroom wardrobe.n.01_1 closet)
(inroom floor.n.01_1 closet)
(ontop agent.n.01_1 floor.n.01_1)
Expand Down
6 changes: 5 additions & 1 deletion bddl/bddl_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ def check_synset_predicate_alignment(atom, syns_to_props):
assert ("drapeable" in syns_to_props[objects[0]]) and ("rigidBody" in syns_to_props[objects[1]]), f"Inapplicable overlaid: {atom}"
if pred == "insource":
assert (("particleSource" in syns_to_props[objects[0]]) or ("particleApplier" in syns_to_props[objects[0]])) and ("substance" in syns_to_props[objects[1]]), f"Inapplicable insource: {atom}"

if pred == "inroom":
assert "sceneObject" in syns_to_props[objects[0]], f"Inapplicable inroom: {atom}"

def check_clashing_transition_rules():
# Check within each submap
Expand Down Expand Up @@ -477,6 +478,7 @@ def all_objects_placed(init):

in_room_check = True
last_placed = None
in_room_placed = set()
while True:
newly_placed = set()
for literal in init:
Expand All @@ -493,10 +495,12 @@ def all_objects_placed(init):
# For the first round, check for inroom
if (formula[0] == "inroom") and (formula[2] in ROOMS):
inst = formula[1]
in_room_placed.add(inst)
else:
# For the following rounds, check for placements w.r.t last placed objects
if (formula[0] in PLACEMENTS) and (formula[2] in last_placed):
inst = formula[1]
assert inst not in in_room_placed, f"Object {inst} is placed twice"
# Or substasnce placements w.r.t last placed objects
elif (formula[0] in SUBSTANCE_PLACEMENTS) and (formula[1] in last_placed):
inst = formula[2]
Expand Down

0 comments on commit 1f8472b

Please sign in to comment.