Skip to content

Commit

Permalink
refactor(localization_util): apply static analysis (#7399)
Browse files Browse the repository at this point in the history
* refactor based on linter

Signed-off-by: a-maumau <[email protected]>

* style(pre-commit): autofix

* apply suggestion

Signed-off-by: a-maumau <[email protected]>

---------

Signed-off-by: a-maumau <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
a-maumau and pre-commit-ci[bot] authored Jun 10, 2024
1 parent ed60229 commit 210513d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions localization/localization_util/src/util_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ std_msgs::msg::ColorRGBA exchange_color_crc(double x)
color.b = 1.0;
color.g = static_cast<float>(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<float>(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<float>(-std::sin(x * 2.0 * M_PI));
Expand Down
10 changes: 1 addition & 9 deletions localization/localization_util/test/test_smart_pose_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ bool compare_pose(
pose_a.pose.pose.orientation.w == pose_b.pose.pose.orientation.w;
}

class TestSmartPoseBuffer : public ::testing::Test
{
protected:
void SetUp() override {}

void TearDown() override {}
};

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;
Expand Down

0 comments on commit 210513d

Please sign in to comment.