From de28334a70ae74ed66097d2e547acb19a122787f Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 9 Sep 2017 16:36:42 -0700 Subject: [PATCH] tweak to testEnv.py, sample usage: python testEnv.py --rgb=1 --render=1 --step=100000 --env="HumanoidBulletEnv-v0" --- examples/pybullet/gym/pybullet_envs/examples/testEnv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/pybullet/gym/pybullet_envs/examples/testEnv.py b/examples/pybullet/gym/pybullet_envs/examples/testEnv.py index e43131cb8..8b8d0ed31 100644 --- a/examples/pybullet/gym/pybullet_envs/examples/testEnv.py +++ b/examples/pybullet/gym/pybullet_envs/examples/testEnv.py @@ -22,6 +22,8 @@ def test(args): print(action) for i in range(args.steps): obs,rewards,done,_ =env.step(action) + if (args.rgb): + print(env.render(mode="rgb_array")) print("obs=") print(obs) print("rewards") @@ -35,7 +37,8 @@ def main(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--env', help='environment ID', default='AntBulletEnv-v0') parser.add_argument('--seed', help='RNG seed', type=int, default=0) - parser.add_argument('--render', help='Render in OpenGL Window', type=str, default=0) + parser.add_argument('--render', help='OpenGL Visualizer', type=int, default=0) + parser.add_argument('--rgb',help='rgb_array gym rendering',type=int, default=0) parser.add_argument('--steps', help='Number of steps', type=int, default=1) parser.add_argument('--bla',help='bla',type=int, default=42) args = parser.parse_args()