Skip to content

Commit ac997e2

Browse files
authored
fix(autoware_ndt_scan_matcher): fix cppcheck unusedFunction (#9275)
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
1 parent c1f5ff0 commit ac997e2

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

localization/autoware_ndt_scan_matcher/include/autoware/ndt_scan_matcher/ndt_omp/estimate_covariance.hpp

-8
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@ ResultOfMultiNdtCovarianceEstimation estimate_xy_covariance_by_multi_ndt_score(
4848
pclomp::MultiGridNormalDistributionsTransform<pcl::PointXYZ, pcl::PointXYZ>> & ndt_ptr,
4949
const std::vector<Eigen::Matrix4f> & poses_to_search, const double temperature);
5050

51-
/** \brief Find rotation matrix aligning covariance to principal axes
52-
* (1) Compute eigenvalues and eigenvectors
53-
* (2) Compute angle for first eigenvector
54-
* (3) Return rotation matrix
55-
*/
56-
Eigen::Matrix2d find_rotation_matrix_aligning_covariance_to_principal_axes(
57-
const Eigen::Matrix2d & matrix);
58-
5951
/** \brief Propose poses to search.
6052
* (1) Compute covariance by Laplace approximation
6153
* (2) Find rotation matrix aligning covariance to principal axes

localization/autoware_ndt_scan_matcher/src/ndt_omp/estimate_covariance.cpp

-21
Original file line numberDiff line numberDiff line change
@@ -103,34 +103,13 @@ ResultOfMultiNdtCovarianceEstimation estimate_xy_covariance_by_multi_ndt_score(
103103
return {mean, covariance, poses_to_search, ndt_results};
104104
}
105105

106-
Eigen::Matrix2d find_rotation_matrix_aligning_covariance_to_principal_axes(
107-
const Eigen::Matrix2d & matrix)
108-
{
109-
const Eigen::SelfAdjointEigenSolver<Eigen::Matrix2d> eigensolver(matrix);
110-
if (eigensolver.info() == Eigen::Success) {
111-
const Eigen::Vector2d eigen_vec = eigensolver.eigenvectors().col(0);
112-
const double th = std::atan2(eigen_vec.y(), eigen_vec.x());
113-
return Eigen::Rotation2Dd(th).toRotationMatrix();
114-
}
115-
throw std::runtime_error("Eigen solver failed. Return output_pose_covariance value.");
116-
}
117-
118106
std::vector<Eigen::Matrix4f> propose_poses_to_search(
119107
const NdtResult & ndt_result, const std::vector<double> & offset_x,
120108
const std::vector<double> & offset_y)
121109
{
122110
assert(offset_x.size() == offset_y.size());
123111
const Eigen::Matrix4f & center_pose = ndt_result.pose;
124-
125-
// (1) calculate rot by pose (default)
126112
const Eigen::Matrix2d rot = ndt_result.pose.topLeftCorner<2, 2>().cast<double>();
127-
128-
// (2) calculate rot by covariance (alternative)
129-
// const Eigen::Matrix<double, 6, 6> & hessian = ndt_result.hessian;
130-
// const Eigen::Matrix2d covariance = estimate_xy_covariance_by_Laplace_approximation(hessian);
131-
// const Eigen::Matrix2d rot =
132-
// find_rotation_matrix_aligning_covariance_to_principal_axes(-covariance);
133-
134113
std::vector<Eigen::Matrix4f> poses_to_search;
135114
for (int i = 0; i < static_cast<int>(offset_x.size()); i++) {
136115
const Eigen::Vector2d pose_offset(offset_x[i], offset_y[i]);

0 commit comments

Comments
 (0)