Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tsilver-bdai committed Jul 18, 2023
1 parent 0d3dec5 commit c161cce
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/kitchen_precompute_prm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Precompute a PRM-ish database for free space moving in the kitchen env."""

import numpy as np

from predicators.envs.kitchen import KitchenEnv
from predicators import utils


def _main() -> None:
utils.reset_config({
"env": "kitchen",
"num_train_tasks": 1,
"num_test_tasks": 0,
})
env = KitchenEnv()
# Set up initial state with kettle out of the way.
env.reset("train", 0)
gym_env = env._gym_env

joint_state, _ = gym_env.get_env_state()
joint_state[23:26] = -100 # kettle, way off screen
gym_env.sim.set_state(joint_state)
gym_env.sim.forward()

gym_env.step(np.zeros(9))
gym_env.render()
import time; time.sleep(5)


if __name__ == "__main__":
_main()

0 comments on commit c161cce

Please sign in to comment.