Convert axis angles to euler angle. Args: axis_angle (Union[torch.Tensor, numpy.ndarray]): input shape should be (..., 3). ndim of input is unlimited. convention (str, optional): Convention string of three letters from {“x”, “y”, and “z”}. Default
(axis_angle: Union[torch.Tensor, numpy.ndarray],
convention: str = 'xyz')
| 242 | |
| 243 | |
| 244 | def aa_to_ee(axis_angle: Union[torch.Tensor, numpy.ndarray], |
| 245 | convention: str = 'xyz') -> Union[torch.Tensor, numpy.ndarray]: |
| 246 | """Convert axis angles to euler angle. |
| 247 | |
| 248 | Args: |
| 249 | axis_angle (Union[torch.Tensor, numpy.ndarray]): input shape |
| 250 | should be (..., 3). ndim of input is unlimited. |
| 251 | convention (str, optional): Convention string of three letters |
| 252 | from {“x”, “y”, and “z”}. Defaults to 'xyz'. |
| 253 | |
| 254 | Returns: |
| 255 | Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3). |
| 256 | """ |
| 257 | if axis_angle.shape[-1] != 3: |
| 258 | raise ValueError( |
| 259 | f'Invalid input axis_angle shape f{axis_angle.shape}.') |
| 260 | t = Compose([axis_angle_to_matrix, matrix_to_euler_angles]) |
| 261 | return t(axis_angle, convention) |
| 262 | |
| 263 | |
| 264 | def aa_to_rot6d( |