dual_quaternion.py 文件源码

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

项目:hand_eye_calibration 作者: ethz-asl 项目源码 文件源码
def __truediv__(self, other):
    """ Quaternion division with either scalars or quaternions.

    The division with a scalar returns the dual quaternion with all
    translational elements divided by the scalar.

    The division with a dual quaternion returns dq = dq1/dq2 = dq1 * dq2^-1,
    hence other divides on the right.
    """
    # TODO(ff): Check if this is correct.
    print("WARNING: This might not be properly implemented.")
    if isinstance(other, DualQuaternion):
      return self * other.inverse()
    elif isinstance(other, Number):
      dq = self.dq.copy()
      dq_out = dq / np.float64(other)
      return DualQuaternion.from_vector(dq_out)
    else:
      assert False, "Division is only defined for scalars or dual quaternions."
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号