add render_mode to examples in README to make them work again

This commit is contained in:
JuliusJacobitz 2023-12-07 15:53:55 +01:00
parent dbd3caebb3
commit 5201937ac8

View File

@ -105,10 +105,10 @@ Regular step based environments added by Fancy Gym are added into the `fancy/` n
import gymnasium as gym
import fancy_gym
env = gym.make('fancy/Reacher5d-v0')
# or env = gym.make('metaworld/reach-v2') # fancy_gym allows access to all metaworld ML1 tasks via the metaworld/ NS
# or env = gym.make('dm_control/ball_in_cup-catch-v0')
# or env = gym.make('Reacher-v2')
env = gym.make('fancy/Reacher5d-v0', render_mode='human')
# or env = gym.make('metaworld/reach-v2', render_mode='human') # fancy_gym allows access to all metaworld ML1 tasks via the metaworld/ NS
# or env = gym.make('dm_control/ball_in_cup-catch-v0', render_mode='human')
# or env = gym.make('Reacher-v2', render_mode='human')
observation = env.reset(seed=1)
for i in range(1000):
@ -149,14 +149,10 @@ Just keep in mind, calling `step()` executes a full trajectory.
import gymnasium as gym
import fancy_gym
env = gym.make('fancy_ProMP/Reacher5d-v0')
# or env = gym.make('metaworld_ProDMP/reach-v2')
# or env = gym.make('dm_control_DMP/ball_in_cup-catch-v0')
# or env = gym.make('gym_ProMP/Reacher-v2') # mp versions of envs added directly by gymnasium are in the gym_<MP-type> NS
# render() can be called once in the beginning with all necessary arguments.
# To turn it of again just call render() without any arguments.
env.render(mode='human')
env = gym.make('fancy_ProMP/Reacher5d-v0', render_mode="human")
# or env = gym.make('metaworld_ProDMP/reach-v2', render_mode="human")
# or env = gym.make('dm_control_DMP/ball_in_cup-catch-v0', render_mode="human")
# or env = gym.make('gym_ProMP/Reacher-v2', render_mode="human") # mp versions of envs added directly by gymnasium are in the gym_<MP-type> NS
# This returns the context information, not the full state observation
observation, info = env.reset(seed=1)