This is my code, i dont know what is wrong
void Preprocess::pandar_handler(const sensor_msgs::PointCloud2::ConstPtr &msg)
{
pl_surf.clear();
pl_corn.clear();
pl_full.clear();
pcl::PointCloud pl_orig;
pcl::fromROSMsg(*msg, pl_orig); // 将 ROS 点云消息转换为 PCL 格式
int plsize = pl_orig.points.size();
pl_surf.reserve(plsize); // 为输出点云预留空间
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is my code, i dont know what is wrong void Preprocess::pandar_handler(const sensor_msgs::PointCloud2::ConstPtr &msg) { pl_surf.clear(); pl_corn.clear(); pl_full.clear(); pcl::PointCloud pl_orig;
pcl::fromROSMsg(*msg, pl_orig); // 将 ROS 点云消息转换为 PCL 格式
int plsize = pl_orig.points.size();
pl_surf.reserve(plsize); // 为输出点云预留空间
while (pl_orig.points[plsize - 1].timestamp - pl_orig.points[0].timestamp >= 0.1) { plsize--; pl_orig.points.pop_back(); }
auto time_list_pandar = [&](pandar_ros::Point &point_1, pandar_ros::Point &point_2) { return (point_1.timestamp < point_2.timestamp); }; std::sort(pl_orig.points.begin(), pl_orig.points.end(), time_list_pandar);
double time_head = pl_orig.points[0].timestamp;
for(int i=0; i<plsize; i++) { if (!(std::isfinite(pl_orig.points[i].x) && std::isfinite(pl_orig.points[i].y) && std::isfinite(pl_orig.points[i].z))) continue;
} }