def trot2(theta, unit='rad'):
"""
TROT2 SE2 rotation matrix
:param theta: rotation in radians or degrees
:param unit: "rad" or "deg" to indicate unit being used
:return: homogeneous transform matrix (3x3)
TROT2(THETA) is a homogeneous transformation (3x3) representing a rotation of
THETA radians.
TROT2(THETA, 'deg') as above but THETA is in degrees.
Notes::
- Translational component is zero.
"""
tm = rot2(theta, unit)
tm = np.r_[tm, np.zeros((1, 2))]
mat = np.c_[tm, np.array([[0], [0], [1]])]
return mat
# ---------------------------------------------------------------------------------------#
评论列表
文章目录