diff --git a/receiver/decode_ubx.py b/receiver/decode_ubx.py index a54440a..e6f9aba 100644 --- a/receiver/decode_ubx.py +++ b/receiver/decode_ubx.py @@ -16,7 +16,7 @@ from cssrlib.rawnav import rcvDec, rcvOpt from binascii import hexlify -CPSTD_VALID = 5 # stdev threshold of valid carrier-phase +CPSTD_VALID = 0.2 # stdev threshold of valid carrier-phase class ubx(rcvDec): @@ -156,9 +156,15 @@ def decode_obs(self, buff, k=6): ' CPSTD_VALID: + if (trk & 2) == 0 or cp_ == -0.5 or (sig_cp > CPSTD_VALID): cp_ = 0.0 sys, prn = self.svid2prn(gnss, svid) @@ -187,10 +193,10 @@ def decode_obs(self, buff, k=6): cn[sat] = {} slip = 0x01 if locktime == 0 else 0 - halfv = 0x02 if (trk & 4) != 0 else 0 - halfc = 0x80 if (trk & 8) != 0 else 0 + halfv = 0x02 if (trk & 4) == 0 else 0 + # halfc = 0x80 if (trk & 8) != 0 else 0 - lli_ = slip + halfv + halfc + lli_ = slip + halfv pr[sat][idx] = pr_ cp[sat][idx] = cp_