Farama-Foundation / Minigrid

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

Extra observations erased by wrappers #181

Closed howardh closed 2 years ago

howardh commented 2 years ago

I've created a custom Minigrid environment that returns additional information in the observation, but those get removed when they pass through the observation wrappers. Is this intentional behaviour (i.e. should I not be adding extra info this way)? Or can the wrappers be modified to handle this scenario?

This should just be a simple change of the return statements from

        return {
            'mission': obs['mission'],
            'image': out
        }

to

        return {
            **obs,
            'image': out
        }
maximecb commented 2 years ago

Open to accepting this fix if you're willing to test it out and open a pull request 👍

howardh commented 2 years ago

What's your usual procedure for testing? I see you have a run_tests.py script, but I don't see a nice way to fit this in there. Would you be open to switching the testing setup to something like pytest?

maximecb commented 2 years ago

Well there are some wrappers in run_tests.py. I would rather not introduce a new dependency.

pseudo-rnd-thoughts commented 2 years ago

Fixed by https://github.com/Farama-Foundation/gym-minigrid/pull/182