url-kaist / AlterGround-LeGO-LOAM

The page for PaGO-LOAM: Robust Ground-Optimized LiDAR Odometry
GNU General Public License v3.0
170 stars 21 forks source link

[pcl::KdTreeFLANN::setInputCloud] Cannot create a KDTree with an empty input cloud! #8

Open HowieHepburn opened 2 months ago

HowieHepburn commented 2 months ago

The modified part in Patchwork++:

ros::Publisher pub_cloud_msgs;

cloud_msgs::ground_estimate cloud2cloudmsg(pcl::PointCloud<PointType> cloud_curr,pcl::PointCloud<PointType> cloud_gnd,const ros::Time& stamp, std::string frame_id = "map") {
cloud_msgs::ground_estimate cloud_msg;
cloud_msg.header.stamp = stamp;
cloud_msg.header.frame_id = frame_id;
cloud_msg.curr = cloud2msg(cloud_curr, stamp, frame_id);
cloud_msg.ground = cloud2msg(cloud_gnd, stamp, frame_id);
return cloud_msg;
}

pub_cloud_msgs.publish(cloud2cloudmsg(pc_curr, pc_ground, cloud_msg->header.stamp, cloud_msg->header.frame_id));

pub_cloud_msgs  = pnh.advertise<cloud_msgs::ground_estimate>("/benchmark/ground_estimate", 100, true);

and the point cloud is published in /benchmark/ground_estimate correctly