GithubHelp home page GithubHelp logo

Comments (5)

clemarescx avatar clemarescx commented on June 12, 2024

From the first results I could find with a quick DuckDuckGo for "nmea gpgll", both Trimble (don't know them) and Arduino (I know them!) are using double precision in their examples:

Some datasheets for products on sparkfun.com are showing examples with single precision however (here or here), so 🤷‍♂️

To handle both f32 and f64, perhaps other crates like nalgebra or bevy can be an inspiration.

from nmea.

elpiel avatar elpiel commented on June 12, 2024

Good research.
I didn't quite understand where Trimble and Arduino use double precision.
For Trimble they mention mm,mmmm (0-7 digits) for lat/long, so f32 should be sufficient?

Also to be embedded friendly, we can just use f32 exclusively and only if the necessity arises to think of a way to allow a double (f64) precision.

from nmea.

clemarescx avatar clemarescx commented on June 12, 2024

For Trimble they mention mm,mmmm (0-7 digits) for lat/long, so f32 should be sufficient?

Ahh right, they mention mm.mmmm in the field meanings, but I referred myself to their example for the latitude and longitude (3953.88008971 and 10506.75318910 respectively), which are bigger than that format.
I copied them in VSCode and tried to assign them to an f32, and clippy immediately gave me the excessive_precision warning.

But if the format is respected, those values should instead be 53.8801 and 06.7532 (if we just keep the minutes), and indeed, both can fit as f32.
As for hardware limitations for embedded systems, I'm afraid I know very little in that domain so I don't know how much precision loss is acceptable.

from nmea.

elpiel avatar elpiel commented on June 12, 2024

Yes, you are right. It does give an error and somehow I thought that these values should fit in a f32 with 7 numbers after the decimal point.

It is 7 digits after the decimal point so f64 should be used. As far as the embedded limitations, people have told me that there is a way to store and use 2 memory addresses and for f64 on 32bit systems. Sadly this is where my experience ends with that solution 😅
This needs more research on how this could be used on embedded systems. When I get back home I can try to run it on my nrf board which has a 32bit microcontroller and see what it does.

I do know that rust automagically compiles any programs with f64 numbers on 32bit OS and it works but not sure about embedded systems.

from nmea.

elpiel avatar elpiel commented on June 12, 2024

Based on the research I did, double (f64) will work on 32bit systems with some performance penalty (probably not that large).

Nonetheless, I will run it on the nrf board I have just to confirm it before updating this issue.
The lat/long makes sense to be double, but we have to double check the other floating numbers in the parsers.

from nmea.

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.