From c35023c0314cbd47aa5ab19cbebd816dad03ddca Mon Sep 17 00:00:00 2001 From: Nishanth Kumar Date: Wed, 18 Oct 2023 15:00:51 -0400 Subject: [PATCH] try this? --- predicators/envs/sticky_table.py | 2 +- predicators/utils.py | 29 ++++++++++++++------ scripts/configs/active_sampler_learning.yaml | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/predicators/envs/sticky_table.py b/predicators/envs/sticky_table.py index 1267c975fe..b50430aa41 100644 --- a/predicators/envs/sticky_table.py +++ b/predicators/envs/sticky_table.py @@ -191,7 +191,7 @@ def simulate(self, state: State, action: Action) -> State: if self._table_is_sticky(table, state): # Check if placing on the smooth side of the sticky table. table_y = state.get(table, "y") - if self.sticky_surface_mode == "half" and act_y < table_y + 0.35 * (state.get(table, "radius") - (state.get(cube, "size") / 2)): + if self.sticky_surface_mode == "half" and act_y < table_y + 0.4 * (state.get(table, "radius") - (state.get(cube, "size") / 2)): if obj_being_held in [cube, cup]: fall_prob = self._place_smooth_fall_prob else: diff --git a/predicators/utils.py b/predicators/utils.py index d495745c1b..aa202df8f6 100644 --- a/predicators/utils.py +++ b/predicators/utils.py @@ -305,20 +305,31 @@ def construct_active_sampler_input(state: State, objects: Sequence[Object], robot_x = state.get(robot, "x") table_y = state.get(table, "y") table_x = state.get(table, "x") + ball_x = state.get(ball, "x") + ball_y = state.get(ball, "y") + cup_x = state.get(cup, "x") + cup_y = state.get(cup, "y") sticky = state.get(table, "sticky") table_radius = state.get(table, "radius") a, b, c, param_x, param_y = params sampler_input_lst.append(table_radius) sampler_input_lst.append(sticky) - sampler_input_lst.append(robot_x) - sampler_input_lst.append(robot_y) - sampler_input_lst.append(table_x) - sampler_input_lst.append(table_y) - sampler_input_lst.append(a) - sampler_input_lst.append(b) - sampler_input_lst.append(c) - sampler_input_lst.append(param_x) - sampler_input_lst.append(param_y) + # sampler_input_lst.append(ball_x) + # sampler_input_lst.append(ball_y) + # sampler_input_lst.append(cup_x) + # sampler_input_lst.append(cup_y) + # sampler_input_lst.append(robot_x) + # sampler_input_lst.append(robot_y) + # sampler_input_lst.append(table_x) + # sampler_input_lst.append(table_y) + # sampler_input_lst.append(a) + # sampler_input_lst.append(b) + # sampler_input_lst.append(c) + # sampler_input_lst.append(param_x) + # sampler_input_lst.append(param_y) + sampler_input_lst.append(param_x - table_x) + sampler_input_lst.append(param_y - table_y) + # if "Place" in param_option.name and "Table" in param_option.name: # table = objects[-1] # robot = objects[0] diff --git a/scripts/configs/active_sampler_learning.yaml b/scripts/configs/active_sampler_learning.yaml index b926354cdf..d9b40dd116 100644 --- a/scripts/configs/active_sampler_learning.yaml +++ b/scripts/configs/active_sampler_learning.yaml @@ -90,6 +90,6 @@ FLAGS: sesame_task_planner: "fdopt-costs" sesame_grounder: "fd_translator" horizon: 8 - active_sampler_learning_feature_selection: oracle + active_sampler_learning_feature_selection: all START_SEED: 456 NUM_SEEDS: 10