Function onboard_computer::application::run_gnss
source · fn run_gnss(rng: Rng<'static>) -> SpawnToken<impl Sized>
Expand description
Exercise: Parse GNSS data from NMEA 0183 sentences
This task parses NMEA sentences simulated from a GNSS data log file
The task picks random sentences from a log file and looks out for GNS
and GSV
messages
Print the ID’s of satellites used for fix in GSA sentence and the satellites in view from the GSV sentence
nmea
crate docs: https://docs.rs/nmea
- Add the
nmea
crate to theCargo.toml
of theonboard-computer
- You should exclude the
default-features
of the crate, as we operate inno_std
environment - Alternate solution: You can add the crate to the
workspace
dependencies of the project in theCargo.toml
of the project For more details see: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
- Use the
nmea
crate to parse the sentences - Print the parsing result (for debugging purposes) using
esp_println::println!()
- Use a match on the result and handle the cases:
- GSA - print “The IDs of satellites used for fix: {x:?}” field
- GSV - print “Satellites in View: {x}” field
- Repeat this processes every 2 seconds.