From e52d6cbc3b4d72908ceb1c2477bb5990732886e3 Mon Sep 17 00:00:00 2001 From: Max Schmeller <6088931+mojomex@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:56:27 +0900 Subject: [PATCH] chore(at128): change M_PI to M_PIf for clarity Co-authored-by: David Wong <33114676+drwnz@users.noreply.github.com> --- .../decoders/angle_corrector_correction_based.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nebula_decoders/include/nebula_decoders/nebula_decoders_hesai/decoders/angle_corrector_correction_based.hpp b/nebula_decoders/include/nebula_decoders/nebula_decoders_hesai/decoders/angle_corrector_correction_based.hpp index d139e5206..67514587c 100644 --- a/nebula_decoders/include/nebula_decoders/nebula_decoders_hesai/decoders/angle_corrector_correction_based.hpp +++ b/nebula_decoders/include/nebula_decoders/nebula_decoders_hesai/decoders/angle_corrector_correction_based.hpp @@ -126,7 +126,7 @@ class AngleCorrectorCorrectionBased : public AngleCorrector // //////////////////////////////////////// for (size_t i = 0; i < MAX_AZIMUTH; ++i) { - float rad = 2.f * i * M_PI / MAX_AZIMUTH; + float rad = 2.f * i * M_PIf / MAX_AZIMUTH; cos_[i] = cosf(rad); sin_[i] = sinf(rad); } @@ -187,8 +187,8 @@ class AngleCorrectorCorrectionBased : public AngleCorrector correction_->getAzimuthAdjustV3(channel_id, block_azimuth) * (AngleUnit / 100); azimuth = (MAX_AZIMUTH + azimuth) % MAX_AZIMUTH; - float azimuth_rad = 2.f * azimuth * M_PI / MAX_AZIMUTH; - float elevation_rad = 2.f * elevation * M_PI / MAX_AZIMUTH; + float azimuth_rad = 2.f * azimuth * M_PIf / MAX_AZIMUTH; + float elevation_rad = 2.f * elevation * M_PIf / MAX_AZIMUTH; return {azimuth_rad, elevation_rad, sin_[azimuth], cos_[azimuth], sin_[elevation], cos_[elevation]};