Skip to content

Commit bb534bf

Browse files
committed
Edit pybullet coffee so that INTERPRET can run, and add render=True to.
1 parent a2527d2 commit bb534bf

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

predicators/cogman.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ def run_episode_and_get_observations(
215215
render_obs = cogman.get_approach_name == "oracle" and\
216216
CFG.offline_data_method == "geo_and_demo_with_vlm_imgs"
217217
if isinstance(env, PyBulletEnv):
218-
obs = env.get_observation(render=render_obs)
218+
# obs = env.get_observation(render=render_obs)
219+
obs = env.get_observation(render=True)
219220
else:
220-
obs = env.get_observation()
221+
obs = env.get_observation(render=True)
221222
observations = [obs]
222223
actions: List[Action] = []
223224
curr_option: Optional[_Option] = None

predicators/datasets/generate_atom_trajs_with_vlm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ def _generate_ground_atoms_with_vlm_pure_visual_preds(
750750
vlm: VisionLanguageModel) -> List[List[Set[GroundAtom]]]:
751751
"""Given a collection of ImageOptionTrajectories, query a VLM to convert
752752
these into ground atom trajectories."""
753-
import pdb; pdb.set_trace()
754753
if not CFG.grammar_search_vlm_atom_proposal_use_debug:
755754
logging.info("Querying VLM for candidate atom proposals...")
756755
atom_strs_proposals_list = _sample_vlm_atom_proposals_from_trajectories(
@@ -1128,6 +1127,7 @@ def create_ground_atom_data_from_generated_demos(
11281127
generate_func = _generate_ground_atoms_with_vlm_pure_visual_preds
11291128
ground_atoms_trajs = generate_func(img_option_trajs, env, train_tasks,
11301129
known_predicates, all_task_objs, vlm)
1130+
# return Dataset(option_segmented_trajs, None)
11311131
return Dataset(option_segmented_trajs, ground_atoms_trajs)
11321132

11331133

predicators/envs/pybullet_coffee.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
create_single_arm_pybullet_robot
4949
from predicators.settings import CFG
5050
from predicators.structs import Action, Array, EnvironmentTask, Object, \
51-
Predicate, State, Observation, Task
51+
Predicate, State, Observation, Task, Type
5252

5353
class PyBulletCoffeeEnv(PyBulletEnv, CoffeeEnv):
5454
"""PyBullet Coffee domain.
@@ -214,6 +214,14 @@ def pour_z_offset(cls) -> float:
214214
_camera_pitch: ClassVar[float]
215215
_camera_target: ClassVar[Pose3D]
216216

217+
# Types
218+
_table_type = Type("table", [])
219+
_robot_type = Type("robot", ["x", "y", "z", "tilt", "wrist", "fingers"])
220+
_jug_type = Type("jug", ["x", "y", "z", "rot", "is_held", "is_filled"])
221+
_machine_type = Type("coffee_machine", ["is_on"])
222+
_cup_type = Type("cup", ["x", "y", "z", "capacity_liquid", "target_liquid", "current_liquid"])
223+
_plug_type = Type("plug", ["x", "y", "z", "plugged_in"])
224+
217225
def __init__(self, use_gui: bool = True) -> None:
218226
super().__init__(use_gui)
219227

@@ -626,7 +634,6 @@ def _get_state(self, render_obs: bool = False) -> State:
626634
assert set(state) == set(self._current_state), \
627635
(f"Reconstructed state has objects {set(state)}, but "
628636
f"self._current_state has objects {set(self._current_state)}.")
629-
630637
return state
631638

632639
def step(self, action: Action, render_obs: bool = False) -> State:

0 commit comments

Comments
 (0)