Giter VIP home page Giter VIP logo

Comments (8)

hsong-MLE avatar hsong-MLE commented on May 31, 2024 1

Sorry work got a bit busy last week. I should be able to get it done this week. Sorry about the delay!

from navigation2.

SteveMacenski avatar SteveMacenski commented on May 31, 2024

Am I correct in saying that simply casting the double back down to a float resolve the issue?

return static_cast<unsigned int>(floor(static_cast<float>(theta) / bin_size));

If so, can you submit a PR, that should be easy enough to merge. I'll also take a look when you submit that PR at other implicit double -> float conversions. I did a quick glance and I see a small number of other places that I should be more explicit about that conversion, but this is the only critical one.

From the 3 places that its used, it looks like double really is the valid input type, so we can squash it in the function itself. Two could be made into floats, but one can't/shouldn't, so its easier to just change it in the method instead.

from navigation2.

hsong-MLE avatar hsong-MLE commented on May 31, 2024

Am I correct in saying that simply casting the double back down to a float resolve the issue?

return static_cast<unsigned int>(floor(static_cast<float>(theta) / bin_size));

If so, can you submit a PR, that should be easy enough to merge. I'll also take a look when you submit that PR at other implicit double -> float conversions. I did a quick glance and I see a small number of other places that I should be more explicit about that conversion, but this is the only critical one.

From the 3 places that its used, it looks like double really is the valid input type, so we can squash it in the function itself. Two could be made into floats, but one can't/shouldn't, so its easier to just change it in the method instead.

Correct, casting the double to a float resolves the issue.

I can submit a PR but I wonder which branch should it go towards?

from navigation2.

SteveMacenski avatar SteveMacenski commented on May 31, 2024

Put it towards main, but I'll immediately backport to Humble/Iron.

Thanks for the report and soon-to-come PR! 😄

from navigation2.

hsong-MLE avatar hsong-MLE commented on May 31, 2024

My pleasure!

I had trouble building main on my machine but humble works flawlessly. Would it be ok if I PR into humble instead?

from navigation2.

SteveMacenski avatar SteveMacenski commented on May 31, 2024

All PRs need to be targeted to main and I'll backport to Humble using our tools. If the static cast works in Humble, there's no reason it shouldn't in rolling as well. I looked into this as well and I don't see an issue with that. If your tests pass in Rolling as well (add those unit tests) then we're all good :-)

from navigation2.

SteveMacenski avatar SteveMacenski commented on May 31, 2024

Any update? Should be a small change 😄

from navigation2.

SteveMacenski avatar SteveMacenski commented on May 31, 2024

Merging imminent, waiting on CI

Thanks @hsong-MLE

from navigation2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.