Skip to content

Commit

Permalink
Fixed rot
Browse files Browse the repository at this point in the history
Signed-off-by: Shintaro Sakoda <[email protected]>
  • Loading branch information
SakodaShintaro committed Apr 1, 2024
1 parent 31ed17e commit 4154047
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/estimate_covariance/estimate_covariance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,14 @@ std::vector<Eigen::Matrix4f> propose_poses_to_search(const NdtResult& ndt_result
assert(offset_x.size() == offset_y.size());
const Eigen::Matrix<double, 6, 6>& hessian = ndt_result.hessian;
const Eigen::Matrix4f& center_pose = ndt_result.pose;
const Eigen::Matrix2d covariance = estimate_xy_covariance_by_Laplace_approximation(hessian);
// const Eigen::Matrix2d rot = find_rotation_matrix_aligning_covariance_to_principal_axes(-covariance);

// (1) calculate rot by pose (default)
const Eigen::Matrix2d rot = ndt_result.pose.topLeftCorner<2, 2>().cast<double>();

// (2) calculate rot by covariance (alternative)
// const Eigen::Matrix2d covariance = estimate_xy_covariance_by_Laplace_approximation(hessian);
// const Eigen::Matrix2d rot = find_rotation_matrix_aligning_covariance_to_principal_axes(-covariance);

std::vector<Eigen::Matrix4f> poses_to_search;
for(int i = 0; i < static_cast<int>(offset_x.size()); i++) {
const Eigen::Vector2d pose_offset(offset_x[i], offset_y[i]);
Expand Down

0 comments on commit 4154047

Please sign in to comment.