Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ndt_omp): apply static analysis #57

Merged
merged 9 commits into from
Aug 7, 2024

Conversation

a-maumau
Copy link

@a-maumau a-maumau commented Jul 16, 2024

Description

This PR applies some suggestions from the linter to code.
Checked with clang-tidy and cppcheck.

needs to be merged with autowarefoundation/autoware.universe#8124

Fixed:

  • use explicit cast
  • add initialization [cppcoreguidelines-init-variables]
  • add missing headers
  • change function/method
    • use lowercase
    • add keyword to function/method which linter suggested
  • use prefix ++ operator
    • for performance
  • removed
    • unused var, if branch

Not Fixed:

Interface Changes

This PR will change the estimate_xy_covariance_by_Laplace_approximation to estimate_xy_covariance_by_laplace_approximation (lowercase laplace) which effect the ndt_scan_matcher.

Checks

Checked with clang-tidy (v14.0.0) and cppcheck (v2.14.1).

Use .cppcheck_suppressions for suppressing some notation from cppcheck.

For ignoring some notes using the autoware, autoware.universe repo's suppression files , you need to add followings:

  • CPPLINT.cfg: filter=-legal/copyright
  • .cppcheck_supressions: missingMemberCopy
check_linter.sh
#!/bin/bash
set -eux

TARGET_DIR=$1

current_dir=$(basename $(pwd))
if [[ ! $current_dir =~ ^(autoware|pilot-auto) ]]; then
    echo "This script must be run in a directory with a prefix of autoware or pilot-auto."
    exit 1
fi

set +eux
export CPLUS_INCLUDE_PATH=/usr/include/c++/11:/usr/include/x86_64-linux-gnu/c++/11:$CPLUS_INCLUDE_PATH
set -eux

fdfind -e cpp -e hpp --full-path ${TARGET_DIR} | xargs -P $(nproc) -I{} cpplint {}
fdfind -e cpp -e hpp --full-path ${TARGET_DIR} | xargs -P $(nproc) -I{} clang-tidy -p build/ {}

Before fixing the code:

