-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering with render_mode="rgb_array" does not work properly when rendering multiple envs #448
Comments
Hi! Thanks for opening this issue. This is really interesting. It probably has something to do with Mujoco, not Meta-World itself. Let me investigate a little bit. I can reproduce the issue on my end. If it's not a Meta-World/Gymnasium issue you may have to open an issue with Mujoco. |
@ManfredStoiber this issue is because of the OpenGL context that is used to render by Mujoco. When you render in env1 the viewer is created and given the "current context." Rendering in env2 is the same. However when you go back to env1, the viewer is reused from the first render call and isn't explicitly given the current context back. If you look at the issue I opened Farama-Foundation/Gymnasium#736 you can find a suggested fix that you can try. It seems to work on my machine but let me know if it doesn't work for you. |
It works! Thank you very much for your quick reply and your help. |
@ManfredStoiber it seems like this is going to be fixed within Meta-World so I am going to re-open the issue so we can track it. |
Is this bug still present with gymnasium 1.0 and the latest version of meta world? |
When using multiple environments, a strange behavior occurs during rendering in mode "rgb_array":
Here is a minimum example for reproduction:
Output:
Also the images are upside down when using different cameras than default, but that's also the case when using only one environment.
I noticed that the problem does not occur with every combination of environments, for example "pick-place-v2" and "reach-v2" work together, whereas "pick-place-v2" and "basketball-v2" don't. Maybe because the former combination use the same objects and the latter use different objects?
Thank you very much!
The text was updated successfully, but these errors were encountered: