Closed JustinS6626 closed 1 year ago
Hi @DarthMalloc. The observations you are getting are correct. The grid representation is a partial observation of the agent's point of view (represented in light grey in this image https://github.com/Farama-Foundation/Minigrid/blob/master/figures/door-key-curriculum.gif). If you'd like to get a full representation of the grid you can wrap the environment with the SymbolicObsWrapper
:
from minigrid.wrappers import SymbolicObsWrapper
env = SymbolicObsWrapper(gym.make('EnvID'))
There is also a FullObsWrapper
that will give you the integer array representation of the whole grid
Thank you very much for getting back to me so soon! Your response helps me a great deal! There is one last thing I was wondering - I noticed that the for the MiniGridEnv object class, there is a boolean parameter agent_pov, which is set to False by default. If this parameter is set to True, does it make the integer value for the agent appear within the observation array?
No, I believe it gets the observation in terms of the agent's point of view rather than the whole grid https://github.com/Farama-Foundation/Minigrid/blob/da409c4fc6db880613c819ab097d22522e602196/minigrid/minigrid_env.py#L723
Question
I am doing an RL experiment with the minigrid environment, so I ran a short test program to do a sanity check on the environment, in which I did a print of the integer array representation of the environment observation. I posted a screenshot here which shows the observation array:
The file constants.py in the core folder shows that integer value for the agent within the encoded observation should be 10, but none of the tile tuples show that value in the first term. Is that supposed to be the case? It prevents the agent from getting exact information about its position within the environment.