Convert rotation matrixs to euler angle. Args: matrix (Union[torch.Tensor, numpy.ndarray]): input shape should be (..., 3, 3). ndim of input is unlimited. convention (str, optional): Convention string of three letters from {“x”, “y”, and “z”}. Def
(
matrix: Union[torch.Tensor, numpy.ndarray],
convention: str = 'xyz')
| 127 | |
| 128 | |
| 129 | def rotmat_to_ee( |
| 130 | matrix: Union[torch.Tensor, numpy.ndarray], |
| 131 | convention: str = 'xyz') -> Union[torch.Tensor, numpy.ndarray]: |
| 132 | """Convert rotation matrixs to euler angle. |
| 133 | |
| 134 | Args: |
| 135 | matrix (Union[torch.Tensor, numpy.ndarray]): input shape |
| 136 | should be (..., 3, 3). ndim of input is unlimited. |
| 137 | convention (str, optional): Convention string of three letters |
| 138 | from {“x”, “y”, and “z”}. Defaults to 'xyz'. |
| 139 | Returns: |
| 140 | Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3). |
| 141 | """ |
| 142 | if matrix.shape[-1] != 3 or matrix.shape[-2] != 3: |
| 143 | raise ValueError(f'Invalid rotation matrix shape f{matrix.shape}.') |
| 144 | t = Compose([matrix_to_euler_angles]) |
| 145 | return t(matrix, convention.upper()) |
| 146 | |
| 147 | |
| 148 | def rotmat_to_quat( |
no test coverage detected