{"action":"created","comment":{"url":"https://api.github.com/repos/PX4/Firmware/pulls/comments/201663444","pull_request_review_id":136206899,"id":201663444,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTY2MzQ0NA==","diff_hunk":"@@ -951,7 +952,7 @@ void Ekf2::run()\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \n-\t\t\t\t\t_ekf.setRangeData(range_finder.timestamp, range_finder.current_distance);\n+\t\t\t\t\tif (range_finder_updated) { _ekf.setRangeData(range_finder.timestamp, range_finder.current_distance); }","path":"src/modules/ekf2/ekf2_main.cpp","position":15,"original_position":15,"commit_id":"6ab7afabfdafac4fe7ff8762b6185b370442b4d0","original_commit_id":"6ab7afabfdafac4fe7ff8762b6185b370442b4d0","user":{"login":"priseborough","id":3596952,"node_id":"MDQ6VXNlcjM1OTY5NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/3596952?v=4","gravatar_id":"","url":"https://api.github.com/users/priseborough","html_url":"https://github.com/priseborough","followers_url":"https://api.github.com/users/priseborough/followers","following_url":"https://api.github.com/users/priseborough/following{/other_user}","gists_url":"https://api.github.com/users/priseborough/gists{/gist_id}","starred_url":"https://api.github.com/users/priseborough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priseborough/subscriptions","organizations_url":"https://api.github.com/users/priseborough/orgs","repos_url":"https://api.github.com/users/priseborough/repos","events_url":"https://api.github.com/users/priseborough/events{/privacy}","received_events_url":"https://api.github.com/users/priseborough/received_events","type":"User","site_admin":false},"body":"See https://github.com/PX4/ecl/pull/476","created_at":"2018-07-11T12:01:25Z","updated_at":"2018-07-11T12:01:26Z","html_url":"https://github.com/PX4/Firmware/pull/9865#discussion_r201663444","pull_request_url":"https://api.github.com/repos/PX4/Firmware/pulls/9865","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PX4/Firmware/pulls/comments/201663444"},"html":{"href":"https://github.com/PX4/Firmware/pull/9865#discussion_r201663444"},"pull_request":{"href":"https://api.github.com/repos/PX4/Firmware/pulls/9865"}},"in_reply_to_id":201218563},"pull_request":{"url":"https://api.github.com/repos/PX4/Firmware/pulls/9865","id":200032668,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMDMyNjY4","html_url":"https://github.com/PX4/Firmware/pull/9865","diff_url":"https://github.com/PX4/Firmware/pull/9865.diff","patch_url":"https://github.com/PX4/Firmware/pull/9865.patch","issue_url":"https://api.github.com/repos/PX4/Firmware/issues/9865","number":9865,"state":"open","locked":false,"title":"LL40LS & terrain estimation: Implement proper driver-specific filtering","user":{"login":"philipoe","id":2565608,"node_id":"MDQ6VXNlcjI1NjU2MDg=","avatar_url":"https://avatars3.githubusercontent.com/u/2565608?v=4","gravatar_id":"","url":"https://api.github.com/users/philipoe","html_url":"https://github.com/philipoe","followers_url":"https://api.github.com/users/philipoe/followers","following_url":"https://api.github.com/users/philipoe/following{/other_user}","gists_url":"https://api.github.com/users/philipoe/gists{/gist_id}","starred_url":"https://api.github.com/users/philipoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipoe/subscriptions","organizations_url":"https://api.github.com/users/philipoe/orgs","repos_url":"https://api.github.com/users/philipoe/repos","events_url":"https://api.github.com/users/philipoe/events{/privacy}","received_events_url":"https://api.github.com/users/philipoe/received_events","type":"User","site_admin":false},"body":"#### Issue\r\nSee https://github.com/PX4/Firmware/issues/9843\r\n\r\n#### Solution\r\nChanges:\r\n\r\n1) A driver-specific filtering that is based on datasheets and experiments with this sensor (based on the concept: \"If you know the specific weaknesses of your device, why not filter it directly inside the device driver). What is implemented is described [here](https://github.com/philipoe/Firmware/blob/fix/LL40LSsignalStrengthFiltering/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp#L516), but essentially we are now looking at a) absolute peak strength b) relative peak strength (basically signal-to-noise) and c) the absolute measurement to detect bull**** data.\r\n\r\n2) All distance sensors now have a `signal_strength` field. I know there is also a `covariance` field, but it seems like basically no other sensor is using this. Signal strength is also a different concept/metric than covariance (in my opinion it is a bit easier to determine signal strength than true covariance of the measurement), so i think it is good to have both.\r\n\r\n3) @priseborough @dagar I changed [this line](https://github.com/philipoe/Firmware/blob/fix/LL40LSsignalStrengthFiltering/src/modules/ekf2/ekf2_main.cpp#L955), because before I put the \"if\" statement the distance data was just _always_ forwarded to the EKF even if the device limits (i.e. min/max range) were exceeded. That did not seem right to me. Can you check this please?\r\n\r\n#### Testing\r\nThe filtering was tested on the bench extensively. In contrast to before, I am now getting very clean distance data from the sensor up to 27m distance, i.e. every time that LL40LS messes up the driver detects that and sets signal strength to zero. The EKF then just does not use that data because of [this line](https://github.com/philipoe/Firmware/blob/fix/LL40LSsignalStrengthFiltering/src/modules/ekf2/ekf2_main.cpp#L945) . I will flight test the whole PR today and give you further feedback.\r\n\r\n@ryanjAA or anyone else using the LidarLite: It would be good if you could test this with your sensors (which are slightly different versions) too.\r\n\r\n_Note: I am not really a low-level driver guy, so any feedback on what I might have messed up in the driver is greatly appreciated._","created_at":"2018-07-09T08:57:22Z","updated_at":"2018-07-11T12:01:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a83d7455d5193a6e59323b9b7c1f28e0a8cf1cbd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PX4/Firmware/pulls/9865/commits","review_comments_url":"https://api.github.com/repos/PX4/Firmware/pulls/9865/comments","review_comment_url":"https://api.github.com/repos/PX4/Firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PX4/Firmware/issues/9865/comments","statuses_url":"https://api.github.com/repos/PX4/Firmware/statuses/6ab7afabfdafac4fe7ff8762b6185b370442b4d0","head":{"label":"philipoe:fix/LL40LSsignalStrengthFiltering","ref":"fix/LL40LSsignalStrengthFiltering","sha":"6ab7afabfdafac4fe7ff8762b6185b370442b4d0","user":{"login":"philipoe","id":2565608,"node_id":"MDQ6VXNlcjI1NjU2MDg=","avatar_url":"https://avatars3.githubusercontent.com/u/2565608?v=4","gravatar_id":"","url":"https://api.github.com/users/philipoe","html_url":"https://github.com/philipoe","followers_url":"https://api.github.com/users/philipoe/followers","following_url":"https://api.github.com/users/philipoe/following{/other_user}","gists_url":"https://api.github.com/users/philipoe/gists{/gist_id}","starred_url":"https://api.github.com/users/philipoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipoe/subscriptions","organizations_url":"https://api.github.com/users/philipoe/orgs","repos_url":"https://api.github.com/users/philipoe/repos","events_url":"https://api.github.com/users/philipoe/events{/privacy}","received_events_url":"https://api.github.com/users/philipoe/received_events","type":"User","site_admin":false},"repo":{"id":25470237,"node_id":"MDEwOlJlcG9zaXRvcnkyNTQ3MDIzNw==","name":"Firmware","full_name":"philipoe/Firmware","owner":{"login":"philipoe","id":2565608,"node_id":"MDQ6VXNlcjI1NjU2MDg=","avatar_url":"https://avatars3.githubusercontent.com/u/2565608?v=4","gravatar_id":"","url":"https://api.github.com/users/philipoe","html_url":"https://github.com/philipoe","followers_url":"https://api.github.com/users/philipoe/followers","following_url":"https://api.github.com/users/philipoe/following{/other_user}","gists_url":"https://api.github.com/users/philipoe/gists{/gist_id}","starred_url":"https://api.github.com/users/philipoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipoe/subscriptions","organizations_url":"https://api.github.com/users/philipoe/orgs","repos_url":"https://api.github.com/users/philipoe/repos","events_url":"https://api.github.com/users/philipoe/events{/privacy}","received_events_url":"https://api.github.com/users/philipoe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/philipoe/Firmware","description":"PX4 Firmware for PX4FMU autopilot and PX4IO servo / failsafe board","fork":true,"url":"https://api.github.com/repos/philipoe/Firmware","forks_url":"https://api.github.com/repos/philipoe/Firmware/forks","keys_url":"https://api.github.com/repos/philipoe/Firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/philipoe/Firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/philipoe/Firmware/teams","hooks_url":"https://api.github.com/repos/philipoe/Firmware/hooks","issue_events_url":"https://api.github.com/repos/philipoe/Firmware/issues/events{/number}","events_url":"https://api.github.com/repos/philipoe/Firmware/events","assignees_url":"https://api.github.com/repos/philipoe/Firmware/assignees{/user}","branches_url":"https://api.github.com/repos/philipoe/Firmware/branches{/branch}","tags_url":"https://api.github.com/repos/philipoe/Firmware/tags","blobs_url":"https://api.github.com/repos/philipoe/Firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/philipoe/Firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/philipoe/Firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/philipoe/Firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/philipoe/Firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/philipoe/Firmware/languages","stargazers_url":"https://api.github.com/repos/philipoe/Firmware/stargazers","contributors_url":"https://api.github.com/repos/philipoe/Firmware/contributors","subscribers_url":"https://api.github.com/repos/philipoe/Firmware/subscribers","subscription_url":"https://api.github.com/repos/philipoe/Firmware/subscription","commits_url":"https://api.github.com/repos/philipoe/Firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/philipoe/Firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/philipoe/Firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/philipoe/Firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/philipoe/Firmware/contents/{+path}","compare_url":"https://api.github.com/repos/philipoe/Firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/philipoe/Firmware/merges","archive_url":"https://api.github.com/repos/philipoe/Firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/philipoe/Firmware/downloads","issues_url":"https://api.github.com/repos/philipoe/Firmware/issues{/number}","pulls_url":"https://api.github.com/repos/philipoe/Firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/philipoe/Firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/philipoe/Firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/philipoe/Firmware/labels{/name}","releases_url":"https://api.github.com/repos/philipoe/Firmware/releases{/id}","deployments_url":"https://api.github.com/repos/philipoe/Firmware/deployments","created_at":"2014-10-20T14:29:49Z","updated_at":"2014-11-23T20:23:41Z","pushed_at":"2018-07-09T08:47:16Z","git_url":"git://github.com/philipoe/Firmware.git","ssh_url":"git@github.com:philipoe/Firmware.git","clone_url":"https://github.com/philipoe/Firmware.git","svn_url":"https://github.com/philipoe/Firmware","homepage":"https://pixhawk.ethz.ch/px4/","size":97229,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PX4:master","ref":"master","sha":"33f73184003f889c950313f0eae830a31e2a8e48","user":{"login":"PX4","id":2096014,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwOTYwMTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2096014?v=4","gravatar_id":"","url":"https://api.github.com/users/PX4","html_url":"https://github.com/PX4","followers_url":"https://api.github.com/users/PX4/followers","following_url":"https://api.github.com/users/PX4/following{/other_user}","gists_url":"https://api.github.com/users/PX4/gists{/gist_id}","starred_url":"https://api.github.com/users/PX4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PX4/subscriptions","organizations_url":"https://api.github.com/users/PX4/orgs","repos_url":"https://api.github.com/users/PX4/repos","events_url":"https://api.github.com/users/PX4/events{/privacy}","received_events_url":"https://api.github.com/users/PX4/received_events","type":"Organization","site_admin":false},"repo":{"id":5298790,"node_id":"MDEwOlJlcG9zaXRvcnk1Mjk4Nzkw","name":"Firmware","full_name":"PX4/Firmware","owner":{"login":"PX4","id":2096014,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwOTYwMTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2096014?v=4","gravatar_id":"","url":"https://api.github.com/users/PX4","html_url":"https://github.com/PX4","followers_url":"https://api.github.com/users/PX4/followers","following_url":"https://api.github.com/users/PX4/following{/other_user}","gists_url":"https://api.github.com/users/PX4/gists{/gist_id}","starred_url":"https://api.github.com/users/PX4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PX4/subscriptions","organizations_url":"https://api.github.com/users/PX4/orgs","repos_url":"https://api.github.com/users/PX4/repos","events_url":"https://api.github.com/users/PX4/events{/privacy}","received_events_url":"https://api.github.com/users/PX4/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PX4/Firmware","description":"PX4 Pro Autopilot Software","fork":false,"url":"https://api.github.com/repos/PX4/Firmware","forks_url":"https://api.github.com/repos/PX4/Firmware/forks","keys_url":"https://api.github.com/repos/PX4/Firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PX4/Firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PX4/Firmware/teams","hooks_url":"https://api.github.com/repos/PX4/Firmware/hooks","issue_events_url":"https://api.github.com/repos/PX4/Firmware/issues/events{/number}","events_url":"https://api.github.com/repos/PX4/Firmware/events","assignees_url":"https://api.github.com/repos/PX4/Firmware/assignees{/user}","branches_url":"https://api.github.com/repos/PX4/Firmware/branches{/branch}","tags_url":"https://api.github.com/repos/PX4/Firmware/tags","blobs_url":"https://api.github.com/repos/PX4/Firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PX4/Firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PX4/Firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/PX4/Firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PX4/Firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/PX4/Firmware/languages","stargazers_url":"https://api.github.com/repos/PX4/Firmware/stargazers","contributors_url":"https://api.github.com/repos/PX4/Firmware/contributors","subscribers_url":"https://api.github.com/repos/PX4/Firmware/subscribers","subscription_url":"https://api.github.com/repos/PX4/Firmware/subscription","commits_url":"https://api.github.com/repos/PX4/Firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/PX4/Firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/PX4/Firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/PX4/Firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/PX4/Firmware/contents/{+path}","compare_url":"https://api.github.com/repos/PX4/Firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PX4/Firmware/merges","archive_url":"https://api.github.com/repos/PX4/Firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PX4/Firmware/downloads","issues_url":"https://api.github.com/repos/PX4/Firmware/issues{/number}","pulls_url":"https://api.github.com/repos/PX4/Firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/PX4/Firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/PX4/Firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PX4/Firmware/labels{/name}","releases_url":"https://api.github.com/repos/PX4/Firmware/releases{/id}","deployments_url":"https://api.github.com/repos/PX4/Firmware/deployments","created_at":"2012-08-04T21:19:36Z","updated_at":"2018-07-11T07:39:23Z","pushed_at":"2018-07-11T11:51:00Z","git_url":"git://github.com/PX4/Firmware.git","ssh_url":"git@github.com:PX4/Firmware.git","clone_url":"https://github.com/PX4/Firmware.git","svn_url":"https://github.com/PX4/Firmware","homepage":"http://px4.io","size":100723,"stargazers_count":1814,"watchers_count":1814,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5374,"mirror_url":null,"archived":false,"open_issues_count":518,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":5374,"open_issues":518,"watchers":1814,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PX4/Firmware/pulls/9865"},"html":{"href":"https://github.com/PX4/Firmware/pull/9865"},"issue":{"href":"https://api.github.com/repos/PX4/Firmware/issues/9865"},"comments":{"href":"https://api.github.com/repos/PX4/Firmware/issues/9865/comments"},"review_comments":{"href":"https://api.github.com/repos/PX4/Firmware/pulls/9865/comments"},"review_comment":{"href":"https://api.github.com/repos/PX4/Firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PX4/Firmware/pulls/9865/commits"},"statuses":{"href":"https://api.github.com/repos/PX4/Firmware/statuses/6ab7afabfdafac4fe7ff8762b6185b370442b4d0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"priseborough"}}