You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to run a simulation of a dynamic heightfield using the mujoco python bindings. I would like to use the passive viewer (launch_passive) rendering, since it comes with a lot of neat capabilities, but there is no way for me to execute mjr_uploadHField, which is needed to reflect changes in the heightfield, since it requires an mjrContext.
For the heightfield to chance dynamically, I need to use mujoco.mjr_uploadHField which requires a context, that the viewer does not expose. I have tried using context = mujoco.MjrContext(model, mujoco.mjtFontScale.mjFONTSCALE_150.value) , however this will crash the application with exit code -1073741819. I've had no luck accesing the context any other way.
Is this intended? If yes, how else should I access the context to execute uploadHField or uploadMesh etc.? Please change the label accordingly, if this is not a bug.
Thanks !
This is a small example of how I tried to run my code (I for the life of me cannot get it nicely formatted with actual code markdown):
import mujoco
import mujoco.viewer as v
import time
import numpy as np
import random
field_size = 32
base_height = 30
height_perturbation_range = 5
heightfield = np.array([0] * field_size * field_size)
def change_heightfield(heightfield):
for x in range(int(field_size / 2)):
for y in range(int(field_size / 2)):
height = random.uniform(base_height, height_perturbation_range + base_height)
heightfield[2 * y + 2 * x * field_size] = height
heightfield[2 * y + 1 + 2 * x * field_size] = height
heightfield[2 * y + (2 * x + 1) * field_size] = height
heightfield[2 * y + 1 + (2 * x + 1) * field_size] = height
return heightfield
Hi,
I'm currently trying to run a simulation of a dynamic heightfield using the mujoco python bindings. I would like to use the passive viewer (launch_passive) rendering, since it comes with a lot of neat capabilities, but there is no way for me to execute mjr_uploadHField, which is needed to reflect changes in the heightfield, since it requires an mjrContext.
For the heightfield to chance dynamically, I need to use mujoco.mjr_uploadHField which requires a context, that the viewer does not expose. I have tried using context = mujoco.MjrContext(model, mujoco.mjtFontScale.mjFONTSCALE_150.value) , however this will crash the application with exit code -1073741819. I've had no luck accesing the context any other way.
Is this intended? If yes, how else should I access the context to execute uploadHField or uploadMesh etc.? Please change the label accordingly, if this is not a bug.
Thanks !
This is a small example of how I tried to run my code (I for the life of me cannot get it nicely formatted with actual code markdown):
The text was updated successfully, but these errors were encountered: