示例#1
0
文件: conversions.py 项目: amoliu/lfd
def trans_rot_to_hmat(trans, rot): 
    ''' 
    Converts a rotation and translation to a homogeneous transform. 

    **Args:** 

        **trans (np.array):** Translation (x, y, z). 

        **rot (np.array):** Quaternion (x, y, z, w). 

    **Returns:** 
        H (np.array): 4x4 homogenous transform matrix. 
    ''' 
    H = transformations.quaternion_matrix(rot) 
    H[0:3, 3] = trans 
    return H
示例#2
0
def trans_rot_to_hmat(trans, rot):
    ''' 
    Converts a rotation and translation to a homogeneous transform. 

    **Args:** 

        **trans (np.array):** Translation (x, y, z). 

        **rot (np.array):** Quaternion (x, y, z, w). 

    **Returns:** 
        H (np.array): 4x4 homogenous transform matrix. 
    '''
    H = transformations.quaternion_matrix(rot)
    H[0:3, 3] = trans
    return H
示例#3
0
文件: conversions.py 项目: amoliu/lfd
def quat2mat(quat):
    return transformations.quaternion_matrix(quat)[:3, :3]
示例#4
0
def quat2mat(quat):
    return transformations.quaternion_matrix(quat)[:3, :3]