Skip to content

fix inconsistent results of tf2::getEulerYPR and tf2::getYaw compared to tf2::Matrix3x3::getEulerYPR - #1001

Open
fabianhirmann wants to merge 1 commit into
ros2:rollingfrom
ARTI-Robots:bugfix/inconsistent_get_euler_ypr
Open

fabianhirmann wants to merge 1 commit into
ros2:rollingfrom
ARTI-Robots:bugfix/inconsistent_get_euler_ypr

Conversation

@fabianhirmann

Copy link
Copy Markdown

Description

  • fix inconsistent results of tf2::getEulerYPR and tf2::getYaw compared to tf2::Matrix3x3::getEulerYPR by simply using the seemingly more stable version of tf2::Matrix3x3::getEulerYPR
    • More stable results in this case means that for the special case of (roll=0°, pitch=90°, yaw=0°) converted to a quaternion, tf2::Matrix3x3::getEulerYPR returns the expected result (roll=0°, pitch=90°, yaw=0°) (the same as the original input), while tf2::getEulerYPR and tf2::getYaw return (roll=0°, pitch=45°, yaw=180°).
  • extend test cases for util functions (mostly taken from Fix numerical precision issues in quaternion to RPY conversion #811 but extended with cases that are still failing at that other PR)

Assuming the test cases from #811 are representing the issue in #796, this also fixes #796.

Is this user-facing behavior change?

Yes, before tf2::getEulerYPR and tf2::getYaw could produce different results than tf2::Matrix3x3::getEulerYPR (although stated in the comment of tf2::getEulerYPR that the results should be the same). Now with this change since simply tf2::Matrix3x3::getEulerYPR is reused, the results are exactly the same.

Did you use Generative AI?

Additional Information

… to tf2::Matrix3x3::getEulerYPR by simply using the seemingly stable version of tf2::Matrix3x3::getEulerYPR; extend test cases for util functions (mostly taken from ros2#811 but extended with cases that were still different at that PR)

Signed-off-by: Fabian Hirmann <f.hirmann@arti-robots.com>
@fabianhirmann

Copy link
Copy Markdown
Author

Since there is no API/ABI change, please backport this change to at least humble as well.

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

Successfully merging this pull request may close these issues.

Numeric error produces unexpected behavior on RPY angles computation

1 participant