Convert euler angles to axis angles. Args: euler_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”}. Defau
(euler_angle: Union[torch.Tensor, numpy.ndarray],
convention: str = 'xyz')
| 285 | |
| 286 | |
| 287 | def ee_to_aa(euler_angle: Union[torch.Tensor, numpy.ndarray], |
| 288 | convention: str = 'xyz') -> Union[torch.Tensor, numpy.ndarray]: |
| 289 | """Convert euler angles to axis angles. |
| 290 | |
| 291 | Args: |
| 292 | euler_angle (Union[torch.Tensor, numpy.ndarray]): input shape |
| 293 | should be (..., 3). ndim of input is unlimited. |
| 294 | convention (str, optional): Convention string of three letters |
| 295 | from {“x”, “y”, and “z”}. Defaults to 'xyz'. |
| 296 | |
| 297 | Returns: |
| 298 | Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3). |
| 299 | """ |
| 300 | if euler_angle.shape[-1] != 3: |
| 301 | raise ValueError(f'Invalid input euler_angle f{euler_angle.shape}.') |
| 302 | t = Compose([ |
| 303 | euler_angles_to_matrix, matrix_to_quaternion, quaternion_to_axis_angle |
| 304 | ]) |
| 305 | return t(euler_angle, convention) |
| 306 | |
| 307 | |
| 308 | def ee_to_quat(euler_angle: Union[torch.Tensor, numpy.ndarray], |