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

Question about jacobian derivation process #2

Open
codehory opened this issue Apr 23, 2023 · 4 comments
Open

Question about jacobian derivation process #2

codehory opened this issue Apr 23, 2023 · 4 comments

Comments

@codehory
Copy link

Hi @narutojxl , thanks for your code notes !
I have some questions:

  1. quaternion in Hamilton or JPL?
  2. jacobian derivation in lidar_pure_odom_factor.hpp. Could you please show me your derivation process?

Thanks in advance!

@narutojxl
Copy link
Owner

Hi @codehory,
Q1: quternion convention is hamilton.
Q2: It's been a long time now, and I can't remember the details clearly. Perhaps you can take a look at this question,gogojjh/M-LOAM#8.

@codehory
Copy link
Author

Thanks for your reply!

The function LeftQuatMatrix in math.hpp shows the quaternion convention may be in JPL. Could it be that I misunderstood the code?

template<typename Derived> inline Eigen::Matrix<typename Derived::Scalar, 4, 4> LeftQuatMatrix(const Eigen::QuaternionBase<Derived> &q) { Eigen::Matrix<typename Derived::Scalar, 4, 4> m; Eigen::Matrix<typename Derived::Scalar, 3, 1> vq = q.vec(); typename Derived::Scalar q4 = q.w(); m.block(0, 0, 3, 3) << q4 * I3x3 + SkewSymmetric(vq); m.block(3, 0, 1, 3) << -vq.transpose(); m.block(0, 3, 3, 1) << vq; m(3, 3) = q4; return m; }

@narutojxl
Copy link
Owner

It is wried, i remeber eigen and ceres quaternions are all hamilton and ceres's normal eqaution update is right delta update, namely, x_new = x_old * delta_x.
If the author want to use JPL convention, although eigen's quaternion is hamilton, it should be m.block(0, 0, 3, 3) << q4 * I3x3 - SkewSymmetric(vq); it is a typo?
If it is true, the author's assume eigen quaternion is JPL convention.
I remeber, when i deriving, i assume quaternion is hamilton, and follow right perturbation formula or lie algebra differentiation, I don't remember exactly which one it is, but the two ones are all consistent with ceres's normal eqaution update convention.
Why some jacobians of mine is the same with author, some not, it is a problem.

m.block(0, 0, 3, 3) << q4 * I3x3 + SkewSymmetric(vq); //

@codehory
Copy link
Author

codehory commented Apr 25, 2023

Thanks for your reply!

I used right perturbation to derive jacobian in LidarPureOdomPlaneNormFactor.

Line 68: the result is the same with yours. But the author looks like to use left perturbation equation

Line 84: all consistent

Line 100: my result is jaco_ex.rightCols<3>() = -w.transpose() * Rp.transpose() * Ri * Rext * Utility::skewSymmetric(point_);
the author looks like to use left perturbation equation. But I also can not match your result.

Line 287: the result is the same with yours. May be the author's result is wrong.

I'm not sure whether there are still some errors in my derivation.

If the author really has so many mistakes, why can this project continue to run normally?

// jaco_ex.rightCols<3>() = -w.transpose() * Rp.transpose() * Ri * Utility::skewSymmetric(Rext * point_) * Rext;

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

No branches or pull requests

2 participants