Skip to content

Commit

Permalink
correct rotation Jacobians
Browse files Browse the repository at this point in the history
  • Loading branch information
JzHuai0108 committed Sep 5, 2023
1 parent 0f54bc7 commit a00e978
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/fast_gicp/gicp/impl/fast_gicp_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ double FastGICP<PointSource, PointTarget>::linearize(const Eigen::Isometry3d& tr
}

Eigen::Matrix<double, 4, 6> dtdx0 = Eigen::Matrix<double, 4, 6>::Zero();
dtdx0.block<3, 3>(0, 0) = skewd(transed_mean_A.head<3>());
dtdx0.block<3, 3>(0, 0) = skewd(trans.linear() * mean_A.head<3>());
dtdx0.block<3, 3>(0, 3) = -Eigen::Matrix3d::Identity();

Eigen::Matrix<double, 4, 6> jlossexp = dtdx0;
Expand Down
2 changes: 1 addition & 1 deletion include/fast_gicp/gicp/impl/fast_gicp_st_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ double FastGICPSingleThread<PointSource, PointTarget>::linearize(const Eigen::Is
}

Eigen::Matrix<double, 4, 6> dtdx0 = Eigen::Matrix<double, 4, 6>::Zero();
dtdx0.block<3, 3>(0, 0) = skewd(transed_mean_A.head<3>());
dtdx0.block<3, 3>(0, 0) = skewd(trans.linear() * mean_A.head<3>());
dtdx0.block<3, 3>(0, 3) = -Eigen::Matrix3d::Identity();

Eigen::Matrix<double, 4, 6> jlossexp = dtdx0;
Expand Down
2 changes: 1 addition & 1 deletion include/fast_gicp/gicp/impl/fast_vgicp_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ double FastVGICP<PointSource, PointTarget>::linearize(const Eigen::Isometry3d& t
}

Eigen::Matrix<double, 4, 6> dtdx0 = Eigen::Matrix<double, 4, 6>::Zero();
dtdx0.block<3, 3>(0, 0) = skewd(transed_mean_A.head<3>());
dtdx0.block<3, 3>(0, 0) = skewd(trans.linear() * mean_A.head<3>());
dtdx0.block<3, 3>(0, 3) = -Eigen::Matrix3d::Identity();

Eigen::Matrix<double, 4, 6> jlossexp = dtdx0;
Expand Down
2 changes: 1 addition & 1 deletion src/fast_gicp/cuda/compute_derivatives.cu
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct compute_derivatives_kernel {
Eigen::Vector3f error = mean_B - transed_mean_A;

Eigen::Matrix<float, 3, 6> dtdx0;
dtdx0.block<3, 3>(0, 0) = skew_symmetric(transed_mean_A);
dtdx0.block<3, 3>(0, 0) = skew_symmetric(R * mean_A);
dtdx0.block<3, 3>(0, 3) = -Eigen::Matrix3f::Identity();

Eigen::Matrix<float, 3, 6> J = dtdx0;
Expand Down
4 changes: 2 additions & 2 deletions src/fast_gicp/cuda/ndt_compute_derivatives.cu
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct p2d_ndt_compute_derivatives_kernel {
float err = w * error.transpose() * RCR_inv * error;

Eigen::Matrix<float, 3, 6> dtdx0;
dtdx0.block<3, 3>(0, 0) = skew_symmetric(transed_mean_A);
dtdx0.block<3, 3>(0, 0) = skew_symmetric(R * mean_A);
dtdx0.block<3, 3>(0, 3) = -Eigen::Matrix3f::Identity();

Eigen::Matrix<float, 3, 6> J = dtdx0;
Expand Down Expand Up @@ -151,7 +151,7 @@ struct d2d_ndt_compute_derivatives_kernel {
float err = w * error.transpose() * RCR_inv * error;

Eigen::Matrix<float, 3, 6> dtdx0;
dtdx0.block<3, 3>(0, 0) = skew_symmetric(transed_mean_A);
dtdx0.block<3, 3>(0, 0) = skew_symmetric(R * mean_A);
dtdx0.block<3, 3>(0, 3) = -Eigen::Matrix3f::Identity();

Eigen::Matrix<float, 3, 6> J = dtdx0;
Expand Down

0 comments on commit a00e978

Please sign in to comment.