google-deepmind / dm_control

Google DeepMind's software stack for physics-based simulation and Reinforcement Learning environments, using MuJoCo.
Apache License 2.0
3.83k stars 671 forks source link

How to Implement Frame-by-Frame Input Control Signals and Rendering in dm_control? #499

Open binbinbai opened 3 weeks ago

binbinbai commented 3 weeks ago

Hi,I would like to know how to achieve similar frame-by-frame input control signals and rendering logic in dm_control,like `for i in range(len(retargeting_list['ctrl_history']) - 1): ctrl = retargeting_list['ctrl_history'][i] qfrc = retargeting_list['qfrc_history'][i]

if i == 0:
    env.data.qpos[:30] = ctrl[:30]
    mujoco.mj_forward(env.model, env.data)
else:
    env.data.qfrc_applied = qfrc   
    env.data.ctrl[:30] = ctrl[:30]
    for _ in range(5):
        mujoco.mj_step(env.model, env.data)  
    viewer.render()`

Thank you!