|
| 1 | +# GNSS Log Parser |
| 2 | +This is a cross-platform library and application for parsing NovAtel GNSS command output message logs. The project includes a standalone class library, a cross-platform command-line tool, and a Windows GUI application. |
| 3 | + |
| 4 | +This project is a [fork of the parser designed by Ishan Pranav](https://github.com/BeckmanAvionics/gps-output-parser) for [Arnold O. Beckman High School\'s Avionics Team](https://github.com/BeckmanAvionics), part of the Irvine CubeSat STEM Program. The software is designed for compatibility with NovAtel\'s OEM6 and OEM7 products. |
| 5 | +## Screenshots |
| 6 | + |
| 7 | +## API Documentation |
| 8 | +The example below uses an ASCII parser to read messages from a string. Binary and Abbreviated ASCII messages are not supported. |
| 9 | +```csharp |
| 10 | +string value = @"# |
| 11 | +BESTPOSA,COM1,0,90.5,FINESTEERING,1949,403742.000,02000000,b1f6,32768; |
| 12 | +SOL_COMPUTED,SINGLE,51.11636937989,-114.03825348307,1064.533,-16.9000, |
| 13 | +WGS84,1.3610,1.0236,2.4745,"""",0.000,0.000,19,19,19,19,00,06,00,33 |
| 14 | +*6e08fa22 |
| 15 | +"; |
| 16 | +AsciiGpsParser parser = new AsciiGpsParser(); |
| 17 | + |
| 18 | +await foreach (AsciiMessage message in parser.ParseAsync(value)) |
| 19 | +{ |
| 20 | + // Process the message |
| 21 | +} |
| 22 | +``` |
| 23 | +### Built-in logs |
| 24 | +Each [GNSS log](https://docs.novatel.com/OEM7/Content/Logs/Core_Logs.htm) needs a dedicated model in the parser. The following built-in logs are automatically registered. |
| 25 | +| Command | Model Class | |
| 26 | +| ------- | ----------- | |
| 27 | +| [`ALIGNBSLNENU`](https://docs.novatel.com/OEM7/Content/Logs/ALIGNBSLNENU.htm) | `EnuBaselinesUsingAlignCommand` | |
| 28 | +| [`ALIGNBSLNXYZ`](https://docs.novatel.com/OEM7/Content/Logs/ALIGNBSLNXYZ.htm) | `XyzBaselinesUsingAlignCommand` | |
| 29 | +| [`ALIGNDOP`](https://docs.novatel.com/OEM7/Content/Logs/ALIGNDOP.htm) | `DopCommand` | |
| 30 | +| [`BESTPOS`](https://docs.novatel.com/OEM7/Content/Logs/BESTPOS.htm) | `BestPositionCommand` | |
| 31 | +| [`RXSTATUS`](https://docs.novatel.com/OEM7/Content/Logs/RXSTATUS.htm) | `ReceiverStatusCommand` | |
| 32 | + |
| 33 | +### Custom logs |
| 34 | +To add support for the GNSS [`TIME`](https://docs.novatel.com/OEM7/Content/Logs/TIME.htm) command, create a new class annotated with the `CommandAttribute`. The parser uses [CsvHelper](https://github.com/JoshClose/CsvHelper) to map strings to objects. |
| 35 | +```csharp |
| 36 | +[Command("TIME")] // Command name |
| 37 | +public class TimeCommand |
| 38 | +{ |
| 39 | + [Index(0)] // Field position |
| 40 | + public GnssClockModelStatus Status { get; } |
| 41 | +} |
| 42 | + |
| 43 | +public enum GnssClockModelStatus |
| 44 | +{ |
| 45 | + [Name("VALID")] // ASCII message representation |
| 46 | + Valid = 0, // Binary message representation |
| 47 | + |
| 48 | + [Name("CONVERGING")] |
| 49 | + Converging = 1, |
| 50 | + |
| 51 | + [Name("ITERATING")] |
| 52 | + Iterating = 2, |
| 53 | + |
| 54 | + [Name("INVALID")] |
| 55 | + Invalid = 3 |
| 56 | +} |
| 57 | +``` |
| 58 | +Then, add the class to the parser: |
| 59 | + |
| 60 | +```csharp |
| 61 | +parser.TryRegister<TimeCommand>(); |
| 62 | +``` |
| 63 | +## Command-line interface |
| 64 | +Provide a path to a log file: |
| 65 | +```posh |
| 66 | +IrvineCubeSat.GpsParser.Console.exe "Logs\Log1.gps" |
| 67 | +``` |
| 68 | +Or a string: |
| 69 | +```posh |
| 70 | +IrvineCubeSat.GpsParser.Console.exe "#BESTPOSA,COM1,0,90.5,FINESTEERING,1949,403742.000,02000000,b1f6,32768;SOL_COMPUTED,SINGLE,51.11636937989,-114.03825348307,1064.533,-16.9000,WGS84,1.3610,1.0236,2.4745,UNKNOWN,0.000,0.000,19,19,19,19,00,06,00,33*6e08fa22" |
| 71 | +``` |
| 72 | +Then retrieve the JSON output: |
| 73 | +```json |
| 74 | +[ |
| 75 | + { |
| 76 | + "header": { |
| 77 | + "command": "BESTPOS", |
| 78 | + "port": "COM1", |
| 79 | + "sequenceNumber": 0, |
| 80 | + "idleTime": 90.5, |
| 81 | + "timeStatus": 180, |
| 82 | + "week": 1949, |
| 83 | + "weekOffset": "4.16:09:02", |
| 84 | + "timestamp": "2017-05-17T16:09:02", |
| 85 | + "receiverStatus": 33554432, |
| 86 | + "receiverSoftwareVersion": 32768 |
| 87 | + }, |
| 88 | + "command": { |
| 89 | + "solutionStatus": 0, |
| 90 | + "positionType": 16, |
| 91 | + "latitude": 51.11636937989, |
| 92 | + "longitude": -114.03825348307, |
| 93 | + "height": 1064.533, |
| 94 | + "undulation": -16.9, |
| 95 | + "datumIdNumber": 61, |
| 96 | + "latitudeStandardDeviation": 1.361, |
| 97 | + "longitudeStandardDeviation": 1.0236, |
| 98 | + "heightStandardDeviation": 2.4745, |
| 99 | + "baseStationId": "UNKNOWN", |
| 100 | + "differentialAge": "00:00:00", |
| 101 | + "solutionAge": "00:00:00", |
| 102 | + "satellitesTracked": 19, |
| 103 | + "satellitesInSolution": 19, |
| 104 | + "l1SatellitesInSolution": 19, |
| 105 | + "multiFrequencySatellitesInSolution": 19 |
| 106 | + }, |
| 107 | + "checksum": 1846082082, |
| 108 | + "expectedChecksum": 1696927800, |
| 109 | + "raw": "BESTPOSA,COM1,0,90.5,FINESTEERING,1949,403742.000,02000000,b1f6,32768;SOL_COMPUTED,SINGLE,51.11636937989,-114.03825348307,1064.533,-16.9000,WGS84,1.3610,1.0236,2.4745,UNKNOWN,0.000,0.000,19,19,19,19,00,06,00,33" |
| 110 | + } |
| 111 | +] |
| 112 | +``` |
| 113 | +The command-line interface supports all .NET-compatible operating systems. |
| 114 | +## License |
| 115 | +This repository is licensed with the [MIT](LICENSE.txt) license. |
| 116 | +## Attribution |
| 117 | +This software uses third-party libraries or other resources that may be |
| 118 | +distributed under licenses different than the software. Please see the third-party notices included [here](THIRD-PARTY-NOTICES.txt). |
| 119 | +## References |
| 120 | +- [32-bit CRC](https://docs.novatel.com/OEM7/Content/Messages/32_Bit_CRC.htm) |
| 121 | +- [ASCII Messages](https://docs.novatel.com/OEM7/Content/Messages/ASCII.htm) |
| 122 | +- [Messages](https://docs.novatel.com/OEM7/Content/Messages/Messages.htm) |
| 123 | +- [NovAtel OEM6 Family Firmware Reference Manual](https://hexagondownloads.blob.core.windows.net/public/Novatel/assets/Documents/Manuals/om-20000129/om-20000129.pdf) |
| 124 | +- [NovAtel OEM7 GNSS Logs](https://docs.novatel.com/OEM7/Content/Logs/Core_Logs.htm) |
0 commit comments