Farama-Foundation / Minigrid

Simple and easily configurable grid world environments for reinforcement learning
https://minigrid.farama.org/
Other
2.09k stars 604 forks source link

Wrapper implementation questions #312

Closed shukla-yash closed 1 year ago

shukla-yash commented 1 year ago

Hi,

  1. For FullyObsWrapper, is the direction of the agent incorporated in the ['image'] field of the observation? Is there an easy way to add that to the observation?

  2. For SymbolicObsWrapper, if each tile is represented using (X, Y, IDX), how is the state of the door incorporated?

  3. In RGBImgObsWrapper, does the observation reflect any items the agent is carrying?

Thanks!

rodrigodelazcano commented 1 year ago

Hey @shukla-yash!

  1. Yes, the direction of the agent is encoded in the third dimension of the image array (x_position_of_agent, y_position_of_agent, direction_of_agent) https://github.com/Farama-Foundation/Minigrid/blob/9677ebc899f045532aa4880496c0c18ac0b99428/minigrid/wrappers.py#L426 The integer values to which the agent's direction is encoded are:

    • 0: East
    • 1: South
    • 2: West
    • 3: North
  2. The SymbolicObsWrapper is not meant for encoding the state of the objects in the image, only object locations. If you want to also encode the states you should use the image observation from the FullyObsWrapper

  3. If any object is picked up it will disappear from the map and future observations, this should be enough to represent the state of the environment. Also, note that only one item at a time can be picked up by the agent.

Hope this solved all of your questions.

shukla-yash commented 1 year ago

Thanks for your reply :)