Convert 3x3 rotation matrix to 3d vector of axis-angle rotation. Shape: - Input: :Torch:`(N, 3, 3)` - Output: :Torch:`(N, 3)`
(rot_mat)
| 68 | return rot_mat[:, :3, :3] |
| 69 | |
| 70 | def mat3x3_to_axis_angle(rot_mat): |
| 71 | """ |
| 72 | Convert 3x3 rotation matrix to 3d vector of axis-angle rotation. |
| 73 | Shape: |
| 74 | - Input: :Torch:`(N, 3, 3)` |
| 75 | - Output: :Torch:`(N, 3)` |
| 76 | """ |
| 77 | rot_mat = torch.cat([rot_mat, torch.zeros((rot_mat.shape[0], 3, 1), device=rot_mat.device).float()], 2) |
| 78 | axis_angle = tgm.rotation_matrix_to_angle_axis(rot_mat).reshape(-1, 3) # axis-angle |
| 79 | axis_angle[torch.isnan(axis_angle)] = 0.0 |
| 80 | return axis_angle |
| 81 | |
| 82 | def quaternion_to_axis_angle(quaternion): |
| 83 | """ |
no outgoing calls
no test coverage detected