Skip to content

Commit

Permalink
配信する点群を予めreserveする
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuwamai committed Oct 15, 2024
1 parent 131ed2a commit 6443f9c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sciurus17_examples/src/point_cloud_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class PointCloudSubscriber : public rclcpp::Node

for (const auto & point_indices : cluster_indices) {
auto cloud_cluster = std::make_shared<pcl::PointCloud<pcl::PointXYZRGB>>();
cloud_cluster->points.reserve(cloud_input->points.size());
// 点群の色を変更
for (const auto & point_i : point_indices.indices) {
cloud_input->points[point_i].r = CLUSTER_COLOR[cluster_i][RED];
Expand Down

0 comments on commit 6443f9c

Please sign in to comment.