Skip to content

Copy data directly into PCL point cloud buffers using void copyData(DataFormat *destination) const #175

@runenordmo

Description

@runenordmo

Then the for-loop iterating over every point in

for(size_t i = 0; i < pointCloudPCL.points.size(); ++i)
{
pointCloudPCL.points[i].x = data(i).point.x; // NOLINT(cppcoreguidelines-pro-type-union-access)
pointCloudPCL.points[i].y = data(i).point.y; // NOLINT(cppcoreguidelines-pro-type-union-access)
pointCloudPCL.points[i].z = data(i).point.z; // NOLINT(cppcoreguidelines-pro-type-union-access)
pointCloudPCL.points[i].r = data(i).color.r; // NOLINT(cppcoreguidelines-pro-type-union-access)
pointCloudPCL.points[i].g = data(i).color.g; // NOLINT(cppcoreguidelines-pro-type-union-access)
pointCloudPCL.points[i].b = data(i).color.b; // NOLINT(cppcoreguidelines-pro-type-union-access)
}

will become a one-liner running void copyData(DataFormat *destination) const.

This is already possible copying Zivid::PointXYZW into pcl::PointXYZ, but not for more complex pcl types.


This would require the Zivid SDK to support more composed data formats, matching some of the PCL data types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions