diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9664ec6..eafa031 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 # Runs a single command using the runners shell - name: Install dependencies @@ -34,7 +34,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: Install lcov @@ -48,7 +48,9 @@ jobs: - name: List coverage summary run: /usr/bin/lcov --list ./build/coverage.info - name: Upload report to codecov - run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -f ./build/coverage.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -f ./build/coverage.info - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index fb1b483..daaa610 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -15,17 +15,17 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: recursive - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y libeigen3-dev python3-pip + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: Install conan - run: python3 -m pip install conan + run: pipx install "conan~=2.0" - name: Create conan package run: | conan profile detect - conan create . + conan create . --build=missing diff --git a/.gitmodules b/.gitmodules index 7ca4dec..5a4e85a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "third_party"] - path = third_party - url = https://github.com/google/googletest.git [submodule "third_party/googletest"] path = third_party/googletest url = https://github.com/google/googletest.git diff --git a/.sonarcloud.properties b/.sonarcloud.properties new file mode 100644 index 0000000..0a00b7a --- /dev/null +++ b/.sonarcloud.properties @@ -0,0 +1,4 @@ +sonar.sources=src, include +sonar.exclusions=third_party/** +sonar.cfamily.reportingCppStandardVersion=c++17 +sonar.test.exclusions=**/test/** \ No newline at end of file diff --git a/include/algorithm/robotics/astar_variant/map_storage.hpp b/include/algorithm/robotics/astar_variant/map_storage.hpp index d4f8160..47687a2 100644 --- a/include/algorithm/robotics/astar_variant/map_storage.hpp +++ b/include/algorithm/robotics/astar_variant/map_storage.hpp @@ -40,20 +40,20 @@ class MapStorage { }; public: - /* - y - ^ - | - | - | - |_________>x - */ - MapStorage(const size_t x_size, const size_t y_size) - : map_x_size_(x_size), map_y_size_(y_size) { - std::vector> map(map_x_size_, - std::vector(map_y_size_)); - map_ = map; - } +/** + * Coordinate frame: + * @verbatim + * y + * ^ + * | + * | + * |_________> x + * @endverbatim + */ + MapStorage(size_t x_size, size_t y_size) + : map_x_size_(x_size), + map_y_size_(y_size), + map_(x_size, std::vector(y_size)) {} bool Contains(const Coordinate &coordinate) const { return (coordinate.x >= 0 && coordinate.x < static_cast(map_x_size_) && @@ -79,10 +79,10 @@ class MapStorage { } } - std::vector> map_; - size_t map_x_size_; size_t map_y_size_; + + std::vector> map_; }; } // namespace pllee4::graph #endif /* MAP_STORAGE_HPP */ diff --git a/src/generic/digital_filter/test/butterworth_test.cpp b/src/generic/digital_filter/test/butterworth_test.cpp index f6c01eb..43e4317 100644 --- a/src/generic/digital_filter/test/butterworth_test.cpp +++ b/src/generic/digital_filter/test/butterworth_test.cpp @@ -78,11 +78,9 @@ TEST(Butterworth, StepFilter) { Butterworth::FilterType::kLowPass); std::vector expected_values = {0.00773315, 0.0229602, 0.0377163, 0.052016, 0.0658733}; - auto check_filtered_signal = [&butter](const double value) { - EXPECT_NEAR(butter.StepFilter(0.5), value, 0.001); - }; - std::for_each(expected_values.begin(), expected_values.end(), - check_filtered_signal); + for (const auto expected : expected_values) { + EXPECT_NEAR(butter.StepFilter(0.5), expected, 0.001); + } } TEST(Butterworth, SetCutoffFrequency) { @@ -91,9 +89,7 @@ TEST(Butterworth, SetCutoffFrequency) { butter.SetCutoffFrequency(5); std::vector expected_values = {0.00773315, 0.0229602, 0.0377163, 0.052016, 0.0658733}; - auto check_filtered_signal = [&butter](const double value) { - EXPECT_NEAR(butter.StepFilter(0.5), value, 0.001); - }; - std::for_each(expected_values.begin(), expected_values.end(), - check_filtered_signal); + for (const auto expected : expected_values) { + EXPECT_NEAR(butter.StepFilter(0.5), expected, 0.001); + } } \ No newline at end of file diff --git a/src/robotics/astar_variant/src/astar_variant_base.cpp b/src/robotics/astar_variant/src/astar_variant_base.cpp index b74dba0..456357e 100644 --- a/src/robotics/astar_variant/src/astar_variant_base.cpp +++ b/src/robotics/astar_variant/src/astar_variant_base.cpp @@ -13,9 +13,8 @@ namespace pllee4::graph { void AstarVariantBase::SetMapStorageSize(const size_t x_size, const size_t y_size) { map_storage_ = std::make_unique(x_size, y_size); - std::vector> visited_map(x_size, - std::vector(y_size, false)); - visited_map_ = visited_map; + visited_map_ = + std::vector>(x_size, std::vector(y_size, false)); } bool AstarVariantBase::SetOccupiedGrid( diff --git a/src/robotics/bresenham/src/bresenham.cpp b/src/robotics/bresenham/src/bresenham.cpp index 557e83e..190dbe8 100644 --- a/src/robotics/bresenham/src/bresenham.cpp +++ b/src/robotics/bresenham/src/bresenham.cpp @@ -55,4 +55,4 @@ LineGenerator::LineGenerator(const Coordinate& start, const Coordinate& end) { std::vector LineGenerator::GetPoints() const { return points_; } -} // namespace pllee4::graph +} // namespace pllee4::graph \ No newline at end of file diff --git a/third_party/googletest b/third_party/googletest index ae1b7ad..52eb810 160000 --- a/third_party/googletest +++ b/third_party/googletest @@ -1 +1 @@ -Subproject commit ae1b7ad4308249bfa928e65d1a33be117fc0992c +Subproject commit 52eb8108c5bdec04579160ae17225d66034bd723