Check with check_linter.sh
$ ./check_linter.sh ndt_omp
...
Done processing ./src/universe/external/ndt_omp/src/multigrid_pclomp/multi_voxel_grid_covariance_omp.cpp
Done processing ./src/universe/external/ndt_omp/src/pclomp/gicp_omp.cpp
./src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp:27:  Single-parameter constructors should be marked explicit.  [runtime/explicit] [5]
Done processing ./src/universe/external/ndt_omp/src/multigrid_pclomp/multigrid_ndt_omp.cpp
Done processing ./src/universe/external/ndt_omp/src/pclomp/ndt_omp.cpp
Done processing ./src/universe/external/ndt_omp/src/pclomp/voxel_grid_covariance_omp.cpp
Done processing ./src/universe/external/ndt_omp/apps/timer.hpp
./src/universe/external/ndt_omp/apps/util.hpp:27:  Add #include <algorithm> for sort  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/apps/util.hpp:56:  Add #include <string> for string  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/apps/util.hpp:56:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/apps/util.hpp
Total errors found: 3
./src/universe/external/ndt_omp/include/estimate_covariance/estimate_covariance.hpp:29:  Add #include <memory> for shared_ptr<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/estimate_covariance/estimate_covariance.hpp:54:  Add #include <utility> for pair<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/estimate_covariance/estimate_covariance.hpp:55:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/include/estimate_covariance/estimate_covariance.hpp
Total errors found: 3
./src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp:84:  Add #include <map> for map<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp:85:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp:87:  Add #include <utility> for pair<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp:87:  Add #include <string> for string  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp
Total errors found: 5
Done processing ./src/universe/external/ndt_omp/include/pclomp/ndt_struct.hpp
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:55:  Using deprecated casting style.  Use static_cast<int>(...) instead  [readability/casting] [4]
Done processing ./src/universe/external/ndt_omp/apps/align.cpp
Done processing ./src/universe/external/ndt_omp/apps/regression_test.cpp
Done processing ./src/universe/external/ndt_omp/src/estimate_covariance/estimate_covariance.cpp
Done processing ./src/universe/external/ndt_omp/apps/check_covariance.cpp
./src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:204:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:204:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:243:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:373:  Using deprecated casting style.  Use static_cast<double>(...) instead  [readability/casting] [4]
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:382:  Using deprecated casting style.  Use static_cast<double>(...) instead  [readability/casting] [4]
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:383:  Using deprecated casting style.  Use static_cast<double>(...) instead  [readability/casting] [4]
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:395:  Do not use namespace using-directives.  Use using-declarations instead.  [build/namespaces] [5]
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:439:  Using deprecated casting style.  Use static_cast<double>(...) instead  [readability/casting] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:209:  Add #include <utility> for move  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:282:  Add #include <string> for string  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:282:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:340:  Add #include <map> for map<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:456:  Add #include <limits> for numeric_limits<>  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp
Total errors found: 5
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:536:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:351:  Add #include <limits> for numeric_limits<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:429:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp
Total errors found: 4
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:484:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp:492:  Add #include <utility> for pair<>  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp
Total errors found: 10
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:789:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:789:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:796:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:796:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:807:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:797:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:797:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:836:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:836:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:804:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:804:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:815:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:854:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:854:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:844:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:844:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:878:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:878:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:862:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:862:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:906:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:886:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:886:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:914:  If an else has a brace on one side, it should have it on both  [readability/braces] [5]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:149:  Add #include <utility> for move  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:994:  Add #include <algorithm> for max  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:1131:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp
Total errors found: 15
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:1002:  Add #include <algorithm> for max  [build/include_what_you_use] [4]
./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:1207:  Add #include <vector> for vector<>  [build/include_what_you_use] [4]
Done processing ./src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp
Check with cppcheck:
(in .../ndt_omp)
$ cppcheck --enable=all --enable=style --enable=performance --enable=portability --enable=unusedFunction --inconclusive --check-level=exhaustive --suppressions-list=$HOME/autoware/src/universe/autoware.universe/.cppcheck_suppressions ./apps ./src/ -I include/

Checking apps/align.cpp ...
include/pclomp/gicp_omp.h:343:5: style: Struct 'OptimizationFunctorWithIndices' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    OptimizationFunctorWithIndices(const GeneralizedIterativeClosestPoint * gicp)
    ^
include/pclomp/ndt_omp.h:186:3: performance: Function 'getFinalTransformationArray()' should return member 'transformation_array_' by const reference. [returnByReference]
  getFinalTransformationArray() const
  ^
include/multigrid_pclomp/multigrid_ndt_omp.h:232:3: performance: Function 'getFinalTransformationArray()' should return member 'transformation_array_' by const reference. [returnByReference]
  getFinalTransformationArray() const
  ^
apps/align.cpp:91:11: style: Variable 'aligned' is reassigned a value before the old one has been used. [redundantAssignment]
  aligned = align(ndt, target_cloud, source_cloud);
          ^
apps/align.cpp:85:11: note: aligned is assigned
  aligned = align(gicp_omp, target_cloud, source_cloud);
          ^
apps/align.cpp:91:11: note: aligned is overwritten
  aligned = align(ndt, target_cloud, source_cloud);
          ^
apps/align.cpp:116:13: style: Variable 'aligned' is reassigned a value before the old one has been used. [redundantAssignment]
    aligned = align(mg_ndt_omp, target_cloud, source_cloud);
            ^
apps/align.cpp:111:15: note: aligned is assigned
      aligned = align(ndt_omp, target_cloud, source_cloud);
              ^
