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')
| 108 | |
| 109 | |
| 110 | def 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 | |
| 129 | def rotmat_to_ee( |
no test coverage detected