skrobot.coordinates.math.matrix_exponent¶
- skrobot.coordinates.math.matrix_exponent(omega, p=1.0)[source]¶
Returns exponent of given omega.
This function is similar to cv2.Rodrigues. Convert rvec (which is log quaternion) to rotation matrix.
- Parameters:
omega (list or numpy.ndarray) – vector of shape (3,)
- Returns:
rot – exponential matrix of given omega
- Return type:
Examples
>>> import numpy as np >>> from skrobot.coordinates.math import matrix_exponent >>> matrix_exponent([1, 1, 1]) array([[ 0.22629564, -0.18300792, 0.95671228], [ 0.95671228, 0.22629564, -0.18300792], [-0.18300792, 0.95671228, 0.22629564]]) >>> matrix_exponent([1, 0, 0]) array([[ 1. , 0. , 0. ], [ 0. , 0.54030231, -0.84147098], [ 0. , 0.84147098, 0.54030231]])