How to add text labels? #2632
Unanswered
tonitonitonitoni
asked this question in
Asking for Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am a graduate student at TMU (Toronto Metropolitan University), I use MuJoCo for my research on space robotics.
My setup
I run MuJoCo (latest stable version) on Windows 10 / WSL2 Ubuntu 22.04 using VSCode, usually through Jupyter notebooks.
My question
I want to add labels to objects in the scene and I am having trouble setting up a context so that I can use mjr_text, mjr_label and mjr_overlay. What is the proper format for setting up a context? I would prefer to use the renderer or viewer.launch/viewer.launch_passive. I get the error "FatalError: an OpenGL platform library has not been loaded into this process, this most likely means that a valid OpenGL context has not been created before mjr_makeContext was called." Alternatively, I get "FatalError: Default framebuffer is not complete, error 0x0".
When I tried with the ctx = mujoco.GLContext(max_width, max_height) as suggested in the docs, I got an incompatible function argument, it expects MjrContext.
How do I set up the context and what is the best method to get text labels to display on the screen? Please help :)
Minimal model and/or code that explain my question
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions