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

Function aa_to_quat

detrsmpl/utils/transforms.py:92–107  ·  view source on GitHub ↗

Convert axis_angle to quaternions. Args: axis_angle (Union[torch.Tensor, numpy.ndarray]): input shape should be (..., 3). ndim of input is unlimited. Returns: Union[torch.Tensor, numpy.ndarray]: shape would be (..., 4).

(
    axis_angle: Union[torch.Tensor, numpy.ndarray]
)

Source from the content-addressed store, hash-verified

90
91
92def aa_to_quat(
93 axis_angle: Union[torch.Tensor, numpy.ndarray]
94) -> Union[torch.Tensor, numpy.ndarray]:
95 """
96 Convert axis_angle to quaternions.
97 Args:
98 axis_angle (Union[torch.Tensor, numpy.ndarray]): input shape
99 should be (..., 3). ndim of input is unlimited.
100
101 Returns:
102 Union[torch.Tensor, numpy.ndarray]: shape would be (..., 4).
103 """
104 if axis_angle.shape[-1] != 3:
105 raise ValueError(f'Invalid input axis angles f{axis_angle.shape}.')
106 t = Compose([axis_angle_to_quaternion])
107 return t(axis_angle)
108
109
110def ee_to_rotmat(euler_angle: Union[torch.Tensor, numpy.ndarray],

Callers

nothing calls this directly

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected