- Notifications
You must be signed in to change notification settings - Fork 686
Description
System Info
Latest master branch on UbuntuInformation
I was debugging an issue with the robosuite rendering giving me noise, and claude found an issue with the import order of trimesh and robosuite (it was pretty impressive!). We might want to document this somewhere (e.g. if we have a known issues section of the website, but I can't find it)
Root Cause: import trimesh initializes an OpenGL context (via pyglet) that clobbers the EGL context that mujoco/robosuite uses for offscreen rendering. Previously, trimesh was imported lazily inside functions — this meant it was imported after the robosuite environment (and its EGL context) had already been created, destroying the GL state.
Fix: Moved import trimesh and import trimesh.transformations as tra to the top of the file (module level), before the robosuite environment is ever created. This way:
- Trimesh initializes its GL context first
- Robosuite then creates its own EGL context afterward, which takes precedence
- All subsequent rendering works correctly
Reproduction
Use trimesh and robosuite imports in the same script.
Expected behavior
No response