-
Notifications
You must be signed in to change notification settings - Fork 241
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
34575c2
commit 56c87ba
Showing
3 changed files
with
81 additions
and
62 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
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,18 @@ | ||
import gymnasium as gym | ||
import rlbench.gym | ||
|
||
if __name__ == "__main__": | ||
# Only works with spawn (multiprocessing) context | ||
env = gym.make_vec('reach_target-vision-v0', num_envs=2, vectorization_mode="async", vector_kwargs={"context": "spawn"}) | ||
|
||
training_steps = 120 | ||
episode_length = 40 | ||
for i in range(training_steps): | ||
if i % episode_length == 0: | ||
print('Reset Episode') | ||
obs = env.reset() | ||
obs, reward, terminate, _, _ = env.step(env.action_space.sample()) | ||
env.render() # Note: rendering increases step time. | ||
|
||
print('Done') | ||
env.close() |
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