From 1bda23742cbe0576b2aa64afb57417f7d0655a31 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Mon, 1 Apr 2024 17:10:33 -0700 Subject: [PATCH 1/5] disable test_grasp --- tests/test_primitives.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_primitives.py b/tests/test_primitives.py index d41219ff3..af661b354 100644 --- a/tests/test_primitives.py +++ b/tests/test_primitives.py @@ -109,6 +109,7 @@ def test_navigate(): assert primitive_tester(categories, objects, primitives, primitives_args) +@pytest.mark.skip(reason="primitives are broken") def test_grasp(): categories = ["floors", "ceilings", "walls", "coffee_table"] From f58263ed5a63fe2dcf77935d08385edc228f2bb8 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Mon, 1 Apr 2024 17:27:57 -0700 Subject: [PATCH 2/5] enable dryer rule test --- tests/test_transition_rules.py | 17 ++++++++++++----- tests/utils.py | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/test_transition_rules.py b/tests/test_transition_rules.py index c0e75fe7f..002aef577 100644 --- a/tests/test_transition_rules.py +++ b/tests/test_transition_rules.py @@ -23,7 +23,6 @@ import numpy as np -@pytest.mark.skip(reason="dryer is not fillable yet.") @og_test def test_dryer_rule(): assert len(REGISTERED_RULES) > 0, "No rules registered!" @@ -36,8 +35,8 @@ def test_dryer_rule(): og.sim.step() # Place the two objects inside the dryer - remover_dishtowel.set_position_orientation([0.0, 0.0, 0.4], [0, 0, 0, 1]) - bowl.set_position_orientation([0.0, 0.0, 0.5], [0, 0, 0, 1]) + remover_dishtowel.set_position_orientation([0.06, 0, 0.2], [0.0311883, -0.23199339, -0.06849886, 0.96980107]) + bowl.set_position_orientation([0.0, 0.0, 0.2], [0, 0, 0, 1]) og.sim.step() assert remover_dishtowel.states[Saturated].set_value(water, True) @@ -49,15 +48,23 @@ def test_dryer_rule(): # The rule will not execute if Open is True clothes_dryer.states[Open].set_value(True) + clothes_dryer.states[ToggledOn].set_value(True) og.sim.step() assert remover_dishtowel.states[Saturated].get_value(water) assert clothes_dryer.states[Contains].get_value(water) + # The rule will not execute if ToggledOn is False clothes_dryer.states[Open].set_value(False) - clothes_dryer.states[ToggledOn].set_value(True) + clothes_dryer.states[ToggledOn].set_value(False) + og.sim.step() - # The rule will execute when Open is False and ToggledOn is True + assert remover_dishtowel.states[Saturated].get_value(water) + assert clothes_dryer.states[Contains].get_value(water) + + # The rule will execute if Open is False and ToggledOn is True + clothes_dryer.states[Open].set_value(False) + clothes_dryer.states[ToggledOn].set_value(True) og.sim.step() # Need to take one more step for the state setters to take effect diff --git a/tests/utils.py b/tests/utils.py index d83af4b90..34b2b7b03 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -163,6 +163,7 @@ def assert_test_scene(): get_obj_cfg("half_apple", "half_apple", "sguztn"), get_obj_cfg("washer", "washer", "dobgmu"), get_obj_cfg("carpet_sweeper", "carpet_sweeper", "xboreo"), + get_obj_cfg("clothes_dryer", "clothes_dryer", "smcyys"), ], "robots": [ { From 8a6dd32de714b9370663fa31e0894b6858721040 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Tue, 2 Apr 2024 09:19:24 -0700 Subject: [PATCH 3/5] fix cook object transition rule test --- tests/test_transition_rules.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_transition_rules.py b/tests/test_transition_rules.py index 002aef577..bb89b2263 100644 --- a/tests/test_transition_rules.py +++ b/tests/test_transition_rules.py @@ -800,12 +800,12 @@ def test_cooking_object_rule_failure_wrong_container(): og.sim.step() # This fails the recipe because it requires the baking sheet to be inside the oven, not the stockpot - stockpot.set_position_orientation([0, 0, 0.47], [0, 0, 0, 1]) + stockpot.set_position_orientation([0, 0, 0.487], [0, 0, 0, 1]) og.sim.step() assert stockpot.states[Inside].get_value(oven) - bagel_dough.set_position_orientation([0, 0, 0.45], [0, 0, 0, 1]) - raw_egg.set_position_orientation([0.02, 0, 0.50], [0, 0, 0, 1]) + bagel_dough.set_position_orientation([0, 0, 0.464], [0, 0, 0, 1]) + raw_egg.set_position_orientation([0.02, 0, 0.506], [0, 0, 0, 1]) og.sim.step() assert bagel_dough.states[Inside].get_value(stockpot) assert raw_egg.states[OnTop].get_value(bagel_dough) From 77fe6c4ac24cde649c24104c2eb5cdeb65e1d620 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Tue, 2 Apr 2024 09:59:23 -0700 Subject: [PATCH 4/5] fix cook object success tests --- tests/test_transition_rules.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_transition_rules.py b/tests/test_transition_rules.py index bb89b2263..28a0706b2 100644 --- a/tests/test_transition_rules.py +++ b/tests/test_transition_rules.py @@ -842,7 +842,7 @@ def test_cooking_object_rule_failure_recipe_objects(): place_obj_on_floor_plane(oven) og.sim.step() - baking_sheet.set_position_orientation([0, 0, 0.455], [0, 0, 0, 1]) + baking_sheet.set_position_orientation([0.0, 0.05, 0.455], [0, 0, 0, 1]) og.sim.step() assert baking_sheet.states[Inside].get_value(oven) @@ -884,12 +884,12 @@ def test_cooking_object_rule_failure_unary_states(): place_obj_on_floor_plane(oven) og.sim.step() - baking_sheet.set_position_orientation([0, 0, 0.455], [0, 0, 0, 1]) + baking_sheet.set_position_orientation([0.0, 0.05, 0.455], [0, 0, 0, 1]) og.sim.step() assert baking_sheet.states[Inside].get_value(oven) - bagel_dough.set_position_orientation([0, 0, 0.5], [0, 0, 0, 1]) - raw_egg.set_position_orientation([0.02, 0, 0.55], [0, 0, 0, 1]) + bagel_dough.set_position_orientation([0, 0, 0.492], [0, 0, 0, 1]) + raw_egg.set_position_orientation([0.02, 0, 0.534], [0, 0, 0, 1]) og.sim.step() assert bagel_dough.states[OnTop].get_value(baking_sheet) assert raw_egg.states[OnTop].get_value(bagel_dough) @@ -927,12 +927,12 @@ def test_cooking_object_rule_failure_binary_system_states(): place_obj_on_floor_plane(oven) og.sim.step() - baking_sheet.set_position_orientation([0, 0, 0.455], [0, 0, 0, 1]) + baking_sheet.set_position_orientation([0.0, 0.05, 0.455], [0, 0, 0, 1]) og.sim.step() assert baking_sheet.states[Inside].get_value(oven) - bagel_dough.set_position_orientation([0, 0, 0.5], [0, 0, 0, 1]) - raw_egg.set_position_orientation([0.02, 0, 0.55], [0, 0, 0, 1]) + bagel_dough.set_position_orientation([0, 0, 0.492], [0, 0, 0, 1]) + raw_egg.set_position_orientation([0.02, 0, 0.534], [0, 0, 0, 1]) og.sim.step() assert bagel_dough.states[OnTop].get_value(baking_sheet) assert raw_egg.states[OnTop].get_value(bagel_dough) @@ -970,11 +970,11 @@ def test_cooking_object_rule_failure_binary_object_states(): place_obj_on_floor_plane(oven) og.sim.step() - baking_sheet.set_position_orientation([0, 0, 0.455], [0, 0, 0, 1]) + baking_sheet.set_position_orientation([0.0, 0.05, 0.455], [0, 0, 0, 1]) og.sim.step() assert baking_sheet.states[Inside].get_value(oven) - bagel_dough.set_position_orientation([0, 0, 0.5], [0, 0, 0, 1]) + bagel_dough.set_position_orientation([0, 0, 0.492], [0, 0, 0, 1]) raw_egg.set_position_orientation([0.12, 0.15, 0.47], [0, 0, 0, 1]) og.sim.step() assert bagel_dough.states[OnTop].get_value(baking_sheet) @@ -1062,12 +1062,12 @@ def test_cooking_object_rule_success(): place_obj_on_floor_plane(oven) og.sim.step() - baking_sheet.set_position_orientation([0, 0, 0.455], [0, 0, 0, 1]) + baking_sheet.set_position_orientation([0.0, 0.05, 0.455], [0, 0, 0, 1]) og.sim.step() assert baking_sheet.states[Inside].get_value(oven) - bagel_dough.set_position_orientation([0, 0, 0.5], [0, 0, 0, 1]) - raw_egg.set_position_orientation([0.02, 0, 0.55], [0, 0, 0, 1]) + bagel_dough.set_position_orientation([0, 0, 0.492], [0, 0, 0, 1]) + raw_egg.set_position_orientation([0.02, 0, 0.534], [0, 0, 0, 1]) og.sim.step() assert bagel_dough.states[OnTop].get_value(baking_sheet) assert raw_egg.states[OnTop].get_value(bagel_dough) From 4947beca4f0ce341b9d6e82cbae58690dbf386af Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Tue, 2 Apr 2024 10:44:53 -0700 Subject: [PATCH 5/5] disable all primitive tests --- tests/test_primitives.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_primitives.py b/tests/test_primitives.py index af661b354..d53717cc5 100644 --- a/tests/test_primitives.py +++ b/tests/test_primitives.py @@ -92,6 +92,7 @@ def primitive_tester(load_object_categories, objects, primitives, primitives_arg return True +@pytest.mark.skip(reason="primitives are broken") def test_navigate(): categories = ["floors", "ceilings", "walls"] @@ -127,6 +128,7 @@ def test_grasp(): assert primitive_tester(categories, objects, primitives, primitives_args) +@pytest.mark.skip(reason="primitives are broken") def test_place(): categories = ["floors", "ceilings", "walls", "coffee_table"]