You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue when using Rot3().quaternion().x(), Rot3().quaternion().y(), Rot3().quaternion().z(), or Rot3().quaternion().w() to access the components of a quaternion. For example, when using Rot3().quaternion().w() to access qw, it actually returns qz.
From the first 2 lines of the result above we can see that, the correct components of the quaternion should be qw: 0.782240 qx: 0.589819 qy: 0.199939 qz: 0.000000
However, when I construct a Rot3() instance with the quaternion constructor and access the components through the getters such as quaternion().x(), it returns the wrong component(it returns quaternion().w()).
Though using the index I can get the component in the right order(see the last line of the result), where quaternion()[0],[1],[2],[3] corresponding to qw, qx, qy, and qz.
Additionally, after checking the source code, I'm sure the quaternion passed to the Rot3() constructor is correct, as shown below:
Description
There is an issue when using
Rot3().quaternion().x()
,Rot3().quaternion().y()
,Rot3().quaternion().z()
, orRot3().quaternion().w()
to access the components of a quaternion. For example, when usingRot3().quaternion().w()
to accessqw
, it actually returnsqz
.Steps to reproduce
Using the flowing code to reproduce the bug:
Expected behavior
From the first 2 lines of the result above we can see that, the correct components of the quaternion should be
qw: 0.782240 qx: 0.589819 qy: 0.199939 qz: 0.000000
However, when I construct a
Rot3()
instance with the quaternion constructor and access the components through the getters such asquaternion().x()
, it returns the wrong component(it returns quaternion().w()).Though using the index I can get the component in the right order(see the last line of the result), where
quaternion()[0],[1],[2],[3]
corresponding to qw, qx, qy, and qz.Additionally, after checking the source code, I'm sure the quaternion passed to the
Rot3()
constructor is correct, as shown below:gtsam/gtsam/geometry/Rot3.h
Line 121 in 342f30d
Environment
Additional information
The text was updated successfully, but these errors were encountered: