@@ -869,6 +869,7 @@ class MiniGridEnv(gym.Env):
Set the agent's starting point at an empty position in the grid
"""
+ self.start_pos = None
pos = self.place_obj(None, top, size)
self.start_pos = pos
@@ -43,6 +43,10 @@ for envName in env_list:
obs, reward, done, info = env.step(action)
+ # Validate the agent position
+ assert env.agent_pos[0] < env.grid_size
+ assert env.agent_pos[1] < env.grid_size
+
# Test observation encode/decode roundtrip
img = obs['image']
grid = Grid.decode(img)