Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of clouds that might have zero points (x=y=z=0) #3

Open
PaulKemppi opened this issue May 2, 2022 · 1 comment
Open

Handling of clouds that might have zero points (x=y=z=0) #3

PaulKemppi opened this issue May 2, 2022 · 1 comment
Assignees

Comments

@PaulKemppi
Copy link

Hi and thank you for the interesting and very useful vdb_mapping module.

This is not a bug, but a suggestion to modify the code so that it can handle gracefully input clouds that have invalid points. Some sensors / software modules may represent points with no range measurement as x=y=z=NaN or x=y=z=0 and have them in the cloud just to keep the cloud organized (= having width and height).

At least with x=y=z=0, the while loop in VDBMapping::insertPointCloud (line 110) never exists and no output is published.

To ignore zero points, one could check the length of the ray and ignore the point of the ray length is too small:

  double min_ray_length = 1e-7;
  // Raycasting of every point in the input cloud
  for (const PointT& pt : *cloud)
  {
    max_range_ray = false;
    ray_end_world = openvdb::Vec3d(pt.x, pt.y, pt.z);
    // Ignore points in the origin
    ray_length = (ray_end_world - ray_origin_world).length();
    if (ray_length < min_ray_length)
    {
        continue;
    }
    .
    .
@MGBla
Copy link
Contributor

MGBla commented May 10, 2022

Hey Paul,
thanks for the feedback and you are absolutely right.
I think currently it might do one raycasting iteration in case of a 0,0,0 point.
In the next few days(hopefully) I will make a sync with our development repo and include a sanity check for these cases while I'm at it.

@MGBla MGBla self-assigned this May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants