From 82cea61a2584672c0afc67cd6897abb14af745c8 Mon Sep 17 00:00:00 2001 From: a-maumau Date: Mon, 10 Jun 2024 15:47:22 +0900 Subject: [PATCH 1/3] refactor based on linter Signed-off-by: a-maumau --- localization/localization_util/src/util_func.cpp | 4 ++-- .../localization_util/test/test_smart_pose_buffer.cpp | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/localization/localization_util/src/util_func.cpp b/localization/localization_util/src/util_func.cpp index ae6f0b61f063c..133442df68dcd 100644 --- a/localization/localization_util/src/util_func.cpp +++ b/localization/localization_util/src/util_func.cpp @@ -28,11 +28,11 @@ std_msgs::msg::ColorRGBA exchange_color_crc(double x) color.b = 1.0; color.g = static_cast(std::sin(x * 2.0 * M_PI)); color.r = 0; - } else if (x > 0.25 && x <= 0.5) { + } else if (x <= 0.5) { color.b = static_cast(std::sin(x * 2 * M_PI)); color.g = 1.0; color.r = 0; - } else if (x > 0.5 && x <= 0.75) { + } else if (x <= 0.75) { color.b = 0; color.g = 1.0; color.r = static_cast(-std::sin(x * 2.0 * M_PI)); diff --git a/localization/localization_util/test/test_smart_pose_buffer.cpp b/localization/localization_util/test/test_smart_pose_buffer.cpp index 2520e458f2d33..a7180aeecdae1 100644 --- a/localization/localization_util/test/test_smart_pose_buffer.cpp +++ b/localization/localization_util/test/test_smart_pose_buffer.cpp @@ -43,12 +43,7 @@ bool compare_pose( } class TestSmartPoseBuffer : public ::testing::Test -{ -protected: - void SetUp() override {} - - void TearDown() override {} -}; +{}; TEST_F(TestSmartPoseBuffer, interpolate_pose) // NOLINT { From 4955280563be2f8690b0be62e013218a74e21938 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 07:13:26 +0000 Subject: [PATCH 2/3] style(pre-commit): autofix --- localization/localization_util/test/test_smart_pose_buffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/localization/localization_util/test/test_smart_pose_buffer.cpp b/localization/localization_util/test/test_smart_pose_buffer.cpp index a7180aeecdae1..f0c8924a89c4f 100644 --- a/localization/localization_util/test/test_smart_pose_buffer.cpp +++ b/localization/localization_util/test/test_smart_pose_buffer.cpp @@ -43,7 +43,8 @@ bool compare_pose( } class TestSmartPoseBuffer : public ::testing::Test -{}; +{ +}; TEST_F(TestSmartPoseBuffer, interpolate_pose) // NOLINT { From e54a11233f56f738660a3d92db2981659866e5a7 Mon Sep 17 00:00:00 2001 From: a-maumau Date: Mon, 10 Jun 2024 16:30:01 +0900 Subject: [PATCH 3/3] apply suggestion Signed-off-by: a-maumau --- .../localization_util/test/test_smart_pose_buffer.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/localization/localization_util/test/test_smart_pose_buffer.cpp b/localization/localization_util/test/test_smart_pose_buffer.cpp index f0c8924a89c4f..a8ed6d98b6064 100644 --- a/localization/localization_util/test/test_smart_pose_buffer.cpp +++ b/localization/localization_util/test/test_smart_pose_buffer.cpp @@ -42,11 +42,7 @@ bool compare_pose( pose_a.pose.pose.orientation.w == pose_b.pose.pose.orientation.w; } -class TestSmartPoseBuffer : public ::testing::Test -{ -}; - -TEST_F(TestSmartPoseBuffer, interpolate_pose) // NOLINT +TEST(TestSmartPoseBuffer, interpolate_pose) // NOLINT { rclcpp::Logger logger = rclcpp::get_logger("test_logger"); const double pose_timeout_sec = 10.0;