{"action":"created","comment":{"url":"https://api.github.com/repos/diydrones/ardupilot/pulls/comments/48989669","id":48989669,"diff_hunk":"@@ -249,6 +249,21 @@\n #define HAL_BARO_MS5611_I2C_BUS 1\n #define HAL_BARO_MS5611_I2C_ADDR 0x77\n #define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843_MPU6000\n+#define HAL_OPTFLOW_ONBOARD_VDEV_PATH \"/dev/video0\"\n+#define HAL_OPTFLOW_ONBOARD_SENSOR_WIDTH 320\n+#define HAL_OPTFLOW_ONBOARD_SENSOR_HEIGHT 240\n+#define HAL_OPTFLOW_ONBOARD_OUTPUT_WIDTH 64\n+#define HAL_OPTFLOW_ONBOARD_OUTPUT_HEIGHT 64\n+#define HAL_OPTFLOW_ONBOARD_CROP_WIDTH 240\n+#define HAL_OPTFLOW_ONBOARD_CROP_HEIGHT 240\n+#define HAL_OPTFLOW_ONBOARD_NBUFS 8;\n+#define HAL_FLOW_PX4_MAX_FLOW_PIXEL 4\n+#define HAL_FLOW_PX4_BOTTOM_FLOW_FEATURE_THRESHOLD 30\n+#define HAL_FLOW_PX4_BOTTOM_FLOW_VALUE_THRESHOLD 5000\n+#define HAL_PARAM_DEFAULTS_PATH \"/etc/arducopter/minlure.parm\"\n+/* focal length 3.6 um, 2x binning in each direction\n+ * 240x240 crop rescaled to 64x64 */\n+#define HAL_FLOW_PX4_FOCAL_LENGTH_MILLIPX (2.5 / (3.6 * 2.0 * 240 / 64))","path":"libraries/AP_HAL/AP_HAL_Boards.h","position":18,"original_position":18,"commit_id":"a73d2a841a38a678bb21e9068ec9c36723d66e98","original_commit_id":"a73d2a841a38a678bb21e9068ec9c36723d66e98","user":{"login":"jberaud","id":11756510,"avatar_url":"https://avatars.githubusercontent.com/u/11756510?v=3","gravatar_id":"","url":"https://api.github.com/users/jberaud","html_url":"https://github.com/jberaud","followers_url":"https://api.github.com/users/jberaud/followers","following_url":"https://api.github.com/users/jberaud/following{/other_user}","gists_url":"https://api.github.com/users/jberaud/gists{/gist_id}","starred_url":"https://api.github.com/users/jberaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jberaud/subscriptions","organizations_url":"https://api.github.com/users/jberaud/orgs","repos_url":"https://api.github.com/users/jberaud/repos","events_url":"https://api.github.com/users/jberaud/events{/privacy}","received_events_url":"https://api.github.com/users/jberaud/received_events","type":"User","site_admin":false},"body":"Something else. If I am correct, you are using cropping without scaling, and with this pixel size, you will probably have a very small dynamic compared to what I have with a scaled image.","created_at":"2016-01-06T18:21:22Z","updated_at":"2016-01-06T18:21:22Z","html_url":"https://github.com/diydrones/ardupilot/pull/3430#discussion_r48989669","pull_request_url":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430","_links":{"self":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/comments/48989669"},"html":{"href":"https://github.com/diydrones/ardupilot/pull/3430#discussion_r48989669"},"pull_request":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430"}}},"pull_request":{"url":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430","id":55119860,"html_url":"https://github.com/diydrones/ardupilot/pull/3430","diff_url":"https://github.com/diydrones/ardupilot/pull/3430.diff","patch_url":"https://github.com/diydrones/ardupilot/pull/3430.patch","issue_url":"https://api.github.com/repos/diydrones/ardupilot/issues/3430","number":3430,"state":"open","locked":false,"title":"OpticalFlow: Add support for MinnowBoardMax","user":{"login":"ricardotk","id":3178975,"avatar_url":"https://avatars.githubusercontent.com/u/3178975?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardotk","html_url":"https://github.com/ricardotk","followers_url":"https://api.github.com/users/ricardotk/followers","following_url":"https://api.github.com/users/ricardotk/following{/other_user}","gists_url":"https://api.github.com/users/ricardotk/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardotk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardotk/subscriptions","organizations_url":"https://api.github.com/users/ricardotk/orgs","repos_url":"https://api.github.com/users/ricardotk/repos","events_url":"https://api.github.com/users/ricardotk/events{/privacy}","received_events_url":"https://api.github.com/users/ricardotk/received_events","type":"User","site_admin":false},"body":"This PR adds support for OpticalFlow to MinnowBoardMax trying to\r\nleave the OpticalFlow implementation as generic as it already is.\r\n\r\nWe had to add some format conversion and software crop to the cameras that\r\ndo not have this features.\r\n\r\nMost cameras do not support NV12 or GREY formats, we are adding in this PR\r\na conversion from YUYV format, that seems pretty common in cameras, to GREY\r\nformat (since we do not use Cb and Cr data on OpticalFlow).\r\n\r\nAlso we are adding a software crop for images in GREY format. For the same\r\nreason, most cameras do not have support for overlaying (crop, resize and so on).\r\n\r\nThis PR is still a WIP version since it still need to be tested on a flying drone, but the tests I had made with a camera seemed to be correct.","created_at":"2016-01-05T17:39:05Z","updated_at":"2016-01-06T18:21:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7eaaa8144e7759a607847a0bd34b1d30c3929ae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430/commits","review_comments_url":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430/comments","review_comment_url":"https://api.github.com/repos/diydrones/ardupilot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diydrones/ardupilot/issues/3430/comments","statuses_url":"https://api.github.com/repos/diydrones/ardupilot/statuses/a73d2a841a38a678bb21e9068ec9c36723d66e98","head":{"label":"ricardotk:minlure-opticalflow","ref":"minlure-opticalflow","sha":"a73d2a841a38a678bb21e9068ec9c36723d66e98","user":{"login":"ricardotk","id":3178975,"avatar_url":"https://avatars.githubusercontent.com/u/3178975?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardotk","html_url":"https://github.com/ricardotk","followers_url":"https://api.github.com/users/ricardotk/followers","following_url":"https://api.github.com/users/ricardotk/following{/other_user}","gists_url":"https://api.github.com/users/ricardotk/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardotk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardotk/subscriptions","organizations_url":"https://api.github.com/users/ricardotk/orgs","repos_url":"https://api.github.com/users/ricardotk/repos","events_url":"https://api.github.com/users/ricardotk/events{/privacy}","received_events_url":"https://api.github.com/users/ricardotk/received_events","type":"User","site_admin":false},"repo":{"id":48503449,"name":"ardupilot","full_name":"ricardotk/ardupilot","owner":{"login":"ricardotk","id":3178975,"avatar_url":"https://avatars.githubusercontent.com/u/3178975?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardotk","html_url":"https://github.com/ricardotk","followers_url":"https://api.github.com/users/ricardotk/followers","following_url":"https://api.github.com/users/ricardotk/following{/other_user}","gists_url":"https://api.github.com/users/ricardotk/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardotk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardotk/subscriptions","organizations_url":"https://api.github.com/users/ricardotk/orgs","repos_url":"https://api.github.com/users/ricardotk/repos","events_url":"https://api.github.com/users/ricardotk/events{/privacy}","received_events_url":"https://api.github.com/users/ricardotk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ricardotk/ardupilot","description":"APM Plane, APM Copter, APM Rover source","fork":true,"url":"https://api.github.com/repos/ricardotk/ardupilot","forks_url":"https://api.github.com/repos/ricardotk/ardupilot/forks","keys_url":"https://api.github.com/repos/ricardotk/ardupilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ricardotk/ardupilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ricardotk/ardupilot/teams","hooks_url":"https://api.github.com/repos/ricardotk/ardupilot/hooks","issue_events_url":"https://api.github.com/repos/ricardotk/ardupilot/issues/events{/number}","events_url":"https://api.github.com/repos/ricardotk/ardupilot/events","assignees_url":"https://api.github.com/repos/ricardotk/ardupilot/assignees{/user}","branches_url":"https://api.github.com/repos/ricardotk/ardupilot/branches{/branch}","tags_url":"https://api.github.com/repos/ricardotk/ardupilot/tags","blobs_url":"https://api.github.com/repos/ricardotk/ardupilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ricardotk/ardupilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ricardotk/ardupilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/ricardotk/ardupilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ricardotk/ardupilot/statuses/{sha}","languages_url":"https://api.github.com/repos/ricardotk/ardupilot/languages","stargazers_url":"https://api.github.com/repos/ricardotk/ardupilot/stargazers","contributors_url":"https://api.github.com/repos/ricardotk/ardupilot/contributors","subscribers_url":"https://api.github.com/repos/ricardotk/ardupilot/subscribers","subscription_url":"https://api.github.com/repos/ricardotk/ardupilot/subscription","commits_url":"https://api.github.com/repos/ricardotk/ardupilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/ricardotk/ardupilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/ricardotk/ardupilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/ricardotk/ardupilot/issues/comments{/number}","contents_url":"https://api.github.com/repos/ricardotk/ardupilot/contents/{+path}","compare_url":"https://api.github.com/repos/ricardotk/ardupilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ricardotk/ardupilot/merges","archive_url":"https://api.github.com/repos/ricardotk/ardupilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ricardotk/ardupilot/downloads","issues_url":"https://api.github.com/repos/ricardotk/ardupilot/issues{/number}","pulls_url":"https://api.github.com/repos/ricardotk/ardupilot/pulls{/number}","milestones_url":"https://api.github.com/repos/ricardotk/ardupilot/milestones{/number}","notifications_url":"https://api.github.com/repos/ricardotk/ardupilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ricardotk/ardupilot/labels{/name}","releases_url":"https://api.github.com/repos/ricardotk/ardupilot/releases{/id}","created_at":"2015-12-23T17:44:42Z","updated_at":"2015-12-23T17:44:57Z","pushed_at":"2016-01-05T17:32:18Z","git_url":"git://github.com/ricardotk/ardupilot.git","ssh_url":"git@github.com:ricardotk/ardupilot.git","clone_url":"https://github.com/ricardotk/ardupilot.git","svn_url":"https://github.com/ricardotk/ardupilot","homepage":"http://ardupilot.com/","size":76167,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"diydrones:master","ref":"master","sha":"ca9af3ee420a6e9865ae204aed8535fc3835ccb3","user":{"login":"diydrones","id":3189387,"avatar_url":"https://avatars.githubusercontent.com/u/3189387?v=3","gravatar_id":"","url":"https://api.github.com/users/diydrones","html_url":"https://github.com/diydrones","followers_url":"https://api.github.com/users/diydrones/followers","following_url":"https://api.github.com/users/diydrones/following{/other_user}","gists_url":"https://api.github.com/users/diydrones/gists{/gist_id}","starred_url":"https://api.github.com/users/diydrones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diydrones/subscriptions","organizations_url":"https://api.github.com/users/diydrones/orgs","repos_url":"https://api.github.com/users/diydrones/repos","events_url":"https://api.github.com/users/diydrones/events{/privacy}","received_events_url":"https://api.github.com/users/diydrones/received_events","type":"Organization","site_admin":false},"repo":{"id":7512484,"name":"ardupilot","full_name":"diydrones/ardupilot","owner":{"login":"diydrones","id":3189387,"avatar_url":"https://avatars.githubusercontent.com/u/3189387?v=3","gravatar_id":"","url":"https://api.github.com/users/diydrones","html_url":"https://github.com/diydrones","followers_url":"https://api.github.com/users/diydrones/followers","following_url":"https://api.github.com/users/diydrones/following{/other_user}","gists_url":"https://api.github.com/users/diydrones/gists{/gist_id}","starred_url":"https://api.github.com/users/diydrones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diydrones/subscriptions","organizations_url":"https://api.github.com/users/diydrones/orgs","repos_url":"https://api.github.com/users/diydrones/repos","events_url":"https://api.github.com/users/diydrones/events{/privacy}","received_events_url":"https://api.github.com/users/diydrones/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diydrones/ardupilot","description":"APM Plane, APM Copter, APM Rover source","fork":false,"url":"https://api.github.com/repos/diydrones/ardupilot","forks_url":"https://api.github.com/repos/diydrones/ardupilot/forks","keys_url":"https://api.github.com/repos/diydrones/ardupilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diydrones/ardupilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diydrones/ardupilot/teams","hooks_url":"https://api.github.com/repos/diydrones/ardupilot/hooks","issue_events_url":"https://api.github.com/repos/diydrones/ardupilot/issues/events{/number}","events_url":"https://api.github.com/repos/diydrones/ardupilot/events","assignees_url":"https://api.github.com/repos/diydrones/ardupilot/assignees{/user}","branches_url":"https://api.github.com/repos/diydrones/ardupilot/branches{/branch}","tags_url":"https://api.github.com/repos/diydrones/ardupilot/tags","blobs_url":"https://api.github.com/repos/diydrones/ardupilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diydrones/ardupilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diydrones/ardupilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/diydrones/ardupilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diydrones/ardupilot/statuses/{sha}","languages_url":"https://api.github.com/repos/diydrones/ardupilot/languages","stargazers_url":"https://api.github.com/repos/diydrones/ardupilot/stargazers","contributors_url":"https://api.github.com/repos/diydrones/ardupilot/contributors","subscribers_url":"https://api.github.com/repos/diydrones/ardupilot/subscribers","subscription_url":"https://api.github.com/repos/diydrones/ardupilot/subscription","commits_url":"https://api.github.com/repos/diydrones/ardupilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/diydrones/ardupilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/diydrones/ardupilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/diydrones/ardupilot/issues/comments{/number}","contents_url":"https://api.github.com/repos/diydrones/ardupilot/contents/{+path}","compare_url":"https://api.github.com/repos/diydrones/ardupilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diydrones/ardupilot/merges","archive_url":"https://api.github.com/repos/diydrones/ardupilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diydrones/ardupilot/downloads","issues_url":"https://api.github.com/repos/diydrones/ardupilot/issues{/number}","pulls_url":"https://api.github.com/repos/diydrones/ardupilot/pulls{/number}","milestones_url":"https://api.github.com/repos/diydrones/ardupilot/milestones{/number}","notifications_url":"https://api.github.com/repos/diydrones/ardupilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diydrones/ardupilot/labels{/name}","releases_url":"https://api.github.com/repos/diydrones/ardupilot/releases{/id}","created_at":"2013-01-09T00:58:52Z","updated_at":"2016-01-06T18:14:31Z","pushed_at":"2016-01-06T15:46:42Z","git_url":"git://github.com/diydrones/ardupilot.git","ssh_url":"git@github.com:diydrones/ardupilot.git","clone_url":"https://github.com/diydrones/ardupilot.git","svn_url":"https://github.com/diydrones/ardupilot","homepage":"http://ardupilot.com/","size":107915,"stargazers_count":1616,"watchers_count":1616,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3272,"mirror_url":null,"open_issues_count":628,"forks":3272,"open_issues":628,"watchers":1616,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430"},"html":{"href":"https://github.com/diydrones/ardupilot/pull/3430"},"issue":{"href":"https://api.github.com/repos/diydrones/ardupilot/issues/3430"},"comments":{"href":"https://api.github.com/repos/diydrones/ardupilot/issues/3430/comments"},"review_comments":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430/comments"},"review_comment":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/3430/commits"},"statuses":{"href":"https://api.github.com/repos/diydrones/ardupilot/statuses/a73d2a841a38a678bb21e9068ec9c36723d66e98"}}}}