Accessing viscosity option inside python code #2048
-
IntroHi! I am a graduate student at IITD, I use MuJoCo for my research on Multi-agent RL. My setupHi I am trying to access "viscosity" variable inside my python code. My questionHow can I access "viscosity" variable from the below code: Minimal model and/or code that explain my questionIf you encountered the issue in a complex model, please simplify it as much as possible (while still reproducing the issue). Model: minimal XML<mujoco>
<worldbody>
<light pos="0 0 1"/>
<geom type="sphere" size="1" rgba="1 0 0 1"/>
</worldbody>
</mujoco>
Code: import mujoco
import mediapy as media
model = mujoco.MjModel.from_xml_string(xml)
data = mujoco.MjData(model)
with mujoco.Renderer(model) as renderer:
mujoco.mj_forward(model, data)
renderer.update_scene(data)
media.show_image(renderer.render()) Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found it. Thanks! |
Beta Was this translation helpful? Give feedback.
Found it. Thanks!
self/env.model.opt.viscosity