改写了一段点云分割的代码 ros包编译通过了 但是跑数据集出现如下问题
[plane_ground_filter_node-2] process has died [pid 10263, exit code -11, cmd /home/dwq/pcl_ws/devel/lib/plane_ground_filter/plane_ground_filter_node __name:=plane_ground_filter_node __log:=/home/dwq/.ros/log/26a667a4-d292-11ed-a2c7-21a65bc7d2e3/plane_ground_filter_node-2.log].
log file: /home/dwq/.ros/log/26a667a4-d292-11ed-a2c7-21a65bc7d2e3/plane_ground_filter_node-2*.log
后来为发现问题出现我加代码的位置
ensure_boundary(laserCloudIn,x_boundary);
只要把这句话在主函数中注释掉就能跑了 函数如下
void PlaneGroundFilter::ensure_boundary(const pcl::PointCloud<VPoint> &p,double &x_boundary)
{
std::vector<double> z_capaticy;
std::vector<double> x_capaticy;
int y = 5;
for ( int i = 0 ; i < p.points.size();i++)
{
if ( y == p.points[i].y){
z_capaticy.push_back(p.points[i].z);
x_capaticy.push_back(p.points[i].x);
}
}
for(int m = 0; m < z_capaticy.size() - 1; m++){
int n = m + 1;
double z_diff = z_capaticy[n] - z_capaticy[m];
if (0.5 < z_diff < 5){
x_boundary = (x_capaticy[m] + x_capaticy[n]) / 2;
}
}
}
请问如何解决?