I'm using SAC segmentation to find planes in my point cloud data. I find clusters, and then fit a plane to each cluster.
Sometimes I'll get a cluster that causes the node to hang. CPU usage will spike to 100%, and I can't end the node with ctrl-c.
I'm trying to figure out what type of point clouds cause these hangups so I can avoid fitting a plane to them. I thought setting max iterations would avoid this, but it does not. I have tried different methods other than SAC_RANSAC and they do not change the behavior.
Here are the parameters I am using for the segmentation object:
pcl::SACSegmentation<PointT> seg;
Eigen3::Vector3f x_axis = Eigen3::Vector3f(1.0, 0.0, 0.0);
seg.setAxis(x_axis);
seg.setEpsAngle(0.17454);
seg.setOptimizeCoefficients(false);
seg.setModelType (pcl::SACMODEL_PERPENDICULAR_PLANE);
seg.setMethodType (pcl::SAC_RANSAC);
seg.setMaxIterations (100);
seg.setDistanceThreshold (0.05);
Also, following is an example PCD that, when fitted with the above segmentation object, causes the node to hang. I would have attached a file but my karma is not high enough apparently. This cloud is not representative of all clouds that cause the node to hang; they come in all shapes and sizes, and I can't find a certain common characteristic. However, this cloud will reliably cause the segmentation node to hang.
Please let me know if you have any thoughts.
# .PCD v.6 - Point Cloud Data file format
FIELDS x y z intensity
SIZE 4 4 4 4
TYPE F F F F
COUNT 1 1 1 1
WIDTH 51
HEIGHT 1
POINTS 51
DATA ascii
16.884 2.1395 -0.15434 0.12742
16.903 2.1289 -0.15614 0.13139
16.924 2.107 -0.15706 0.13839
16.925 2.0794 -0.15504 0.14496
16.945 2.057 -0.15586 0.15012
16.972 2.052 -0.15916 0.15038
17.003 2.0378 -0.1621 0.15885
17.027 2.0286 -0.16456 0.16036
17.046 2.0045 -0.16518 0.16036
17.054 1.9827 -0.16455 0.1636
17.06 1.9485 -0.16256 0.16843
17.073 1.93 -0.16275 0.16602
17.088 1.9029 -0.1626 0.17087
17.077 1.8675 -0.15815 0.16877
17.113 1.855 -0.16197 0.16877
17.101 1.8207 -0.15765 0.1671
17.123 1.7984 -0.15878 0.1671
17.135 1.7796 -0.15886 0.16715
17.161 1.7594 -0.16068 0.16805
17.177 1.7432 -0.16159 0.16805
17.193 1.7165 -0.16152 0.16805
17.21 1.7006 -0.16255 0.17025
17.209 1.6647 -0.15947 0.17736
17.22 1.6452 -0.1593 0.17025
17.234 1.618 -0.159 0.17271
17.247 1.5996 -0.15923 0.17271
17.28 1.5819 -0.16235 0.17271
17.286 1.5601 -0.16141 0.17034
17.303 1.5338 -0.16148 0.16927
17.308 1.5121 -0.16047 0.16927
17.337 1.4911 -0.16267 0.16927
17.328 1.4634 -0.15917 0.16058
17.377 1.4503 -0.16479 0.16041
17.385 1.4292 -0.16405 0.15817
17.395 1.4006 -0.16319 0.15686
17.403 1.3799 -0.16253 0.14996
17.456 1.3658 -0.16854 0.14283
17.48 1.3505 -0.17065 0.13996
17.522 1.3311 -0.17464 0.13471
17.585 1.3267 -0.18287 0.13345
17.597 1.297 -0.18205 0.13471
16.886 2.1421 -0.1295 0.10758
16.915 2.1399 -0.13293 0.11303
16.942 2.124 -0.13509 0.11667
17.4 1.4023 -0.13784 0.13002
17.406 1.3812 -0.13709 0.12383
17.459 1.3671 -0.14264 0.11913
17.516 1.3621 -0.1493 0.11913
17.582 1.35 -0.15668 0.12137
17.591 1.3286 -0.15627 0.12137
17.6 1.2982 -0.15513 0.12084
Originally posted by Corey Montella on ROS Answers with karma: 63 on 2011-02-21
Post score: 3