points.py 文件源码

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

项目:autolab_core 作者: BerkeleyAutomation 项目源码 文件源码
def best_fit_plane(self):
        """Fits a plane to the point cloud using least squares.

        Returns
        -------
        :obj:`tuple` of :obj:`numpy.ndarray` of float
            A normal vector to and point in the fitted plane.
        """
        X = np.c_[self.x_coords, self.y_coords, np.ones(self.num_points)]
        y = self.z_coords
        A = X.T.dot(X)
        b = X.T.dot(y)
        w = np.linalg.inv(A).dot(b)
        n = np.array([w[0], w[1], -1])
        n = n / np.linalg.norm(n)
        n = Direction(n, self._frame)
        x0 = self.mean()
        return n, x0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号