forked from Learning-and-Intelligent-Systems/predicators
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d3dec5
commit c161cce
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |