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

Function ee_to_rotmat

detrsmpl/utils/transforms.py:110–126  ·  view source on GitHub ↗

Convert euler angle to rotation matrixs. 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”}. D

(euler_angle: Union[torch.Tensor, numpy.ndarray],
                 convention='xyz')

Source from the content-addressed store, hash-verified

108
109
110def ee_to_rotmat(euler_angle: Union[torch.Tensor, numpy.ndarray],
111 convention='xyz') -> Union[torch.Tensor, numpy.ndarray]:
112 """Convert euler angle to rotation matrixs.
113
114 Args:
115 euler_angle (Union[torch.Tensor, numpy.ndarray]): input shape
116 should be (..., 3). ndim of input is unlimited.
117 convention (str, optional): Convention string of three letters
118 from {“x”, “y”, and “z”}. Defaults to 'xyz'.
119 Returns:
120 Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3, 3).
121 """
122 if euler_angle.shape[-1] != 3:
123 raise ValueError(
124 f'Invalid input euler angles shape f{euler_angle.shape}.')
125 t = Compose([euler_angles_to_matrix])
126 return t(euler_angle, convention.upper())
127
128
129def rotmat_to_ee(

Callers 2

convert_camera_matrixFunction · 0.90
compute_orbit_camerasFunction · 0.90

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected