Open
Description
Intro
Hi!
I am a robotics engineer at Triton Systems and I use MuJoCo for simulation.
My setup
MuJoCo 3.2.7 on PyPi (Python), AMD64, Ubuntu 24.04
What's happening? What did you expect?
Running within a Bazel module:
INFO: Running command line: bazel-bin/mujoco_py
/home/david/.cache/bazel/_bazel_david/f695e6f26414630bc7daef67dcbe0426/execroot/_main/bazel-out/k8-fastbuild/bin/mujoco_py.runfiles/.mujoco_py.venv/lib/python3.12/site-packages/glfw/init.py:917: GLFWError: (65548) b'Wayland: The platform does not provide the window position'
warnings.warn(message, GLFWError)
Attempts to import GLFW directly haven't worked to eliminate this from popping up every time the viewer is opened.
Steps for reproduction
- Run the code below.
- Get the warning message.
Minimal model for reproduction
Shouldn't need this if you import the robot_descriptions package as follows
Code required for reproduction
import time
import mujoco
import mujoco.viewer
from robot_descriptions.loaders.mujoco import load_robot_description
model = load_robot_description("panda_mj_description")
data = mujoco.MjData(model)
with mujoco.viewer.launch_passive(model, data) as viewer:
try:
while viewer.is_running():
step_start = time.time()
mujoco.mj_step(model, data)
with viewer.lock():
viewer.opt.flags[mujoco.mjtVisFlag.mjVIS_CONTACTPOINT] = int(data.time % 2)
viewer.sync()
time_until_next_step = model.opt.timestep - (time.time() - step_start)
if time_until_next_step > 0:
time.sleep(time_until_next_step)
except KeyboardInterrupt:
pass
Confirmations
- I searched the latest documentation thoroughly before posting.
- I searched previous Issues and Discussions, I am certain this has not been raised before.