Fix tolerance for axis-angle conversion of quaternions#620
Fix tolerance for axis-angle conversion of quaternions#620scpeters merged 4 commits intogazebosim:gz-math7from
Conversation
Signed-off-by: Shameek Ganguly <shameekarcanesphinx@gmail.com>
Signed-off-by: Shameek Ganguly <shameekarcanesphinx@gmail.com>
Signed-off-by: Shameek Ganguly <shameekarcanesphinx@gmail.com>
|
There's a new compiler warning on macOS. The previous build (https://build.osrfoundation.org/job/gz_math-ci-pr_any-homebrew-amd64/170/) didn't have this. Not sure if that's because the OS versions are different or doing the |
Signed-off-by: Shameek Ganguly <shameekarcanesphinx@gmail.com>
Looks like we have a template instantiation for Quaternion with integer data in https://github.com/gazebosim/gz-math/blob/gz-math7/src/python_pybind11/src/Quaternion.hh which caused this check to trip. |
🦟 Bug fix
Summary
Quaternions smaller than 1e-3 in length are currently treated as 0 when converting to axis angle. This is because the squared length of the quaternion is compared to 0 with an epsilon of 1e-6. The fix is to compare the length of the quaternion instead of the squared length so that only a quaternion of length smaller than 1e-6 (default epsilon in
math::equal(...)) is treated as zero for this conversion.Checklist
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-bymessages.