Skip to content

Commit

Permalink
Merge pull request #590 from Kashu7100/fix_584
Browse files Browse the repository at this point in the history
[Bug Fix] fix geom util bug
  • Loading branch information
Kashu7100 authored Jan 17, 2025
2 parents 7f3b813 + 6bf6d41 commit cadeef4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genesis/utils/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,10 @@ def quat_to_T(quat):
if isinstance(quat, torch.Tensor):
T = torch.eye(4, dtype=quat.dtype, device=quat.device)
if quat.ndim == 1:
T[:3, :3] = Rotation.from_quat(wxyz_to_xyzw(quat)).as_matrix()
T[:3, :3] = quat_to_R(quat)
elif quat.ndim == 2:
T = T.unsqueeze(0).repeat(quat.shape[0], 1, 1)
T[:, :3, :3] = Rotation.from_quat(wxyz_to_xyzw(quat)).as_matrix()
T[:, :3, :3] = quat_to_R(quat)
else:
gs.raise_exception(f"ndim expected to be 1 or 2, but got {quat.ndim=}")
return T
Expand Down

0 comments on commit cadeef4

Please sign in to comment.