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

Function ee_to_aa

detrsmpl/utils/transforms.py:287–305  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

285
286
287def 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
308def ee_to_quat(euler_angle: Union[torch.Tensor, numpy.ndarray],

Callers

nothing calls this directly

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected