rigid_transform.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def __mul__(self, other):
        """ 
        Left-multiply RigidTransform with another rigid transform

        Two variants: 
           RigidTransform: Identical to oplus operation
           ndarray: transform [N x 3] point set (X_2 = p_21 * X_1)

        """
        if isinstance(other, DualQuaternion):
            return DualQuaternion.from_dq(other.real * self.real, 
                                          other.dual * self.real + other.real * self.dual)
        elif isinstance(other, float):
            return DualQuaternion.from_dq(self.real * other, self.dual * other)
        # elif isinstance(other, nd.array): 
        #     X = np.hstack([other, np.ones((len(other),1))]).T
        #     return (np.dot(self.matrix, X).T)[:,:3]
        else: 
            raise TypeError('__mul__ typeerror {:}'.format(type(other)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号