Skip to content

Inconsistent initialization of the label part in PointXYZL and PointXYZRGBL #2461

@csukuangfj

Description

@csukuangfj

Your Environment

  • PCL Version: the master branch

Context

See the code

inline PointXYZL ()
{
x = y = z = 0.0f;
data[3] = 1.0f;
label = 0;
}

inline PointXYZRGBL ()
{
x = y = z = 0.0f;
data[3] = 1.0f;
r = g = b = 0;
a = 255;
label = 255;
}

inline PointXYZLNormal ()
{
x = y = z = 0.0f;
data[3] = 1.0f;
normal_x = normal_y = normal_z = data_n[3] = 0.0f;
label = 0;
curvature = 0;
}

Expected Behavior

label should be initialized to the same value across different types.

Current Behavior

It is 0 in PointXYZL and PointXYZLNormal but 255 in PointXYZRGBL.

Code to Reproduce

See the code above.

Possible Solution

Change it to 0 for PointXYZRGBL since 255 does not make sense.

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