@@ -280,6 +280,8 @@ void OccupancyGridMapOutlierFilterComponent::splitPointCloudFrontBack(
280
280
front_count++;
281
281
}
282
282
}
283
+ front_pc.data .resize (front_count * point_step);
284
+ behind_pc.data .resize (behind_count * point_step);
283
285
}
284
286
void OccupancyGridMapOutlierFilterComponent::onOccupancyGridMapAndPointCloud2 (
285
287
const OccupancyGrid::ConstSharedPtr & input_ogm, const PointCloud2::ConstSharedPtr & input_pc)
@@ -348,9 +350,9 @@ void OccupancyGridMapOutlierFilterComponent::onOccupancyGridMapAndPointCloud2(
348
350
pointcloud_pub_->publish (std::move (base_link_frame_filtered_pc_ptr));
349
351
}
350
352
if (debugger_ptr_) {
353
+ finalizePointCloud2 (ogm_frame_pc, high_confidence_pc);
351
354
finalizePointCloud2 (ogm_frame_pc, filtered_low_confidence_pc);
352
355
finalizePointCloud2 (ogm_frame_pc, outlier_pc);
353
- finalizePointCloud2 (ogm_frame_pc, high_confidence_pc);
354
356
debugger_ptr_->publishHighConfidence (high_confidence_pc, ogm_frame_pc.header );
355
357
debugger_ptr_->publishLowConfidence (filtered_low_confidence_pc, ogm_frame_pc.header );
356
358
debugger_ptr_->publishOutlier (outlier_pc, ogm_frame_pc.header );
@@ -370,7 +372,12 @@ void OccupancyGridMapOutlierFilterComponent::onOccupancyGridMapAndPointCloud2(
370
372
void OccupancyGridMapOutlierFilterComponent::initializerPointCloud2 (
371
373
const PointCloud2 & input, PointCloud2 & output)
372
374
{
375
+ output.header = input.header ;
373
376
output.point_step = input.point_step ;
377
+ output.fields = input.fields ;
378
+ output.height = input.height ;
379
+ output.is_bigendian = input.is_bigendian ;
380
+ output.is_dense = input.is_dense ;
374
381
output.data .resize (input.data .size ());
375
382
}
376
383
0 commit comments