apps/align.cpp:116:13: note: aligned is overwritten
    aligned = align(mg_ndt_omp, target_cloud, source_cloud);
            ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp.h:336:17: style: Variable 'thread_num_' is reassigned a value before the old one has been used. [redundantAssignment]
    thread_num_ = thread_num;
                ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp.h:333:19: note: thread_num_ is assigned
      thread_num_ = 1;
                  ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp.h:336:17: note: thread_num_ is overwritten
    thread_num_ = thread_num;
                ^
include/pclomp/voxel_grid_covariance_omp.h:389:88: performance: Prefer prefix ++/-- operators for non-primitive types. [postfixOperator]
    for (std::vector<int>::iterator iter = k_indices.begin(); iter != k_indices.end(); iter++) {
                                                                                       ^
include/pclomp/voxel_grid_covariance_omp.h:439:88: performance: Prefer prefix ++/-- operators for non-primitive types. [postfixOperator]
    for (std::vector<int>::iterator iter = k_indices.begin(); iter != k_indices.end(); iter++) {
                                                                                       ^
1/9 files checked 17% done
Checking apps/check_covariance.cpp ...
2/9 files checked 51% done
Checking apps/regression_test.cpp ...
apps/pcd_map_grid_manager.hpp:27:3: style: Class 'MapGridManager' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
  MapGridManager(const pcl::PointCloud<pcl::PointXYZ>::Ptr target_cloud)
  ^
3/9 files checked 69% done
Checking src/estimate_covariance/estimate_covariance.cpp ...
4/9 files checked 95% done
Checking src/multigrid_pclomp/multi_voxel_grid_covariance_omp.cpp ...
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:132:36: warning: inconclusive: Access of moved variable 'other'. [accessMoved]
  voxel_centroids_ptr_ = std::move(other.voxel_centroids_ptr_);
                                   ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:131:37: note: Calling std::move(other)
  pcl::VoxelGrid<PointT>::operator=(std::move(other));
                                    ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:132:36: note: Access of moved variable 'other'.
  voxel_centroids_ptr_ = std::move(other.voxel_centroids_ptr_);
                                   ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:133:27: warning: inconclusive: Access of moved variable 'other'. [accessMoved]
  sid_to_iid_ = std::move(other.sid_to_iid_);
                          ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:131:37: note: Calling std::move(other)
  pcl::VoxelGrid<PointT>::operator=(std::move(other));
                                    ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:133:27: note: Access of moved variable 'other'.
  sid_to_iid_ = std::move(other.sid_to_iid_);
                          ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:134:26: warning: inconclusive: Access of moved variable 'other'. [accessMoved]
  grid_list_ = std::move(other.grid_list_);
                         ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:131:37: note: Calling std::move(other)
  pcl::VoxelGrid<PointT>::operator=(std::move(other));
                                    ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:134:26: note: Access of moved variable 'other'.
  grid_list_ = std::move(other.grid_list_);
                         ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:135:23: warning: inconclusive: Access of moved variable 'other'. [accessMoved]
  kdtree_ = std::move(other.kdtree_);
                      ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:131:37: note: Calling std::move(other)
  pcl::VoxelGrid<PointT>::operator=(std::move(other));
                                    ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:135:23: note: Access of moved variable 'other'.
  kdtree_ = std::move(other.kdtree_);
                      ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:136:26: warning: inconclusive: Access of moved variable 'other'. [accessMoved]
  leaf_ptrs_ = std::move(other.leaf_ptrs_);
                         ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:131:37: note: Calling std::move(other)
  pcl::VoxelGrid<PointT>::operator=(std::move(other));
                                    ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:136:26: note: Access of moved variable 'other'.
  leaf_ptrs_ = std::move(other.leaf_ptrs_);
                         ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:138:27: warning: inconclusive: Access of moved variable 'other'. [accessMoved]
  min_points_per_voxel_ = other.min_points_per_voxel_;
                          ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:131:37: note: Calling std::move(other)
  pcl::VoxelGrid<PointT>::operator=(std::move(other));
                                    ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:138:27: note: Access of moved variable 'other'.
  min_points_per_voxel_ = other.min_points_per_voxel_;
                          ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:139:30: warning: inconclusive: Access of moved variable 'other'. [accessMoved]
  min_covar_eigvalue_mult_ = other.min_covar_eigvalue_mult_;
                             ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:131:37: note: Calling std::move(other)
  pcl::VoxelGrid<PointT>::operator=(std::move(other));
                                    ^
include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:139:30: note: Access of moved variable 'other'.
  min_covar_eigvalue_mult_ = other.min_covar_eigvalue_mult_;
                             ^
5/9 files checked 96% done
Checking src/multigrid_pclomp/multigrid_ndt_omp.cpp ...
include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:65:3: warning: inconclusive: Member variable 'MultiGridNormalDistributionsTransform < pcl :: PointXYZ , pcl :: PointXYZ >::j_ang_' is not assigned in the copy constructor. Should it be copied? [missingMemberCopy]
  MultiGridNormalDistributionsTransform(const MultiGridNormalDistributionsTransform & other)
  ^
...(omitted)

After this PR:

Check with check_linter.sh
$ ./check_linter.sh ndt_omp
...
4240 warnings generated.
Suppressed 4240 warnings (4240 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
15480 warnings and 20 errors generated.
Error while processing /home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/gicp_omp_impl.hpp.
error: too many errors emitted, stopping now [clang-diagnostic-error]
/usr/include/pcl-1.12/pcl/registration/boost.h:41:1: error: C++ requires a type specifier for all declarations [clang-diagnostic-error]
PCL_DEPRECATED_HEADER(1, 15, "Please include the needed boost headers directly.")
^
/usr/include/pcl-1.12/pcl/registration/boost.h:41:82: error: expected ';' after top level declarator [clang-diagnostic-error]
PCL_DEPRECATED_HEADER(1, 15, "Please include the needed boost headers directly.")
                                                                                 ^
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t' [clang-diagnostic-error]
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
       ^
... (omitted)
/usr/include/x86_64-linux-gnu/sys/types.h:108:19: note: 'ssize_t' declared here
typedef __ssize_t ssize_t;
                  ^
Suppressed 15480 warnings (15480 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
11891 warnings generated.
Suppressed 11893 warnings (11891 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
27496 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp:37:54: warning: do not access members of unions; use (boost::)variant instead [cppcoreguidelines-pro-type-union-access]
      const int x = static_cast<int>(std::ceil(point.x / resolution_));
                                                     ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/pcd_map_grid_manager.hpp:38:54: warning: do not access members of unions; use (boost::)variant instead [cppcoreguidelines-pro-type-union-access]
      const int y = static_cast<int>(std::ceil(point.y / resolution_));
                                                     ^
Suppressed 27496 warnings (27494 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
32574 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/util.hpp:33:24: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
    files.emplace_back(buffer.gl_pathv[i]);
                       ^
Suppressed 32575 warnings (32573 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
41071 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:55:43: warning: function 'applyFilter' has cognitive complexity of 101 (threshold 25) [readability-function-cognitive-complexity]
void pclomp::VoxelGridCovariance<PointT>::applyFilter(PointCloud & output)
                                          ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:60:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (!input_) {
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:75:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (!filter_field_name_.empty())  // If we don't want to process the entire cloud...
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:79:3: note: +1, nesting level increased to 1
  else
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:87:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if ((dx * dy * dz) > std::numeric_limits<int32_t>::max()) {
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:117:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (downsample_all_data_) centroid_size = boost::mpl::size<FieldList>::value;
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:123:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (rgba_index == -1) rgba_index = pcl::getFieldIndex<PointT>("rgba", fields);
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:124:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (rgba_index >= 0) {
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:131:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (!filter_field_name_.empty()) {
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:135:5: note: +2, including nesting penalty of 1, nesting level increased to 2
    if (distance_idx == -1)
    ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:141:5: note: +2, including nesting penalty of 1, nesting level increased to 2
    for (size_t cp = 0; cp < input_->points.size(); ++cp) {
    ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:142:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (!input_->is_dense)
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:144:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if (
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:145:88: note: +1
          !std::isfinite(input_->points[cp].x) || !std::isfinite(input_->points[cp].y) ||
                                                                                       ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:154:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (filter_limit_negative_) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:156:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if ((distance_value < filter_limit_max_) && (distance_value > filter_limit_min_)) continue;
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:156:50: note: +1
        if ((distance_value < filter_limit_max_) && (distance_value > filter_limit_min_)) continue;
                                                 ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:157:9: note: +1, nesting level increased to 3
      } else {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:159:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if ((distance_value > filter_limit_max_) || (distance_value < filter_limit_min_)) continue;
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:159:50: note: +1
        if ((distance_value > filter_limit_max_) || (distance_value < filter_limit_min_)) continue;
                                                 ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:173:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (leaf.nr_points == 0) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:185:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (!downsample_all_data_) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:188:9: note: +1, nesting level increased to 3
      } else {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:192:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if (rgba_index >= 0) {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:209:5: note: +1, nesting level increased to 1
  } else {
    ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:211:5: note: +2, including nesting penalty of 1, nesting level increased to 2
    for (size_t cp = 0; cp < input_->points.size(); ++cp) {
    ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:212:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (!input_->is_dense)
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:214:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if (
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:215:88: note: +1
          !std::isfinite(input_->points[cp].x) || !std::isfinite(input_->points[cp].y) ||
                                                                                       ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:232:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (leaf.nr_points == 0) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:244:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (!downsample_all_data_) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:247:9: note: +1, nesting level increased to 3
      } else {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:251:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if (rgba_index >= 0) {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:270:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (searchable_) voxel_centroids_leaf_indices_.reserve(leaves_.size());
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:272:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  if (save_leaf_layout_) leaf_layout_.resize(div_b_[0] * div_b_[1] * div_b_[2], -1);
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:283:3: note: +1, including nesting penalty of 0, nesting level increased to 1
  for (auto it = leaves_.begin(); it != leaves_.end(); ++it) {
  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:297:5: note: +2, including nesting penalty of 1, nesting level increased to 2
    if (leaf.nr_points >= min_points_per_voxel_) {
    ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:298:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (save_leaf_layout_) leaf_layout_[it->first] = cp++;
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:303:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (!downsample_all_data_) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:307:9: note: +1, nesting level increased to 3
      } else {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:311:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if (rgba_index >= 0) {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:324:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (searchable_) voxel_centroids_leaf_indices_.push_back(static_cast<int>(it->first));
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:336:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (eigen_val(0, 0) < 0 || eigen_val(1, 1) < 0 || eigen_val(2, 2) <= 0) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:336:54: note: +1
      if (eigen_val(0, 0) < 0 || eigen_val(1, 1) < 0 || eigen_val(2, 2) <= 0) {
                                                     ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:344:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (eigen_val(0, 0) < min_covar_eigvalue) {
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:347:9: note: +4, including nesting penalty of 3, nesting level increased to 4
        if (eigen_val(1, 1) < min_covar_eigvalue) {
        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:356:7: note: +3, including nesting penalty of 2, nesting level increased to 3
      if (
      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:357:73: note: +1
        leaf.icov_.maxCoeff() == std::numeric_limits<float>::infinity() ||
                                                                        ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:150:30: warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
      const auto * pt_data = reinterpret_cast<const uint8_t *>(&input_->points[cp]);
                             ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:152:39: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
      memcpy(&distance_value, pt_data + fields[distance_idx].offset, sizeof(float));
                                      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:194:24: warning: variable 'rgb' is not initialized [cppcoreguidelines-init-variables]
          unsigned int rgb;
                       ^
                           = 0
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:196:19: warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
            &rgb, reinterpret_cast<const char *>(&input_->points[cp]) + rgba_index,
                  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:196:71: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
            &rgb, reinterpret_cast<const char *>(&input_->points[cp]) + rgba_index,
                                                                      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:253:24: warning: variable 'rgb' is not initialized [cppcoreguidelines-init-variables]
          unsigned int rgb;
                       ^
                           = 0
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:255:19: warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
            &rgb, reinterpret_cast<const char *>(&input_->points[cp]) + rgba_index, sizeof(int));
                  ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:255:71: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
            &rgb, reinterpret_cast<const char *>(&input_->points[cp]) + rgba_index, sizeof(int));
                                                                      ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:281:10: warning: variable 'min_covar_eigvalue' is not initialized [cppcoreguidelines-init-variables]
  double min_covar_eigvalue;
         ^
                            = NAN
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:319:18: warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
          memcpy(reinterpret_cast<char *>(&output.points.back()) + rgba_index, &rgb, sizeof(float));
                 ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:319:66: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
          memcpy(reinterpret_cast<char *>(&output.points.back()) + rgba_index, &rgb, sizeof(float));
                                                                 ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/voxel_grid_covariance_omp_impl.hpp:482:9: warning: function-like macro 'PCL_INSTANTIATE_VoxelGridCovariance' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define PCL_INSTANTIATE_VoxelGridCovariance(T) \
        ^
Suppressed 41060 warnings (41058 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
40942 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:69:1: warning: constructor does not initialize these fields: thread_num_ [cppcoreguidelines-pro-type-member-init]
template <typename PointT>
^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:91:1: warning: constructor does not initialize these fields: thread_num_ [cppcoreguidelines-pro-type-member-init]
template <typename PointT>
^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multi_voxel_grid_covariance_omp_impl.hpp:471:9: warning: function-like macro 'PCL_INSTANTIATE_VoxelGridCovariance' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define PCL_INSTANTIATE_VoxelGridCovariance(T) \
        ^
Suppressed 40941 warnings (40939 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
46001 warnings generated.
Suppressed 46003 warnings (46001 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
48876 warnings generated.
Suppressed 48878 warnings (48876 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
51361 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:51:1: warning: constructor does not initialize these fields: nearest_voxel_transformation_likelihood_ [cppcoreguidelines-pro-type-member-init]
template <typename PointSource, typename PointTarget>
^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:72:10: warning: variable 'gauss_c1' is not initialized [cppcoreguidelines-init-variables]
  double gauss_c1;
         ^
                  = NAN
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/pclomp/ndt_omp_impl.hpp:73:10: warning: variable 'gauss_c2' is not initialized [cppcoreguidelines-init-variables]
  double gauss_c2;
         ^
                  = NAN
... (omitted)
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:513:10: warning: variable 'sy' is not initialized [cppcoreguidelines-init-variables]
  double sy;
         ^
            = NAN
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:514:10: warning: variable 'sz' is not initialized [cppcoreguidelines-init-variables]
  double sz;
         ^
            = NAN
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:712:1: warning: OpenMP directive 'parallel for' does not specify 'default' clause, consider specifying 'default(none)' clause [openmp-use-default-none]
#pragma omp parallel for num_threads(params_.num_threads) schedule(guided, 8)
^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:877:12: warning: variable 'a_t_next' is not initialized [cppcoreguidelines-init-variables]
    double a_t_next;
           ^
                    = NAN
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:1076:1: warning: OpenMP directive 'parallel for' does not specify 'default' clause, consider specifying 'default(none)' clause [openmp-use-default-none]
#pragma omp parallel for num_threads(params_.num_threads) schedule(guided, 8)
^
/home/masakibaba/autoware/src/universe/external/ndt_omp/include/multigrid_pclomp/multigrid_ndt_omp_impl.hpp:1135:1: warning: OpenMP directive 'parallel for' does not specify 'default' clause, consider specifying 'default(none)' clause [openmp-use-default-none]
#pragma omp parallel for num_threads(params_.num_threads) schedule(guided, 8)
^
Suppressed 50676 warnings (50674 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
55407 warnings generated.
Suppressed 55409 warnings (55407 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
72133 warnings generated.
Suppressed 72135 warnings (72133 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
67689 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/check_covariance.cpp:31:33: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
  const std::string input_dir = argv[1];
                                ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/check_covariance.cpp:32:34: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
  const std::string output_dir = argv[2];
                                 ^
Suppressed 67689 warnings (67687 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
79453 warnings generated.
Suppressed 79455 warnings (79451 in non-user code, 2 NOLINT, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
76622 warnings generated.
Suppressed 76624 warnings (76622 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
73310 warnings generated.
Suppressed 73312 warnings (73310 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
66882 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/regression_test.cpp:46:33: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
  const std::string input_dir = argv[1];
                                ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/regression_test.cpp:47:34: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
  const std::string output_dir = argv[2];
                                 ^
Suppressed 66882 warnings (66880 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
111674 warnings generated.
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/align.cpp:47:28: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
  std::string target_pcd = argv[1];
                           ^
/home/masakibaba/autoware/src/universe/external/ndt_omp/apps/align.cpp:48:28: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
  std::string source_pcd = argv[2];
                           ^
Suppressed 111674 warnings (111672 in non-user code, 2 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Check with cppcheck
(in .../ndt_omp)
$ cppcheck --enable=all --enable=style --enable=performance --enable=portability --enable=unusedFunction --inconclusive --check-level=exhaustive --suppressions-list=$HOME/autoware/src/universe/autoware.universe/.cppcheck_suppressions ./apps ./src/ -I include/

Checking apps/align.cpp ...
1/9 files checked 17% done
Checking apps/check_covariance.cpp ...
2/9 files checked 52% done
Checking apps/regression_test.cpp ...
3/9 files checked 69% done
Checking src/estimate_covariance/estimate_covariance.cpp ...
4/9 files checked 95% done
Checking src/multigrid_pclomp/multi_voxel_grid_covariance_omp.cpp ...
5/9 files checked 96% done
Checking src/multigrid_pclomp/multigrid_ndt_omp.cpp ...
6/9 files checked 97% done
Checking src/pclomp/gicp_omp.cpp ...
7/9 files checked 98% done
Checking src/pclomp/ndt_omp.cpp ...
8/9 files checked 99% done
Checking src/pclomp/voxel_grid_covariance_omp.cpp ...
9/9 files checked 100% done

Test

  • Confirmed regression_test passed.
  • Successfully building the autoware and it can run the ndt_scan_matcher.
    • you need apply the interface change to ndt_scan_matcher

@a-maumau a-maumau changed the title Mau/refactor/ndt omp refactor(ndt_omp): apply static analysis Jul 16, 2024
Signed-off-by: a-maumau <[email protected]>
apps/align.cpp Outdated Show resolved Hide resolved
apps/align.cpp Outdated Show resolved Hide resolved
Copy link

@SakodaShintaro SakodaShintaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will review this after Ando-san's points are corrected.

@a-maumau
Copy link
Author

a-maumau commented Aug 6, 2024

I also re-checked with updated .cppcheck_suppressions in autoware.universe and apply the changed at 76a9da9 and
c5123d7.

You may need to use --inline-suppr to enable the inline suppression feature for checking with cppcheck.

Copy link

@YamatoAndo YamatoAndo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM!
(I haven't reviewed the include/pclomp because it is scheduled to be deleted.)

@YamatoAndo
Copy link

@SakodaShintaro Could you please start your review?

@a-maumau
Copy link
Author

a-maumau commented Aug 7, 2024

To avoid the build error until merging the autowarefoundation/autoware.universe#8124 , I added estimate_xy_covariance_by_Laplace_approximation for the temporal compatibility.

Copy link

@SakodaShintaro SakodaShintaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

@SakodaShintaro SakodaShintaro merged commit 84007b9 into tier4:tier4/main Aug 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants