rigid_transformations.py 文件源码

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

项目:autolab_core 作者: BerkeleyAutomation 项目源码 文件源码
def _check_valid_rotation(self, rotation):
        """Checks that the given rotation matrix is valid.
        """
        if not isinstance(rotation, np.ndarray) or not np.issubdtype(rotation.dtype, np.number):
            raise ValueError('Rotation must be specified as numeric numpy array')

        if len(rotation.shape) != 2 or rotation.shape[0] != 3 or rotation.shape[1] != 3:
            raise ValueError('Rotation must be specified as a 3x3 ndarray')

        if np.abs(np.linalg.det(rotation) - 1.0) > 1e-3:
            raise ValueError('Illegal rotation. Must have determinant == 1.0')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号