Closed jonzamora closed 5 months ago
Found my fix rather quickly, it was a silly thing!
def create_model(arena: Arena):
model = mjcf.Physics.from_mjcf_model(arena.get_arena())
model = model.model.ptr
data = mujoco.MjData(model)
# Set the simulation to the "home" keyframe
key_id = model.key("home").id
mujoco.mj_resetDataKeyframe(model, data, key_id)
return model, data
Hi,
I am working with
PyMJCF
, and provide a minimal example below which I need help with:I define the function
and call
self.set_keyframe()
in the__init__()
of myArena()
class.However, the
keyframe
is not being loaded automatically. I need to press theTab
key once the MuJoCo viewer spawns, then manually press "Load Key", which is not ideal.Any idea how to get the
keyframe
to load automatically after i add it to the arena like above?