{"action":"created","comment":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments/290082131","pull_request_review_id":245178606,"id":290082131,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5MDA4MjEzMQ==","diff_hunk":"@@ -675,23 +675,22 @@ void RangeFinder::Log_RFND()\n         return;\n     }\n \n-    const AP_RangeFinder_Backend *s0 = get_backend(0);\n-    const AP_RangeFinder_Backend *s1 = get_backend(1);\n-    if (s0 == nullptr && s1 == nullptr) {\n-        return;\n-    }\n+    for (uint8_t i=0; i<RANGEFINDER_MAX_INSTANCES; i++) {\n+        const AP_RangeFinder_Backend *s = get_backend(i);\n+        if (s == nullptr) {\n+            continue;\n+        }\n \n-    struct log_RFND pkt = {\n-        LOG_PACKET_HEADER_INIT((uint8_t)(LOG_RFND_MSG)),\n-        time_us       : AP_HAL::micros64(),\n-        dist1         : s0 ? s0->distance_cm() : (uint16_t)0,\n-        status1       : s0 ? (uint8_t)s0->status() : (uint8_t)0,\n-        orient1       : s0 ? s0->orientation() : ROTATION_NONE,\n-        dist2         : s1 ? s1->distance_cm() : (uint16_t)0,\n-        status2       : s1 ? (uint8_t)s1->status() : (uint8_t)0,\n-        orient2       : s1 ? s1->orientation() : ROTATION_NONE,\n-    };\n-    AP::logger().WriteBlock(&pkt, sizeof(pkt));\n+        struct log_RFND pkt = {\n+                LOG_PACKET_HEADER_INIT((uint8_t)(LOG_RFND_MSG)),\n+                time_us      : AP_HAL::micros64(),\n+                instance     : i,\n+                dist         : s ? s->distance_cm() : (uint16_t)0,","path":"libraries/AP_RangeFinder/RangeFinder.cpp","position":30,"original_position":30,"commit_id":"ec240a9e3b6aa2aef6b587c890c9e523c405b233","original_commit_id":"ec240a9e3b6aa2aef6b587c890c9e523c405b233","user":{"login":"tridge","id":831867,"node_id":"MDQ6VXNlcjgzMTg2Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/831867?v=4","gravatar_id":"","url":"https://api.github.com/users/tridge","html_url":"https://github.com/tridge","followers_url":"https://api.github.com/users/tridge/followers","following_url":"https://api.github.com/users/tridge/following{/other_user}","gists_url":"https://api.github.com/users/tridge/gists{/gist_id}","starred_url":"https://api.github.com/users/tridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tridge/subscriptions","organizations_url":"https://api.github.com/users/tridge/orgs","repos_url":"https://api.github.com/users/tridge/repos","events_url":"https://api.github.com/users/tridge/events{/privacy}","received_events_url":"https://api.github.com/users/tridge/received_events","type":"User","site_admin":false},"body":"how can s be null here? it checks it above","created_at":"2019-06-03T23:55:19Z","updated_at":"2019-06-03T23:55:19Z","html_url":"https://github.com/ArduPilot/ardupilot/pull/11446#discussion_r290082131","pull_request_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments/290082131"},"html":{"href":"https://github.com/ArduPilot/ardupilot/pull/11446#discussion_r290082131"},"pull_request":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446"}}},"pull_request":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446","id":283478188,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgzNDc4MTg4","html_url":"https://github.com/ArduPilot/ardupilot/pull/11446","diff_url":"https://github.com/ArduPilot/ardupilot/pull/11446.diff","patch_url":"https://github.com/ArduPilot/ardupilot/pull/11446.patch","issue_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/11446","number":11446,"state":"open","locked":false,"title":"RangeFinder: Add up to 10 RangeFinder logs","user":{"login":"tatsuy","id":16643069,"node_id":"MDQ6VXNlcjE2NjQzMDY5","avatar_url":"https://avatars0.githubusercontent.com/u/16643069?v=4","gravatar_id":"","url":"https://api.github.com/users/tatsuy","html_url":"https://github.com/tatsuy","followers_url":"https://api.github.com/users/tatsuy/followers","following_url":"https://api.github.com/users/tatsuy/following{/other_user}","gists_url":"https://api.github.com/users/tatsuy/gists{/gist_id}","starred_url":"https://api.github.com/users/tatsuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatsuy/subscriptions","organizations_url":"https://api.github.com/users/tatsuy/orgs","repos_url":"https://api.github.com/users/tatsuy/repos","events_url":"https://api.github.com/users/tatsuy/events{/privacy}","received_events_url":"https://api.github.com/users/tatsuy/received_events","type":"User","site_admin":false},"body":"I changed the number of RFND logs from 2 to 10.\r\n\r\n- This will only log the RangeFinder you are using.\r\n- This code make it easy for the one who wants to change the number of logs in the future.","created_at":"2019-05-30T00:45:12Z","updated_at":"2019-06-03T23:55:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"529751e085d5e8f26aa33974fe54749684991390","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":547273148,"node_id":"MDU6TGFiZWw1NDcyNzMxNDg=","url":"https://api.github.com/repos/ArduPilot/ardupilot/labels/DevCallTopic","name":"DevCallTopic","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446/commits","review_comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446/comments","review_comment_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/11446/comments","statuses_url":"https://api.github.com/repos/ArduPilot/ardupilot/statuses/ec240a9e3b6aa2aef6b587c890c9e523c405b233","head":{"label":"tatsuy:pr-rangefinder-log","ref":"pr-rangefinder-log","sha":"ec240a9e3b6aa2aef6b587c890c9e523c405b233","user":{"login":"tatsuy","id":16643069,"node_id":"MDQ6VXNlcjE2NjQzMDY5","avatar_url":"https://avatars0.githubusercontent.com/u/16643069?v=4","gravatar_id":"","url":"https://api.github.com/users/tatsuy","html_url":"https://github.com/tatsuy","followers_url":"https://api.github.com/users/tatsuy/followers","following_url":"https://api.github.com/users/tatsuy/following{/other_user}","gists_url":"https://api.github.com/users/tatsuy/gists{/gist_id}","starred_url":"https://api.github.com/users/tatsuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatsuy/subscriptions","organizations_url":"https://api.github.com/users/tatsuy/orgs","repos_url":"https://api.github.com/users/tatsuy/repos","events_url":"https://api.github.com/users/tatsuy/events{/privacy}","received_events_url":"https://api.github.com/users/tatsuy/received_events","type":"User","site_admin":false},"repo":{"id":131931424,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE5MzE0MjQ=","name":"ardupilot","full_name":"tatsuy/ardupilot","private":false,"owner":{"login":"tatsuy","id":16643069,"node_id":"MDQ6VXNlcjE2NjQzMDY5","avatar_url":"https://avatars0.githubusercontent.com/u/16643069?v=4","gravatar_id":"","url":"https://api.github.com/users/tatsuy","html_url":"https://github.com/tatsuy","followers_url":"https://api.github.com/users/tatsuy/followers","following_url":"https://api.github.com/users/tatsuy/following{/other_user}","gists_url":"https://api.github.com/users/tatsuy/gists{/gist_id}","starred_url":"https://api.github.com/users/tatsuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatsuy/subscriptions","organizations_url":"https://api.github.com/users/tatsuy/orgs","repos_url":"https://api.github.com/users/tatsuy/repos","events_url":"https://api.github.com/users/tatsuy/events{/privacy}","received_events_url":"https://api.github.com/users/tatsuy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tatsuy/ardupilot","description":"ArduPlane, ArduCopter, ArduRover source","fork":true,"url":"https://api.github.com/repos/tatsuy/ardupilot","forks_url":"https://api.github.com/repos/tatsuy/ardupilot/forks","keys_url":"https://api.github.com/repos/tatsuy/ardupilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tatsuy/ardupilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tatsuy/ardupilot/teams","hooks_url":"https://api.github.com/repos/tatsuy/ardupilot/hooks","issue_events_url":"https://api.github.com/repos/tatsuy/ardupilot/issues/events{/number}","events_url":"https://api.github.com/repos/tatsuy/ardupilot/events","assignees_url":"https://api.github.com/repos/tatsuy/ardupilot/assignees{/user}","branches_url":"https://api.github.com/repos/tatsuy/ardupilot/branches{/branch}","tags_url":"https://api.github.com/repos/tatsuy/ardupilot/tags","blobs_url":"https://api.github.com/repos/tatsuy/ardupilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tatsuy/ardupilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tatsuy/ardupilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/tatsuy/ardupilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tatsuy/ardupilot/statuses/{sha}","languages_url":"https://api.github.com/repos/tatsuy/ardupilot/languages","stargazers_url":"https://api.github.com/repos/tatsuy/ardupilot/stargazers","contributors_url":"https://api.github.com/repos/tatsuy/ardupilot/contributors","subscribers_url":"https://api.github.com/repos/tatsuy/ardupilot/subscribers","subscription_url":"https://api.github.com/repos/tatsuy/ardupilot/subscription","commits_url":"https://api.github.com/repos/tatsuy/ardupilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/tatsuy/ardupilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/tatsuy/ardupilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/tatsuy/ardupilot/issues/comments{/number}","contents_url":"https://api.github.com/repos/tatsuy/ardupilot/contents/{+path}","compare_url":"https://api.github.com/repos/tatsuy/ardupilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tatsuy/ardupilot/merges","archive_url":"https://api.github.com/repos/tatsuy/ardupilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tatsuy/ardupilot/downloads","issues_url":"https://api.github.com/repos/tatsuy/ardupilot/issues{/number}","pulls_url":"https://api.github.com/repos/tatsuy/ardupilot/pulls{/number}","milestones_url":"https://api.github.com/repos/tatsuy/ardupilot/milestones{/number}","notifications_url":"https://api.github.com/repos/tatsuy/ardupilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tatsuy/ardupilot/labels{/name}","releases_url":"https://api.github.com/repos/tatsuy/ardupilot/releases{/id}","deployments_url":"https://api.github.com/repos/tatsuy/ardupilot/deployments","created_at":"2018-05-03T02:34:47Z","updated_at":"2018-08-16T02:54:05Z","pushed_at":"2019-06-03T04:54:05Z","git_url":"git://github.com/tatsuy/ardupilot.git","ssh_url":"git@github.com:tatsuy/ardupilot.git","clone_url":"https://github.com/tatsuy/ardupilot.git","svn_url":"https://github.com/tatsuy/ardupilot","homepage":"http://ardupilot.org/","size":136502,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ArduPilot:master","ref":"master","sha":"c67a585b68e7e21a88bb11cf9fa41e2b9473d8ba","user":{"login":"ArduPilot","id":17919847,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3OTE5ODQ3","avatar_url":"https://avatars3.githubusercontent.com/u/17919847?v=4","gravatar_id":"","url":"https://api.github.com/users/ArduPilot","html_url":"https://github.com/ArduPilot","followers_url":"https://api.github.com/users/ArduPilot/followers","following_url":"https://api.github.com/users/ArduPilot/following{/other_user}","gists_url":"https://api.github.com/users/ArduPilot/gists{/gist_id}","starred_url":"https://api.github.com/users/ArduPilot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArduPilot/subscriptions","organizations_url":"https://api.github.com/users/ArduPilot/orgs","repos_url":"https://api.github.com/users/ArduPilot/repos","events_url":"https://api.github.com/users/ArduPilot/events{/privacy}","received_events_url":"https://api.github.com/users/ArduPilot/received_events","type":"Organization","site_admin":false},"repo":{"id":7512484,"node_id":"MDEwOlJlcG9zaXRvcnk3NTEyNDg0","name":"ardupilot","full_name":"ArduPilot/ardupilot","private":false,"owner":{"login":"ArduPilot","id":17919847,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3OTE5ODQ3","avatar_url":"https://avatars3.githubusercontent.com/u/17919847?v=4","gravatar_id":"","url":"https://api.github.com/users/ArduPilot","html_url":"https://github.com/ArduPilot","followers_url":"https://api.github.com/users/ArduPilot/followers","following_url":"https://api.github.com/users/ArduPilot/following{/other_user}","gists_url":"https://api.github.com/users/ArduPilot/gists{/gist_id}","starred_url":"https://api.github.com/users/ArduPilot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArduPilot/subscriptions","organizations_url":"https://api.github.com/users/ArduPilot/orgs","repos_url":"https://api.github.com/users/ArduPilot/repos","events_url":"https://api.github.com/users/ArduPilot/events{/privacy}","received_events_url":"https://api.github.com/users/ArduPilot/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ArduPilot/ardupilot","description":"ArduPlane, ArduCopter, ArduRover source","fork":false,"url":"https://api.github.com/repos/ArduPilot/ardupilot","forks_url":"https://api.github.com/repos/ArduPilot/ardupilot/forks","keys_url":"https://api.github.com/repos/ArduPilot/ardupilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ArduPilot/ardupilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ArduPilot/ardupilot/teams","hooks_url":"https://api.github.com/repos/ArduPilot/ardupilot/hooks","issue_events_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/events{/number}","events_url":"https://api.github.com/repos/ArduPilot/ardupilot/events","assignees_url":"https://api.github.com/repos/ArduPilot/ardupilot/assignees{/user}","branches_url":"https://api.github.com/repos/ArduPilot/ardupilot/branches{/branch}","tags_url":"https://api.github.com/repos/ArduPilot/ardupilot/tags","blobs_url":"https://api.github.com/repos/ArduPilot/ardupilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ArduPilot/ardupilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ArduPilot/ardupilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/ArduPilot/ardupilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ArduPilot/ardupilot/statuses/{sha}","languages_url":"https://api.github.com/repos/ArduPilot/ardupilot/languages","stargazers_url":"https://api.github.com/repos/ArduPilot/ardupilot/stargazers","contributors_url":"https://api.github.com/repos/ArduPilot/ardupilot/contributors","subscribers_url":"https://api.github.com/repos/ArduPilot/ardupilot/subscribers","subscription_url":"https://api.github.com/repos/ArduPilot/ardupilot/subscription","commits_url":"https://api.github.com/repos/ArduPilot/ardupilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/ArduPilot/ardupilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/comments{/number}","contents_url":"https://api.github.com/repos/ArduPilot/ardupilot/contents/{+path}","compare_url":"https://api.github.com/repos/ArduPilot/ardupilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ArduPilot/ardupilot/merges","archive_url":"https://api.github.com/repos/ArduPilot/ardupilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ArduPilot/ardupilot/downloads","issues_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues{/number}","pulls_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls{/number}","milestones_url":"https://api.github.com/repos/ArduPilot/ardupilot/milestones{/number}","notifications_url":"https://api.github.com/repos/ArduPilot/ardupilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ArduPilot/ardupilot/labels{/name}","releases_url":"https://api.github.com/repos/ArduPilot/ardupilot/releases{/id}","deployments_url":"https://api.github.com/repos/ArduPilot/ardupilot/deployments","created_at":"2013-01-09T00:58:52Z","updated_at":"2019-06-03T23:46:52Z","pushed_at":"2019-06-03T23:45:36Z","git_url":"git://github.com/ArduPilot/ardupilot.git","ssh_url":"git@github.com:ArduPilot/ardupilot.git","clone_url":"https://github.com/ArduPilot/ardupilot.git","svn_url":"https://github.com/ArduPilot/ardupilot","homepage":"http://ardupilot.org/","size":137814,"stargazers_count":4032,"watchers_count":4032,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7867,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1504,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":7867,"open_issues":1504,"watchers":4032,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446"},"html":{"href":"https://github.com/ArduPilot/ardupilot/pull/11446"},"issue":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/issues/11446"},"comments":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/issues/11446/comments"},"review_comments":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446/comments"},"review_comment":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/11446/commits"},"statuses":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/statuses/ec240a9e3b6aa2aef6b587c890c9e523c405b233"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tridge"}}