@@ -112,6 +112,11 @@ namespace
112
112
filter->setKeepOrganized (true ); // don't remove points from the cloud, fill holes with NaNs
113
113
filter->setNegative (negative);
114
114
filter->filter (*out);
115
+
116
+ if (out->empty ())
117
+ {
118
+ throw std::runtime_error (" got empty cloud after crop step" );
119
+ }
115
120
}
116
121
117
122
template <typename T>
@@ -156,6 +161,11 @@ namespace
156
161
157
162
downsampler->setInputCloud (in);
158
163
downsampler->filter (*out);
164
+
165
+ if (out->empty ())
166
+ {
167
+ throw std::runtime_error (" got empty cloud after downsampling step" );
168
+ }
159
169
}
160
170
161
171
template <typename T>
@@ -253,6 +263,11 @@ namespace
253
263
254
264
processor->setInputCloud (in);
255
265
processor->process (*out);
266
+
267
+ if (out->empty ())
268
+ {
269
+ throw std::runtime_error (" got empty cloud after cloud smoothing step" );
270
+ }
256
271
}
257
272
258
273
template <typename T>
@@ -287,6 +302,11 @@ namespace
287
302
estimator->setRadiusSearch (radiusSearch);
288
303
estimator->setSearchMethod (tree);
289
304
estimator->compute (*out);
305
+
306
+ if (out->empty ())
307
+ {
308
+ throw std::runtime_error (" got empty cloud after normal estimation step" );
309
+ }
290
310
}
291
311
292
312
template <typename T>
@@ -589,6 +609,11 @@ namespace
589
609
590
610
processor->setInputMesh (in);
591
611
processor->process (*out);
612
+
613
+ if (out->cloud .data .empty () || out->polygons .empty ())
614
+ {
615
+ throw std::runtime_error (" got empty mesh after mesh procesing step" );
616
+ }
592
617
}
593
618
594
619
template <typename T>
@@ -623,6 +648,11 @@ namespace
623
648
624
649
reconstructNormal<pcl_concatenated>(cloudWithNormals, out, options);
625
650
}
651
+
652
+ if (out->cloud .data .empty () || out->polygons .empty ())
653
+ {
654
+ throw std::runtime_error (" got empty mesh after surface reconstruction step" );
655
+ }
626
656
}
627
657
628
658
template <typename T, std::enable_if_t <is_unsupported_pcl_type<T>, bool > = true >
0 commit comments