diff --git a/code/lidars/livoxsdk2/LivoxClient.cpp b/code/lidars/livoxsdk2/LivoxClient.cpp index 73c507f..11fd780 100644 --- a/code/lidars/livoxsdk2/LivoxClient.cpp +++ b/code/lidars/livoxsdk2/LivoxClient.cpp @@ -301,7 +301,7 @@ void LivoxClient::PointCloudCallback(uint32_t handle, const uint8_t dev_type, Li point.laser_id = laser_id; point.timestamp = toUint64.data + static_cast(i) * (double(data->time_interval * 100) / data->dot_num); //unit for interval is 0.1 us = 100 ns - if(point.timestamp > 0) + if(point.timestamp > 0 && (point.x != 0 || point.y != 0 || point.z != 0)) { buffer->push_back(point); } diff --git a/code/save_laz.cpp b/code/save_laz.cpp index 10cca73..a8b1161 100644 --- a/code/save_laz.cpp +++ b/code/save_laz.cpp @@ -48,6 +48,10 @@ std::optional mandeye::saveLaz(const std::string& filename, L min_y = std::min(min_y, y); min_z = std::min(min_z, z); } + if(buffer->empty()) + { + min_x = min_y = min_z = max_x = max_y = max_z = 0.0; + } } std::cout << "processing: " << filename << "points " << buffer->size() << std::endl;