Skip to content

Commit 6eea3e7

Browse files
committed
refactor
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
1 parent c34f79d commit 6eea3e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

perception/occupancy_grid_map_outlier_filter/src/occupancy_grid_map_outlier_filter_nodelet.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ void OccupancyGridMapOutlierFilterComponent::splitPointCloudFrontBack(
280280
front_count++;
281281
}
282282
}
283+
front_pc.data.resize(front_count * point_step);
284+
behind_pc.data.resize(behind_count * point_step);
283285
}
284286
void OccupancyGridMapOutlierFilterComponent::onOccupancyGridMapAndPointCloud2(
285287
const OccupancyGrid::ConstSharedPtr & input_ogm, const PointCloud2::ConstSharedPtr & input_pc)
@@ -348,9 +350,9 @@ void OccupancyGridMapOutlierFilterComponent::onOccupancyGridMapAndPointCloud2(
348350
pointcloud_pub_->publish(std::move(base_link_frame_filtered_pc_ptr));
349351
}
350352
if (debugger_ptr_) {
353+
finalizePointCloud2(ogm_frame_pc, high_confidence_pc);
351354
finalizePointCloud2(ogm_frame_pc, filtered_low_confidence_pc);
352355
finalizePointCloud2(ogm_frame_pc, outlier_pc);
353-
finalizePointCloud2(ogm_frame_pc, high_confidence_pc);
354356
debugger_ptr_->publishHighConfidence(high_confidence_pc, ogm_frame_pc.header);
355357
debugger_ptr_->publishLowConfidence(filtered_low_confidence_pc, ogm_frame_pc.header);
356358
debugger_ptr_->publishOutlier(outlier_pc, ogm_frame_pc.header);
@@ -370,7 +372,12 @@ void OccupancyGridMapOutlierFilterComponent::onOccupancyGridMapAndPointCloud2(
370372
void OccupancyGridMapOutlierFilterComponent::initializerPointCloud2(
371373
const PointCloud2 & input, PointCloud2 & output)
372374
{
375+
output.header = input.header;
373376
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;
374381
output.data.resize(input.data.size());
375382
}
376383

0 commit comments

Comments
 (0)