From 7c0c85558f3fdb0f7349a087b85aaadbceeb05b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Emin=20BA=C5=9EO=C4=9ELU?= Date: Fri, 25 Aug 2023 13:39:41 +0300 Subject: [PATCH] Add filter to VLP32 and VLS128 --- .../src/nebula_decoders_velodyne/decoders/vlp32_decoder.cpp | 3 +++ .../src/nebula_decoders_velodyne/decoders/vls128_decoder.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nebula_decoders/src/nebula_decoders_velodyne/decoders/vlp32_decoder.cpp b/nebula_decoders/src/nebula_decoders_velodyne/decoders/vlp32_decoder.cpp index 285e14525..685500bd8 100644 --- a/nebula_decoders/src/nebula_decoders_velodyne/decoders/vlp32_decoder.cpp +++ b/nebula_decoders/src/nebula_decoders_velodyne/decoders/vlp32_decoder.cpp @@ -300,6 +300,9 @@ void Vlp32Decoder::unpack(const velodyne_msgs::msg::VelodynePacket & velodyne_pa current_point.return_type = static_cast(return_type); current_point.channel = corrections.laser_ring; current_point.azimuth = rotation_radians_[block.rotation]; + + if (check_invalid_point(corrections.laser_ring, block.rotation)) continue; + current_point.elevation = sin_vert_angle; auto point_ts = block_timestamp - scan_timestamp_ + point_time_offset; if (point_ts < 0) diff --git a/nebula_decoders/src/nebula_decoders_velodyne/decoders/vls128_decoder.cpp b/nebula_decoders/src/nebula_decoders_velodyne/decoders/vls128_decoder.cpp index 19480c7bf..3937f76eb 100644 --- a/nebula_decoders/src/nebula_decoders_velodyne/decoders/vls128_decoder.cpp +++ b/nebula_decoders/src/nebula_decoders_velodyne/decoders/vls128_decoder.cpp @@ -294,6 +294,9 @@ void Vls128Decoder::unpack(const velodyne_msgs::msg::VelodynePacket & velodyne_p current_point.return_type = return_type; current_point.channel = corrections.laser_ring; current_point.azimuth = rotation_radians_[azimuth_corrected]; + + if (check_invalid_point(corrections.laser_ring, azimuth_corrected)) continue; + current_point.elevation = sin_vert_angle; current_point.distance = distance; auto point_ts = block_timestamp - scan_timestamp_ + point_time_offset;