浏览代码

Added test for RGBImgPartialObsWrapper

Maxime Chevalier-Boisvert 5 年之前
父节点
当前提交
e8ab55e309
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 1 1
      manual_control.py
  2. 9 1
      run_tests.py

+ 1 - 1
manual_control.py

@@ -84,7 +84,7 @@ parser.add_argument(
 parser.add_argument(
     '--agent_view',
     default=False,
-    help="Draw the agent's partially observable view",
+    help="draw the agent sees only (partially observable view)",
     action='store_true'
 )
 

+ 9 - 1
run_tests.py

@@ -91,6 +91,14 @@ for env_name in env_list:
     assert obs['image'].shape == env.observation_space.spaces['image'].shape
     env.close()
 
+    # RGB image observation wrapper
+    env = gym.make(env_name)
+    env = RGBImgPartialObsWrapper(env)
+    env.reset()
+    obs, _, _, _ = env.step(0)
+    assert obs['image'].mean() > 0
+    env.close()
+
     env = gym.make(env_name)
     env = FlatObsWrapper(env)
     env.reset()
@@ -117,7 +125,7 @@ for env_name in env_list:
         ), "Observation space for {0} is not a Dict: {1}.".format(
             wrapper_name, obs_space
         )
-        # this shuld not fail either
+        # This should not fail either
         ImgObsWrapper(env)
 
 ##############################################################################