Skip to content

Bug: ProjectInliers for SACMODEL_CYLINDER #3876

@fl0ydj

Description

@fl0ydj

Problem Description

Hi,
I have had some problems with the ProjectInliers Filter for the SACMODEL cylinder.
The radius of the projected cylinder has been way too small.
After having a look at sac_model_cylinder.hpp and some debugging I found out that the fourth dimension of dir is nearly one, thus leading to a smaller radius, as this value is added:
pp += dir * coefficients->values[6];

Solution

I was able to get it working by changing
Eigen::Vector4f p(featureCloud->points[i].x, featureCloud->points[i].y, featureCloud->points[i].z, 1);
to
Eigen::Vector4f p(featureCloud->points[i].x, featureCloud->points[i].y, featureCloud->points[i].z, 0);
However, I am quite unsure about the math and also this step does not help if copy_data_fields is false.
Any ideas how to fix that generally?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions