transforms.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:robopy 作者: adityadua24 项目源码 文件源码
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


# ---------------------------------------------------------------------------------------#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号