def get_earth_movers_error(est_tf, gt_tf, model_cloud, misalignment_tol=0.005):
    est_model_cloud = transform_points(est_tf, model_cloud)
    gt_model_cloud = transform_points(gt_tf, model_cloud)
    neigh = NearestNeighbors(n_neighbors=1)
    neigh.fit(gt_model_cloud.T)
    (dist, _) = neigh.kneighbors(est_model_cloud[0:3, :].T, return_distance=True)
    if (misalignment_tol is None):
        return np.mean(dist)
    else:
        return np.mean((dist > misalignment_tol))
def get_earth_movers_error(est_tf, gt_tf, model_cloud, misalignment_tol=0.005):
    est_model_cloud = transform_points(est_tf, model_cloud)
    gt_model_cloud = transform_points(gt_tf, model_cloud)
    neigh = NearestNeighbors(n_neighbors=1)
    neigh.fit(gt_model_cloud.T)
    (dist, _) = neigh.kneighbors(est_model_cloud[0:3, :].T, return_distance=True)
    if (misalignment_tol is None):
        return np.mean(dist)
    else:
        return np.mean((dist > misalignment_tol))