Skip to content

Commit

Permalink
trying something new
Browse files Browse the repository at this point in the history
  • Loading branch information
NishanthJKumar committed Oct 17, 2023
1 parent 652a2a9 commit b20fe9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions 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.3 * (state.get(table, "radius") - (state.get(cube, "size") / 2)):
if self.sticky_surface_mode == "half" and act_y < table_y + 0.35 * (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 Expand Up @@ -392,11 +392,11 @@ def _get_tasks(self, num: int,
# rng.shuffle(tables) # type: ignore
# 33-66 probability that goal is one table
# or another.
if rng.random() < 0.3333:
target_table = tables[-1]
else:
target_table = tables[0]
cube_table, cup_table = tables[-3:-1]
# if rng.random() < 0.3333:
target_table = tables[-1]
# else:
# target_table = tables[0]
cube_table, cup_table, ball_table = tables[-4:-1]
# Create cube.
size = radius * self.objs_scale
table_x = state_dict[cube_table]["x"]
Expand Down Expand Up @@ -436,9 +436,13 @@ def _get_tasks(self, num: int,
if self._OnTable_holds(state, [cup, cup_table]):
break
# Create ball.
table_x = state_dict[ball_table]["x"]
table_y = state_dict[ball_table]["y"]
while True:
x = rng.uniform(self.x_lb, self.x_ub)
y = rng.uniform(self.y_lb, self.y_ub)
theta = rng.uniform(0, 2 * np.pi)
dist = rng.uniform(0, radius)
x = table_x + dist * np.cos(theta)
y = table_y + dist * np.sin(theta)
ball = Object("ball", self._ball_type)
state_dict[ball] = {
"x": x,
Expand All @@ -448,7 +452,7 @@ def _get_tasks(self, num: int,
"held": 0.0
}
state = utils.create_state_from_dict(state_dict)
if self._OnFloor_holds(state, [ball]):
if self._OnTable_holds(state, [ball, ball_table]):
break
# Create robot.
while True:
Expand Down
4 changes: 2 additions & 2 deletions scripts/configs/active_sampler_learning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ FLAGS:
active_sampler_learning_model: "myopic_classifier_mlp"
active_sampler_learning_use_teacher: False
online_nsrt_learning_requests_per_cycle: 1
max_num_steps_interaction_request: 20
num_online_learning_cycles: 13
max_num_steps_interaction_request: 24
num_online_learning_cycles: 10
sesame_task_planner: "fdopt-costs"
sesame_grounder: "fd_translator"
horizon: 12
Expand Down

0 comments on commit b20fe9f

Please sign in to comment.