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

Fix `FlatObsWrapper` obs dtype #435

Closed pseudo-rnd-thoughts closed 5 months ago

pseudo-rnd-thoughts commented 5 months ago

Description

Fixes the following problem reported in issue #434 through modifying the dtype of the new obs array to uint8

import gymnasium
from minigrid.wrappers import FlatObsWrapper

env = FlatObsWrapper(gymnasium.make("MiniGrid-Empty-5x5-v0"))
observation, info = env.reset(seed=42)
print(env.observation_space.dtype)
print(observation.dtype)
assert env.observation_space.dtype == observation.dtype