Skip to content

Commit 5794eb5

Browse files
Update src/pytorch_kinematics/transforms/rotation_conversions.py
Co-authored-by: Tom Power <[email protected]>
1 parent 595247e commit 5794eb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pytorch_kinematics/transforms/rotation_conversions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ def tensor_axis_and_angle_to_matrix(axis, theta):
497497
torch.stack([r10, r11, r12], -1),
498498
torch.stack([r20, r21, r22], -1)], -2)
499499
batch_shape = axis.shape[:-1]
500-
mat44 = torch.eye(4, device=axis.device, dtype=axis.dtype).repeat(*batch_shape, 1, 1)
501-
mat44[..., :3, :3] = rot
500+
mat44 = torch.cat((rot, torch.zeros(*batch_shape, 3, 1).to(axis)), -1)
501+
mat44 = torch.cat((mat44, torch.tensor([0.0, 0.0, 0.0, 1.0]).expand(*batch_shape, 1, 4).to(axis)), -2)
502502
return mat44
503503

504504

0 commit comments

Comments
 (0)