File tree 1 file changed +5
-1
lines changed
perception/euclidean_cluster/lib
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ bool VoxelGridBasedEuclideanCluster::cluster(
106
106
temporary_cluster.height = pointcloud_msg->height ;
107
107
temporary_cluster.fields = pointcloud_msg->fields ;
108
108
temporary_cluster.point_step = point_step;
109
- temporary_cluster.data .resize (max_cluster_size_ * point_step);
109
+ temporary_cluster.data .resize (cluster. indices . size () * point_step);
110
110
clusters_data_size.push_back (0 );
111
111
}
112
112
@@ -124,6 +124,10 @@ bool VoxelGridBasedEuclideanCluster::cluster(
124
124
&temporary_clusters.at (map[index ]).data [cluster_data_size],
125
125
&pointcloud_msg->data [i * point_step], point_step);
126
126
cluster_data_size += point_step;
127
+ if (cluster_data_size == temporary_clusters.at (map[index ]).data .size ()) {
128
+ temporary_clusters.at (map[index ])
129
+ .data .resize (temporary_clusters.at (map[index ]).data .size () * 2 );
130
+ }
127
131
}
128
132
}
129
133
You can’t perform that action at this time.
0 commit comments