robopal.commons.transform module¶
- robopal.commons.transform.euler_2_mat(euler)[源代码]¶
Converts euler angles(format in xyz) into rotation matrix form.
- 参数:
euler -- 1*3 euler angles
- 返回:
3*3 rotation matrix
- robopal.commons.transform.euler_2_quat(rpy, degrees: bool = False)[源代码]¶
degrees:bool True is the angle value, and False is the radian value
- robopal.commons.transform.make_transform(pos=None, rot=None) ndarray[源代码]¶
- concatenate both 1*3 or 3*1 position array and 3*3 rotation matrix
to a 4*4 transform matrix
E.g.: >>> T = make_transform(np.zeros(3), np.zeros(shape=(3, 3)))
- 参数:
pos -- 1*3 position
rot -- 3*3 rotation
- 返回:
4*4 transform
- robopal.commons.transform.mat_2_euler(mat)[源代码]¶
Converts rotation matrix into euler angles(format in xyz).
- 参数:
mat -- 3*3 rotation matrix
- 返回:
1*3 euler angles
- robopal.commons.transform.mat_2_quat(mat)[源代码]¶
The rotation vector modulus is the angle Not using the Rodriguez formula
- 参数:
mat -- 3*3 rotation matrix
- 返回:
1*4 quaternion
- robopal.commons.transform.mat_2_vec(mat)[源代码]¶
Converts rotation matrix into rotation vector form.
- 参数:
mat -- 3*3 rotation matrix
- 返回:
1*3 rotation vector
- robopal.commons.transform.quat_2_euler(quaternion)[源代码]¶
Converts quaternion into euler angles(format in xyz).
- 参数:
quaternion -- 1*4 quaternion
- 返回:
1*3 euler angles
- robopal.commons.transform.quat_2_mat(quaternion)[源代码]¶
The rotation vector modulus is the angle Not using the Rodriguez formula
- 参数:
quaternion -- 1*4 quaternion
- 返回:
3*3 rotation matrix
- robopal.commons.transform.vec2_mat(vec)[源代码]¶
The rotation vector modulus is the angle Not using the Rodriguez formula
When calculating the rotation matrix, it is necessary to normalize the rotation vector into a unit vector, calculate the four components of the quaternion according to the formula, and then convert the quaternion into a rotation matrix.