maxspahn / gym_envs_urdf

URDF environments for gym
https://maxspahn.github.io/gym_envs_urdf/
GNU General Public License v3.0
46 stars 14 forks source link

Adds option to flatten the observation. #84

Closed maxspahn closed 2 years ago

maxspahn commented 2 years ago

Adds the option to flatten the observations from a dict to a plain numpy.ndarray. This could be beneficial for some RL-users.

maxspahn commented 2 years ago

The observation is flattened after it is being checked. So for checking it is not necessary to flatten the observation space as well. As a RL user, do you also need to explicitly access the observation space? If so, you are right and we need to also flatten the observation space.

@alxschwrz

alxschwrz commented 2 years ago

Okay got it. Many RL frameworks (e.g. SB3) check the observations against the initialized observation_space during training. I expect, that an error is thrown during training in that case. If we would like to be compatible with them without further manual changes of RL users, we should also set the correct spaces when initialising the environment. Could also be subject to a further PR though, since there would need to be some more changes to be compatible for RL usage anyway.