Skip to content

Commit 892cbb2

Browse files
keita1523pre-commit-ci[bot]
authored andcommitted
fix(autoware_image_projection_based_fusion): modify incorrect index access in pointcloud filtering for out-of-range points (autowarefoundation#10087)
* fix(pointpainting): modify pointcloud index Signed-off-by: keita1523 <keita.miura@tier4.jp> * style(pre-commit): autofix --------- Signed-off-by: keita1523 <keita.miura@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 36209bb commit 892cbb2

File tree

1 file changed

+4
-2
lines changed
  • perception/autoware_image_projection_based_fusion/src/pointpainting_fusion

1 file changed

+4
-2
lines changed

perception/autoware_image_projection_based_fusion/src/pointpainting_fusion/node.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ void PointPaintingFusionNode::preprocess(PointCloudMsgType & painted_pointcloud_
234234
sensor_msgs::PointCloud2Iterator<float> iter_painted_z(painted_pointcloud_msg, "z");
235235
for (sensor_msgs::PointCloud2ConstIterator<float> iter_x(tmp, "x"), iter_y(tmp, "y"),
236236
iter_z(tmp, "z");
237-
iter_x != iter_x.end();
238-
++iter_x, ++iter_y, ++iter_z, ++iter_painted_x, ++iter_painted_y, ++iter_painted_z) {
237+
iter_x != iter_x.end(); ++iter_x, ++iter_y, ++iter_z) {
239238
if (
240239
*iter_x <= pointcloud_range.at(0) || *iter_x >= pointcloud_range.at(3) ||
241240
*iter_y <= pointcloud_range.at(1) || *iter_y >= pointcloud_range.at(4)) {
@@ -245,6 +244,9 @@ void PointPaintingFusionNode::preprocess(PointCloudMsgType & painted_pointcloud_
245244
*iter_painted_y = *iter_y;
246245
*iter_painted_z = *iter_z;
247246
j += painted_point_step;
247+
++iter_painted_x;
248+
++iter_painted_y;
249+
++iter_painted_z;
248250
}
249251
}
250252

0 commit comments

Comments
 (0)