From eaff3fd9200efa047f553770d829bf1fc25293ac Mon Sep 17 00:00:00 2001 From: Roelof Oomen Date: Mon, 8 Jan 2024 10:22:09 +0100 Subject: [PATCH 1/3] - Fixes rounding errors in progress logging (went up to 101%) - Fixes some clang-tidy suggestions --- .../vhacd/src/convex_decomposition_vhacd.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp b/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp index 8245a4d9fb2..c7d2448cdb1 100644 --- a/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp +++ b/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp @@ -23,9 +23,8 @@ class ProgressCallback : public VHACD::IVHACD::IUserCallback const char* const stage, const char* operation) override { - std::cout << std::setfill(' ') << std::setw(3) << std::lround(overallProgress + 0.5) << "% " - << "[ " << stage << " " << std::setfill(' ') << std::setw(3) << lround(stageProgress + 0.5) << "% ] " - << operation << std::endl; + std::cout << std::setfill(' ') << std::setw(3) << ceil(overallProgress) << "% " << "[ " << stage << " " + << std::setfill(' ') << std::setw(3) << ceil(stageProgress) << "% ] " << operation << std::endl; } }; @@ -75,9 +74,9 @@ ConvexDecompositionVHACD::compute(const tesseract_common::VectorVector3d& vertic par.m_findBestPlane = params_.find_best_plane; par.m_callback = &progress_callback; - bool res = interfaceVHACD->Compute(&points_local[0], + bool res = interfaceVHACD->Compute(points_local.data(), static_cast(points_local.size() / 3), - (const uint32_t*)(&triangles_local[0]), + triangles_local.data(), static_cast(triangles_local.size() / 3), par); @@ -92,9 +91,9 @@ ConvexDecompositionVHACD::compute(const tesseract_common::VectorVector3d& vertic auto vhacd_vertices = std::make_shared(); vhacd_vertices->reserve(ch.m_points.size()); - for (std::size_t i = 0; i < ch.m_points.size(); ++i) + for (const auto& m_point : ch.m_points) { - Eigen::Vector3d v(ch.m_points[i].mX, ch.m_points[i].mY, ch.m_points[i].mZ); + Eigen::Vector3d v(m_point.mX, m_point.mY, m_point.mZ); vhacd_vertices->push_back(v); } From e85ebbbaf48710db15a878ead0a68c01bfeac995 Mon Sep 17 00:00:00 2001 From: Roelof Oomen Date: Tue, 9 Jan 2024 08:35:18 +0100 Subject: [PATCH 2/3] clang-format --- tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp b/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp index c7d2448cdb1..c27053f5277 100644 --- a/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp +++ b/tesseract_collision/vhacd/src/convex_decomposition_vhacd.cpp @@ -23,8 +23,9 @@ class ProgressCallback : public VHACD::IVHACD::IUserCallback const char* const stage, const char* operation) override { - std::cout << std::setfill(' ') << std::setw(3) << ceil(overallProgress) << "% " << "[ " << stage << " " - << std::setfill(' ') << std::setw(3) << ceil(stageProgress) << "% ] " << operation << std::endl; + std::cout << std::setfill(' ') << std::setw(3) << ceil(overallProgress) << "% " + << "[ " << stage << " " << std::setfill(' ') << std::setw(3) << ceil(stageProgress) << "% ] " << operation + << std::endl; } }; From 559e80cf55442c57c63754381745c6a7f4bb2853 Mon Sep 17 00:00:00 2001 From: Roelof Oomen Date: Tue, 9 Jan 2024 09:28:45 +0100 Subject: [PATCH 3/3] Remove deprecated AnalyzeTemporaryDtors --- .clang-tidy | 1 - 1 file changed, 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index b4b6d82049f..830da525463 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -70,7 +70,6 @@ WarningsAsErrors: > -readability-identifier-length, -readability-suspicious-call-argument HeaderFilterRegex: '.*' -AnalyzeTemporaryDtors: false FormatStyle: none CheckOptions: - key: modernize-use-override.AllowOverrideAndFinal