Comments (5)
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:
- Trimble - NMEA-0183 message: GLL
- GPS NMEA 0183 Messaging Protocol 101
So I guess thatf64
is required, at least for lossless parsing.
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.
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.
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.
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.
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)
- Formatting/serialization support
- [Docs] List all sentence-types features in lib.rs & README
- #derive[Serialize] for chrono::NaiveTime uses collect_str which cannot be used in no_std
- xxGNS parsing issue HOT 1
- AIS NMEA messages HOT 4
- Additional message types support HOT 1
- README update - Contributing & dual license
- Iterator-based parser
- Supporting additional sentences HOT 20
- Fix failing test HOT 2
- Not all parts of a RMC sentence are parsed HOT 1
- Update README - what is NMEA 0183
- Fix chrono deprecation warning
- MWV and MDA to "all supported messages" test HOT 1
- Update README/docs for a new release
- CI: Fix code coverage reporting
- Parsing of vendor-specific extended sentences that are not included in the `SentenceType` fails. HOT 3
- Enable sentences with features HOT 7
- Support defmt HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmea.