MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / aa_to_ee

Function aa_to_ee

detrsmpl/utils/transforms.py:244–261  ·  view source on GitHub ↗

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')

Source from the content-addressed store, hash-verified

242
243
244def 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
264def aa_to_rot6d(

Callers

nothing calls this directly

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected