Skip to content

Commit

Permalink
try this?
Browse files Browse the repository at this point in the history
  • Loading branch information
NishanthJKumar committed Oct 18, 2023
1 parent ac5d87d commit c35023c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion predicators/envs/sticky_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
29 changes: 20 additions & 9 deletions predicators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion scripts/configs/active_sampler_learning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c35023c

Please sign in to comment.