@@ -103,34 +103,13 @@ ResultOfMultiNdtCovarianceEstimation estimate_xy_covariance_by_multi_ndt_score(
103
103
return {mean, covariance, poses_to_search, ndt_results};
104
104
}
105
105
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
-
118
106
std::vector<Eigen::Matrix4f> propose_poses_to_search (
119
107
const NdtResult & ndt_result, const std::vector<double > & offset_x,
120
108
const std::vector<double > & offset_y)
121
109
{
122
110
assert (offset_x.size () == offset_y.size ());
123
111
const Eigen::Matrix4f & center_pose = ndt_result.pose ;
124
-
125
- // (1) calculate rot by pose (default)
126
112
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
-
134
113
std::vector<Eigen::Matrix4f> poses_to_search;
135
114
for (int i = 0 ; i < static_cast <int >(offset_x.size ()); i++) {
136
115
const Eigen::Vector2d pose_offset (offset_x[i], offset_y[i]);
0 commit comments