{"action":"created","issue":{"url":"https://api.github.com/repos/diydrones/ardupilot/issues/2142","labels_url":"https://api.github.com/repos/diydrones/ardupilot/issues/2142/labels{/name}","comments_url":"https://api.github.com/repos/diydrones/ardupilot/issues/2142/comments","events_url":"https://api.github.com/repos/diydrones/ardupilot/issues/2142/events","html_url":"https://github.com/diydrones/ardupilot/pull/2142","id":69312470,"number":2142,"title":"ArduCopter: log primary compass","user":{"login":"andyp1per","id":2893260,"avatar_url":"https://avatars.githubusercontent.com/u/2893260?v=3","gravatar_id":"","url":"https://api.github.com/users/andyp1per","html_url":"https://github.com/andyp1per","followers_url":"https://api.github.com/users/andyp1per/followers","following_url":"https://api.github.com/users/andyp1per/following{/other_user}","gists_url":"https://api.github.com/users/andyp1per/gists{/gist_id}","starred_url":"https://api.github.com/users/andyp1per/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyp1per/subscriptions","organizations_url":"https://api.github.com/users/andyp1per/orgs","repos_url":"https://api.github.com/users/andyp1per/repos","events_url":"https://api.github.com/users/andyp1per/events{/privacy}","received_events_url":"https://api.github.com/users/andyp1per/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-18T14:17:10Z","updated_at":"2015-04-20T12:45:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/diydrones/ardupilot/pulls/2142","html_url":"https://github.com/diydrones/ardupilot/pull/2142","diff_url":"https://github.com/diydrones/ardupilot/pull/2142.diff","patch_url":"https://github.com/diydrones/ardupilot/pull/2142.patch"},"body":"The compass code (on Pixhawk at least) will fallback to a \"healthy\"\r\ncompass if the primary compass is deemed unhealthy (can't get a reading\r\nfor 0.2s on Pixhawk). Unfortunately it's currently not clear when this\r\nis happening and if the compass outputs are significantly different in\r\nflight can lead to unexplained yaw errors as the compass heading used will jump around as\r\nthe vehicle switches between compasses. This patch simply logs the\r\nprimary compass to the dataflash logs allowing easy diagnosis. The picture attached shows the output\r\nusing my faulty compass. I'm pretty sure this functionality would be useful, not only for faulty compasses, but for faulty connections to the compass affected by vibration.\r\nI created this patch because I was having a hard time convincing 3DR that my compass was faulty,\r\nthis log output makes it all very clear :)\r\nThis patch is very safe as it is only a logging change. I considered logging other metrics of compass health, but just knowing which compass was being used at any time seemed like the most obvious.\r\n![log_primary](https://cloud.githubusercontent.com/assets/2893260/7215740/7be00fa0-e5dc-11e4-977c-ee17941860fe.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/diydrones/ardupilot/issues/comments/94442878","html_url":"https://github.com/diydrones/ardupilot/pull/2142#issuecomment-94442878","issue_url":"https://api.github.com/repos/diydrones/ardupilot/issues/2142","id":94442878,"user":{"login":"rmackay9","id":1498098,"avatar_url":"https://avatars.githubusercontent.com/u/1498098?v=3","gravatar_id":"","url":"https://api.github.com/users/rmackay9","html_url":"https://github.com/rmackay9","followers_url":"https://api.github.com/users/rmackay9/followers","following_url":"https://api.github.com/users/rmackay9/following{/other_user}","gists_url":"https://api.github.com/users/rmackay9/gists{/gist_id}","starred_url":"https://api.github.com/users/rmackay9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmackay9/subscriptions","organizations_url":"https://api.github.com/users/rmackay9/orgs","repos_url":"https://api.github.com/users/rmackay9/repos","events_url":"https://api.github.com/users/rmackay9/events{/privacy}","received_events_url":"https://api.github.com/users/rmackay9/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T12:45:36Z","updated_at":"2015-04-20T12:45:36Z","body":"I had a quick look and I can't find any place where it changes the primary compass.  I remember that it use to but now, as far as I can tell, it always just uses the value in _primary and this is never changed.\r\nhttps://github.com/diydrones/ardupilot/blob/master/libraries/AP_Compass/Compass.h#L223"}}