You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What seemed to be happening in our case is that we were adding a point cloud
to the visualizer that contained some NaN points, i.e. I think in the PCL
terminology it was not a "dense" point cloud.
The visualizer seems to remove such invalid points internally. The indices
that are reported for picks (I think this applies to both single point and
area picks) refer to the point cloud after this mutation.
We are working around the issue with code like this (this is a
generalization of our actual code that I did not test):
vector &indices; //picked indices from visualizer
sort(indices.begin(), indices.end());
const int m = indices.size(), n = cloud.points.size();
//i is index in original cloud
//j is index in virtual sparse cloud
//k is index in indices
for (int i = 0, j = 0, k = 0; (i < n) && (k < m); i++) {
if (isFinite(cloud.points[i])) {
while ((k < m) && (indices[k] == j)) indices[k++] = i;
j++;
}
}