{"action":"created","issue":{"url":"https://api.github.com/repos/swift-nav/gnss-converters/issues/25","repository_url":"https://api.github.com/repos/swift-nav/gnss-converters","labels_url":"https://api.github.com/repos/swift-nav/gnss-converters/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/swift-nav/gnss-converters/issues/25/comments","events_url":"https://api.github.com/repos/swift-nav/gnss-converters/issues/25/events","html_url":"https://github.com/swift-nav/gnss-converters/pull/25","id":184130564,"number":25,"title":"Improve logic around invalid l1 and l2 obs handling","user":{"login":"mfine","id":60851,"avatar_url":"https://avatars.githubusercontent.com/u/60851?v=3","gravatar_id":"","url":"https://api.github.com/users/mfine","html_url":"https://github.com/mfine","followers_url":"https://api.github.com/users/mfine/followers","following_url":"https://api.github.com/users/mfine/following{/other_user}","gists_url":"https://api.github.com/users/mfine/gists{/gist_id}","starred_url":"https://api.github.com/users/mfine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfine/subscriptions","organizations_url":"https://api.github.com/users/mfine/orgs","repos_url":"https://api.github.com/users/mfine/repos","events_url":"https://api.github.com/users/mfine/events{/privacy}","received_events_url":"https://api.github.com/users/mfine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-20T04:06:39Z","updated_at":"2016-10-20T07:28:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/swift-nav/gnss-converters/pulls/25","html_url":"https://github.com/swift-nav/gnss-converters/pull/25","diff_url":"https://github.com/swift-nav/gnss-converters/pull/25.diff","patch_url":"https://github.com/swift-nav/gnss-converters/pull/25.patch"},"body":"Improve the logic around invalid l1 and l2 obs.\r\n\r\n/cc @ljbade @anth-cole "},"comment":{"url":"https://api.github.com/repos/swift-nav/gnss-converters/issues/comments/255029753","html_url":"https://github.com/swift-nav/gnss-converters/pull/25#issuecomment-255029753","issue_url":"https://api.github.com/repos/swift-nav/gnss-converters/issues/25","id":255029753,"user":{"login":"ljbade","id":1215089,"avatar_url":"https://avatars.githubusercontent.com/u/1215089?v=3","gravatar_id":"","url":"https://api.github.com/users/ljbade","html_url":"https://github.com/ljbade","followers_url":"https://api.github.com/users/ljbade/followers","following_url":"https://api.github.com/users/ljbade/following{/other_user}","gists_url":"https://api.github.com/users/ljbade/gists{/gist_id}","starred_url":"https://api.github.com/users/ljbade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljbade/subscriptions","organizations_url":"https://api.github.com/users/ljbade/orgs","repos_url":"https://api.github.com/users/ljbade/repos","events_url":"https://api.github.com/users/ljbade/events{/privacy}","received_events_url":"https://api.github.com/users/ljbade/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T07:28:02Z","updated_at":"2016-10-20T07:28:02Z","body":"@mark I found the fix:\r\n```\r\ndiff --git a/haskell/src/Data/RTCM3/SBP.hs b/haskell/src/Data/RTCM3/SBP.hs\r\nindex b9347b4..a5cad6d 100644\r\n--- a/haskell/src/Data/RTCM3/SBP.hs\r\n+++ b/haskell/src/Data/RTCM3/SBP.hs\r\n@@ -215,16 +215,16 @@ toWn mjd = (mjd - mjdEpoch) `div` 7\r\n -- See DF011 and DF012 of the RTCM3 spec\r\n invalid_L1 :: GpsL1Observation -> Bool\r\n invalid_L1 l1 =\r\n-  l1 ^. gpsL1Observation_pseudorange == 0x80000      ||\r\n-  l1 ^. gpsL1Observation_carrierMinusCode == 0x80000\r\n+  l1 ^. gpsL1Observation_pseudorange == 524288      ||\r\n+  l1 ^. gpsL1Observation_carrierMinusCode == -524288\r\n \r\n -- | Determine whether an L1 + L2 RTCM observation is invalid.\r\n --\r\n -- See DF011, DF012, and DF018 of the RTCM3 spec\r\n invalid_L2 :: GpsL2Observation -> Bool\r\n invalid_L2 l2 =\r\n-  l2 ^. gpsL2Observation_pseudorangeDifference == 0x2000 ||\r\n-  l2 ^. gpsL2Observation_carrierMinusCode == 0x80000\r\n+  l2 ^. gpsL2Observation_pseudorangeDifference == -8192 ||\r\n+  l2 ^. gpsL2Observation_carrierMinusCode == -524288\r\n \r\n -- | Construct metric pseudorange (meters!) from L1 RTCM observation.\r\n --\r\n@@ -543,4 +543,3 @@ newStore = do\r\n   day <- utctDay <$> getCurrentTime\r\n   let wn = fromIntegral $ div (diffDays day (fromGregorian 1980 1 6)) 7\r\n   Store <$> newIORef wn <*> newIORef mempty <*> newIORef mempty\r\n-\r\n```\r\n\r\nThe explanation is that we store some of the RTCM fields as signed ints. Haskell does not interpret `0x20000` as a two's complement signed number, instead if becomes a unsigned integer. Using the actual negative decimal number `-8192` works however."}}
{"actor":{"display_login":"ljbade"}}