Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Colab support for example notebooks #154

Merged
merged 5 commits into from
May 21, 2024
Merged

Conversation

flferretti
Copy link
Collaborator

@flferretti flferretti commented May 20, 2024

This PR restore the support for Google Colab for the example notebooks previously removed in #152.


馃摎 Documentation preview 馃摎: https://jaxsim--154.org.readthedocs.build//154/

@flferretti flferretti self-assigned this May 20, 2024
@flferretti flferretti requested a review from xela-95 May 21, 2024 09:47
@flferretti flferretti marked this pull request as ready for review May 21, 2024 09:47
@flferretti
Copy link
Collaborator Author

I had a small issue on the visualization that has been solved in bea65bc. Apparently in Colab, libGL requires a DISPLAY environment variable to be set. For this reason I used xvfb to create a dummy one.

Ready for review

@traversaro
Copy link
Contributor

Apparently in Colab, libGL requires a DISPLAY environment variable to be set. For this reason I used xvfb to create a dummy one.

That is strange, as long as you use egl that should not be necessary. Not blocking the PR, but what was the error?

@flferretti
Copy link
Collaborator Author

Apparently in Colab, libGL requires a DISPLAY environment variable to be set. For this reason I used xvfb to create a dummy one.

That is strange, as long as you use egl that should not be necessary. Not blocking the PR, but what was the error?

image

@traversaro
Copy link
Contributor

Thanks, I wonder why this is not happening in official mujoco colabs. Anyhow, no problem.

@flferretti
Copy link
Collaborator Author

Thanks, I wonder why this is not happening in official mujoco colabs. Anyhow, no problem.

I have no idea to be honest, I have also seen that in Mujoco it works

@flferretti flferretti merged commit f4f224e into main May 21, 2024
29 checks passed
@flferretti flferretti deleted the fix/gazebo_notebook branch May 21, 2024 12:32
@traversaro
Copy link
Contributor

Thanks, I wonder why this is not happening in official mujoco colabs. Anyhow, no problem.

I have no idea to be honest, I have also seen that in Mujoco it works

Probably the difference is due to the fact that glfw is also installed or somehow is selected as backend?

@traversaro
Copy link
Contributor

Thanks, I wonder why this is not happening in official mujoco colabs. Anyhow, no problem.

I have no idea to be honest, I have also seen that in Mujoco it works

Probably the difference is due to the fact that glfw is also installed or somehow is selected as backend?

I think I got it. MUJOCO_GL=egl should be set before the first import mujoco , as MUJOCO_GL is used in the import code, see https://github.com/google-deepmind/mujoco/blob/2f19941fcfb2b5c87f0832b88cabb551cb6deb56/python/mujoco/__init__.py#L47 and https://github.com/google-deepmind/mujoco/blob/2f19941fcfb2b5c87f0832b88cabb551cb6deb56/python/mujoco/gl_context.py . If we more MUJOCO_GL=egl earlier I guess there will be no need for creating a fake X server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants