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

Make the types explicit in quaternion_helper.hpp. #625

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

clalancette
Copy link
Contributor

Windows started complaining that there was possible loss of
precision. That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc). However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

This should fix the last warning we are currently getting from Windows, as seen in https://ci.ros2.org/view/nightly/job/nightly_win_rel/1750/ (as one example).

Windows started complaining that there was possible loss of
precision.  That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc).  However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@mjeronimo
Copy link
Contributor

Just a question for my own info... What does "we don't change the default when we vendor it" mean? What does it mean "to vendor" something?

@clalancette
Copy link
Contributor Author

clalancette commented Nov 12, 2020

Just a question for my own info... What does "we don't change the default when we vendor it" mean? What does it mean "to vendor" something?

Vendoring in general means that we are building a library/utility that isn't a core part of ROS 2. We vendor a number of libraries in ROS 2: Ogre, spdlog, libyaml, etc. The reasons for doing that vary, but often revolve around the library shipped by default in Linux being too old (spdlog is one example of that), or the library not being available in a convenient way in Windows or macOS.

In this case, we are vendoring Ogre here in the RViz package: https://github.com/ros2/rviz/tree/ros2/rviz_ogre_vendor . By default, Ogre uses float for everything. It is possible to override this when building it, but we don't in the vendored package. So by switching everything to float, we keep to the type that Ogre is using.

@mjeronimo
Copy link
Contributor

@clalancette Thanks for the explanation.

@clalancette
Copy link
Contributor Author

All right, CI is green all around, and I have approvals. Merging this with the hope that we get closer to green on Windows overnight.

@clalancette clalancette merged commit 23bb367 into ros2 Nov 12, 2020
@clalancette clalancette deleted the clalancette/quaternion-type-fix branch November 12, 2020 18:30
@clalancette clalancette added this to Proposed in Foxy Patch Release 4 via automation Nov 16, 2020
@clalancette clalancette moved this from Proposed to Needs backport in Foxy Patch Release 4 Nov 16, 2020
@jacobperron jacobperron removed this from Needs backport in Foxy Patch Release 4 Dec 11, 2020
@jacobperron jacobperron added this to Proposed in Foxy Patch Release 5 via automation Dec 11, 2020
@jacobperron jacobperron moved this from Proposed to Needs backport in Foxy Patch Release 5 Dec 11, 2020
chapulina pushed a commit that referenced this pull request Apr 20, 2021
Windows started complaining that there was possible loss of
precision.  That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc).  However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
chapulina added a commit that referenced this pull request Apr 21, 2021
Windows started complaining that there was possible loss of
precision.  That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc).  However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>

Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
@jacobperron jacobperron moved this from Needs backport to Needs release in Foxy Patch Release 5 May 25, 2021
@jacobperron jacobperron moved this from Needs release to Released in Foxy Patch Release 5 Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants