Skip to content

Commit

Permalink
oracle works on coffee
Browse files Browse the repository at this point in the history
  • Loading branch information
yichao-liang committed Nov 20, 2024
1 parent 2f340f3 commit 69cc653
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
36 changes: 14 additions & 22 deletions predicators/envs/pybullet_coffee.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
"""A PyBullet version of CoffeeEnv."""
"""A PyBullet version of CoffeeEnv.
python predicators/main.py --env pybullet_coffee --approach oracle --seed 0 \
--coffee_rotated_jug_ratio 0.5 \
--sesame_check_expected_atoms False --coffee_jug_pickable_pred True \
--pybullet_control_mode "reset" --coffee_twist_sampler False
"""

import logging
from pathlib import Path
Expand Down Expand Up @@ -953,27 +958,14 @@ def step(self, action: Action) -> State:
physicsClientId=self._physics_client_id)

if self._PressingButton_holds(state, [self._robot, self._machine]):
if CFG.coffee_mac_requires_jug_to_turn_on:
if self._JugInMachine_holds(state, [self._jug, self._machine]):
p.changeVisualShape(
self._button_id,
-1,
rgbaColor=self.button_color_on,
physicsClientId=self._physics_client_id)
p.changeVisualShape(
self._button_id,
0,
rgbaColor=self.button_color_on,
physicsClientId=self._physics_client_id)
else:
p.changeVisualShape(self._button_id,
-1,
rgbaColor=self.button_color_on,
physicsClientId=self._physics_client_id)
p.changeVisualShape(self._button_id,
0,
rgbaColor=self.button_color_on,
physicsClientId=self._physics_client_id)
p.changeVisualShape(self._button_id,
-1,
rgbaColor=self.button_color_on,
physicsClientId=self._physics_client_id)
p.changeVisualShape(self._button_id,
0,
rgbaColor=self.button_color_on,
physicsClientId=self._physics_client_id)
# the jug is only filled if it's in the machine
if self._JugInMachine_holds(state, [self._jug, self._machine]):
if not self._jug_filled:
Expand Down
2 changes: 2 additions & 0 deletions predicators/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ def get_arg_specific_settings(cls, args: Dict[str, Any]) -> Dict[str, Any]:
# tasks take more actions to complete.
"pybullet_cover": 1000,
"pybullet_blocks": 1000,
"pybullet_coffee": 2000,
"doors": 1000,
"coffee": 1000,
"kitchen": 1000,
Expand Down Expand Up @@ -799,6 +800,7 @@ def get_arg_specific_settings(cls, args: Dict[str, Any]) -> Dict[str, Any]:
{
# For these environments, allow more skeletons.
"coffee": 1000,
"pybullet_coffee": 100,
"exit_garage": 1000,
"tools": 1000,
"stick_button": 1000,
Expand Down
4 changes: 2 additions & 2 deletions scripts/configs/pred_invention_vlm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ ENVS:
num_train_tasks: 5 #0 # pybullet_coffee, cover
excluded_predicates: all
coffee_num_cups_train: '[1]'
coffee_rotated_jug_ratio: 0
coffee_rotated_jug_ratio: 0.5
pybullet_camera_height: 900 # for high quality, use 900
pybullet_camera_width: 1200 # 1200 for coffee
pybullet_control_mode: "reset" # need for blocks and coffee
rgb_observation: True
coffee_twist_sampler: False
coffee_combined_move_and_twist_policy: True
sesame_check_expected_atoms: False
coffee_jug_pickable_pred: True

# kitchen_boil_kettle:
# NAME: "kitchen"
Expand Down

0 comments on commit 69cc653

Please sign in to comment.