|
| 1 | +package nmea |
| 2 | + |
| 3 | +const ( |
| 4 | + // TypePASHR type for ASHR sentences |
| 5 | + TypePASHR = "ASHR" |
| 6 | +) |
| 7 | + |
| 8 | +// PASHR represents proprietary roll and pitch sentence |
| 9 | +// https://gpsd.gitlab.io/gpsd/NMEA.html#_pashr_rt300_proprietary_roll_and_pitch_sentence |
| 10 | +// |
| 11 | +// Format: $-PASHR,hhmmss.sss,hhh.hh,T,rrr.rr,ppp.pp,xxx.xx,a.aaa,b.bbb,c.ccc,d,e*hh<CR><LF> |
| 12 | +// Example: $PASHR,085335.000,224.19,T,-01.26,+00.83,+00.10,0.101,0.113,0.267,1,0*07 |
| 13 | +type PASHR struct { |
| 14 | + BaseSentence |
| 15 | + Time Time |
| 16 | + Heading float64 |
| 17 | + TrueHeading string |
| 18 | + Roll float64 |
| 19 | + Pitch float64 |
| 20 | + Heave float64 |
| 21 | + RollAccuracy float64 |
| 22 | + PitchAccuracy float64 |
| 23 | + HeadingAccuracy float64 |
| 24 | + // GNSSQuality is the quality of the GNSS signal |
| 25 | + // The documentation differs from Trimble and Novatel about the meaning of the number. |
| 26 | + // |
| 27 | + // Trimble https://receiverhelp.trimble.com/oem-gnss/nmea0183-messages-pashr.html |
| 28 | + // |
| 29 | + // 0 – Fix not available |
| 30 | + // |
| 31 | + // 1 – GNSS mode, fix valid |
| 32 | + // |
| 33 | + // 2 – Differential GPS |
| 34 | + // |
| 35 | + // 3 – GNSS PPS mode |
| 36 | + // |
| 37 | + // 4 – Fixed RTK mode |
| 38 | + // |
| 39 | + // 5 – Float RTK mode |
| 40 | + // |
| 41 | + // 6 – DR mode |
| 42 | + // |
| 43 | + // Novatel https://docs.novatel.com/OEM7/Content/SPAN_Logs/PASHR.htm |
| 44 | + // |
| 45 | + // 0 = No position |
| 46 | + // |
| 47 | + // 1 = All non-RTK fixed integer positions |
| 48 | + // |
| 49 | + // 2 = RTK fixed integer position |
| 50 | + GNSSQuality int64 |
| 51 | + // IMUAlignmentStatus is the status of the IMU alignment |
| 52 | + // The documentation differs from Trimble and Novatel about the meaning of the number. |
| 53 | + // |
| 54 | + // Trimble https://receiverhelp.trimble.com/oem-gnss/nmea0183-messages-pashr.html |
| 55 | + // 0 – GPS Only |
| 56 | + // |
| 57 | + // 1 – Coarse Leveling |
| 58 | + // |
| 59 | + // 2 – Degraded Solution |
| 60 | + // |
| 61 | + // 3 – Aligned |
| 62 | + // |
| 63 | + // 4 – Full Navigation Mode |
| 64 | + // |
| 65 | + // Novatel https://docs.novatel.com/OEM7/Content/SPAN_Logs/PASHR.htm |
| 66 | + // |
| 67 | + // 0 = All SPAN Pre-Alignment INS Status |
| 68 | + // |
| 69 | + // 1 = All SPAN Post-Alignment INS Status - These include: INS_ALIGNMENT_COMPLETE, INS_SOLUTION_GOOD, INS_HIGH_VARIANCE, INS_SOLUTION_FREE |
| 70 | + IMUAlignmentStatus int64 |
| 71 | +} |
| 72 | + |
| 73 | +// newPASHR constructor |
| 74 | +func newPASHR(s BaseSentence) (Sentence, error) { |
| 75 | + p := NewParser(s) |
| 76 | + p.AssertType(TypePASHR) |
| 77 | + return PASHR{ |
| 78 | + BaseSentence: s, |
| 79 | + Time: p.Time(0, "time"), |
| 80 | + Heading: p.Float64(1, "heading"), |
| 81 | + TrueHeading: p.EnumString(2, "true heading", "T", "F"), |
| 82 | + Roll: p.Float64(3, "roll"), |
| 83 | + Pitch: p.Float64(4, "pitch"), |
| 84 | + Heave: p.Float64(5, "heave"), |
| 85 | + RollAccuracy: p.Float64(6, "roll accuracy"), |
| 86 | + PitchAccuracy: p.Float64(7, "pitch accuracy"), |
| 87 | + HeadingAccuracy: p.Float64(8, "heading accuracy"), |
| 88 | + GNSSQuality: p.Int64(9, "gnss quality"), |
| 89 | + IMUAlignmentStatus: p.Int64(10, "imu alignment status"), |
| 90 | + }, p.Err() |
| 91 | +} |
0 commit comments