| 22 | |
| 23 | |
| 24 | def display(traj, history): |
| 25 | if history is not None: |
| 26 | traj = np.concatenate([history[:, :-1], traj], axis=1) |
| 27 | env = envs.get_environment( |
| 28 | env_name="humanoid_mimic_hit", |
| 29 | system_config='smpl', |
| 30 | ) |
| 31 | traj = traj.transpose(1, 0, 2) # TxNxD |
| 32 | num_row, num_col = 2, 2 |
| 33 | seed = 0 |
| 34 | for _ in range(num_row): |
| 35 | for col in st.columns(num_col): |
| 36 | with col: |
| 37 | qp = [deserialize_qp(traj[i, seed]) for i in range(traj.shape[0])] |
| 38 | components.html(html.render(env.sys, qp, height=300), height=300) |
| 39 | seed += 1 |
| 40 | # qp = [deserialize_qp(traj[i, 0]) for i in range(traj.shape[0])] |
| 41 | # components.html(html.render(env.sys, qp, height=300), height=300) |
| 42 | |
| 43 | def set_endpoint_to_zero(data): |
| 44 | num_obj = data.shape[-1] // 13 |