Limitation in Point Generation for Small Objects in Livox LiDAR SDK #205

Open
opened 2023-06-27 15:34:24 +02:00 by juanesanchezg · 1 comment
juanesanchezg commented 2023-06-27 15:34:24 +02:00 (Migrated from github.com)

I have encountered a limitation in the Livox LiDAR SDK when working with small objects or objects with low density. I created a function which filters the points, so that only the points that are in between a certain range are selected and processed to the lvx file. While the filtering algorithm works correctly for larger objects, it fails to generate an adequate number of points for small objects.

I have observed that the issue arises when the object being scanned has a small surface area or is sparse in terms of point distribution. The SDK seems to prioritize generating points for larger objects, resulting in a lack of data points for smaller objects. As a consequence, the point cloud data does not provide the necessary points to accurately analyze and measure the small objects.

Any ideas for solving this issue?
Here is the filter function:

void FilterLidarData() {
    point_packet_copy.swap(point_packet_list);
    for (auto it = point_packet_copy.begin(); it != point_packet_copy.end();) {
        const LvxBasePackDetail& packet = *it;
        bool shouldRemovePacket = false;  // Flag to indicate if the packet should be removed

    // Check if packet's points are within the desired range
    switch (packet.data_type) {
    case PointDataType::kDualExtendCartesian:
        for (int i = 0; i < packet.pack_size / sizeof(LivoxDualExtendRawPoint); ++i) {
            const LivoxDualExtendRawPoint* point = reinterpret_cast<const LivoxDualExtendRawPoint*>(&packet.raw_point[i * sizeof(LivoxDualExtendRawPoint)]);
            if (point->x1 / 1000.0 < 1 || point->x1 / 1000.0 > 2) {
                shouldRemovePacket = true;  // Set the flag to indicate removal
                break;  // No need to check further points in this packet
            }
            else {
                cont++;
            }
        }
        break;
        // Add cases for other relevant data types if needed

    default:
        printf("Unknown data type\n");
        break;
    }

    // Remove the packet if necessary
    if (shouldRemovePacket) {
        it = point_packet_copy.erase(it);  // Erase the packet from the list and get the next iterator
    }
    else {
        ++it;  // Move to the next packet if it should not be removed
    }
}

}

I have encountered a limitation in the Livox LiDAR SDK when working with small objects or objects with low density. I created a function which filters the points, so that only the points that are in between a certain range are selected and processed to the lvx file. While the filtering algorithm works correctly for larger objects, it fails to generate an adequate number of points for small objects. I have observed that the issue arises when the object being scanned has a small surface area or is sparse in terms of point distribution. The SDK seems to prioritize generating points for larger objects, resulting in a lack of data points for smaller objects. As a consequence, the point cloud data does not provide the necessary points to accurately analyze and measure the small objects. Any ideas for solving this issue? Here is the filter function: void FilterLidarData() { point_packet_copy.swap(point_packet_list); for (auto it = point_packet_copy.begin(); it != point_packet_copy.end();) { const LvxBasePackDetail& packet = *it; bool shouldRemovePacket = false; // Flag to indicate if the packet should be removed // Check if packet's points are within the desired range switch (packet.data_type) { case PointDataType::kDualExtendCartesian: for (int i = 0; i < packet.pack_size / sizeof(LivoxDualExtendRawPoint); ++i) { const LivoxDualExtendRawPoint* point = reinterpret_cast<const LivoxDualExtendRawPoint*>(&packet.raw_point[i * sizeof(LivoxDualExtendRawPoint)]); if (point->x1 / 1000.0 < 1 || point->x1 / 1000.0 > 2) { shouldRemovePacket = true; // Set the flag to indicate removal break; // No need to check further points in this packet } else { cont++; } } break; // Add cases for other relevant data types if needed default: printf("Unknown data type\n"); break; } // Remove the packet if necessary if (shouldRemovePacket) { it = point_packet_copy.erase(it); // Erase the packet from the list and get the next iterator } else { ++it; // Move to the next packet if it should not be removed } } }
juanesanchezg commented 2023-07-04 18:34:38 +02:00 (Migrated from github.com)

@Livox-SDK

@Livox-SDK
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mmr/Livox-SDK#205