cartographer icon indicating copy to clipboard operation
cartographer copied to clipboard

why gravity_vector_ = rotation.conjugate() * gravity_vector_ use conjugate?

Open tinytinywell opened this issue 5 years ago • 3 comments

Hello I have three questions,first one is the title.

  1. why gravity_vector_ = rotation.conjugate() * gravity_vector_ use conjugate? // Change the 'orientation_' so that it agrees with the current // 'gravity_vector_'. const Eigen::Quaterniond rotation = Eigen::Quaterniond::FromTwoVectors( gravity_vector_, orientation_.conjugate() * Eigen::Vector3d::UnitZ()); orientation_ = (orientation_ * rotation).normalized(); 2.what does the commentary mean?Why orientation_ has to agree with the current gravity_vector? 3.why is "orientation_ = orientation_*rotation" not " rotation * orientation_"?

tinytinywell avatar Jul 05 '19 13:07 tinytinywell

i think it's a bug

garlinplus avatar Jul 25 '19 08:07 garlinplus

@tinytinywell why gravity_vector_ = rotation.conjugate() * gravity_vector_ use conjugate? As the object rotates,coordinate system change.Computing gravity_vector‘s coordinate in new coordinate system need use conjugate. I think.

vagrant-drift avatar Sep 12 '19 08:09 vagrant-drift

In my opinion, gravity_vector_ is with reference to the body frame while orientation_ means the transformation from body frame to world frame, and UnitZ vector stands for the normalized inverse gravity vector in world frame, thus we need the conjugate of orientation_ to transform it to body frame.

sunbingfeng avatar Jan 28 '21 02:01 sunbingfeng