PHC
PHC copied to clipboard
Bug in MotionLibReal causing incorrect global orientation with target_heading provided
In load_motion_with_skeleton, when target_heading is provided, the motion's global orientation becomes incorrect.
if not target_heading is None:
start_root_rot = sRot.from_rotvec(pose_aa[0, 0])
heading_inv_rot = sRot.from_quat(torch_utils.calc_heading_quat_inv(torch.from_numpy(start_root_rot.as_quat()[None, ])))
heading_delta = sRot.from_quat(target_heading) * heading_inv_rot
pose_aa[:, 0] = torch.tensor((heading_delta * sRot.from_rotvec(pose_aa[:, 0])).as_rotvec())
trans = torch.matmul(trans, torch.from_numpy(heading_delta.as_matrix().squeeze().T))
This may be caused by changes on quat type in this project.