(data)
| 67 | |
| 68 | |
| 69 | def recover_root_rot_pos(data): |
| 70 | rot_vel = data[..., 0] |
| 71 | r_rot_ang = torch.zeros_like(rot_vel).to(data.device) |
| 72 | '''Get Y-axis rotation from rotation velocity''' |
| 73 | r_rot_ang[..., 1:] = rot_vel[..., :-1] |
| 74 | r_rot_ang = torch.cumsum(r_rot_ang, dim=-1) |
| 75 | |
| 76 | r_rot_quat = torch.zeros(data.shape[:-1] + (4, )).to(data.device) |
| 77 | r_rot_quat[..., 0] = torch.cos(r_rot_ang) |
| 78 | r_rot_quat[..., 2] = torch.sin(r_rot_ang) |
| 79 | |
| 80 | r_pos = torch.zeros(data.shape[:-1] + (3, )).to(data.device) |
| 81 | r_pos[..., 1:, [0, 2]] = data[..., :-1, 1:3] |
| 82 | '''Add Y-axis rotation to root position''' |
| 83 | r_pos = qrot(qinv(r_rot_quat), r_pos) |
| 84 | |
| 85 | r_pos = torch.cumsum(r_pos, dim=-2) |
| 86 | |
| 87 | r_pos[..., 1] = data[..., 3] |
| 88 | return r_rot_quat, r_pos |
| 89 | |
| 90 | |
| 91 | def recover_from_ric(data, joints_num): |
no test coverage detected