{"action":"created","comment":{"url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments/38038851","id":38038851,"diff_hunk":"@@ -354,7 +354,35 @@ static void stabilizationTask(void* parameters)\n \n \t\t\t\t\tbreak;\n \n-\t\t\t\tcase STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE:\n+\t\t\tcase STABILIZATIONDESIRED_STABILIZATIONMODE_ACROPLUS:\n+\t\t\t\t\t// this implementation is based on the Openpilot/Librepilot Acro+ flightmode\n+\t\t\t\t\t// and our existing rate & MWRate flightmodes\n+\t\t\t\t\tif(reinit)\n+\t\t\t\t\t\t\tpids[PID_RATE_ROLL + i].iAccumulator = 0;\n+\n+\t\t\t\t\t// The unscaled input (-1,1)\n+\t\t\t\t\tfloat *raw_input = &stabDesired.Roll;\n+\n+\t\t\t\t\t// The factor for gyro suppression / mixing raw stick input into the output; scaled by raw stick input\n+\t\t\t\t\tfloat factor = fabsf(raw_input[i]) * settings.AcroInsanityFactor / 100;\n+\n+\t\t\t\t\t// Store to rate desired variable for storing to UAVO\n+\t\t\t\t\trateDesiredAxis[i] = bound_sym(raw_input[i] * settings.ManualRate[i], settings.ManualRate[i]);\n+\n+\t\t\t\t\t// Zero integral for aggressive maneuvers, like it is done for MWRate\n+\t\t\t\t\tif ((i < 2 && fabsf(gyro_filtered[i]) > 150.0f) ||\n+\t\t\t\t\t\t\t\t\t\t\t(i == 0 && fabsf(raw_input[i]) > 0.2f)) {\n+\t\t\t\t\t\t\tpids[PID_RATE_ROLL + i].iAccumulator = 0;\n+\t\t\t\t\t\t\tpids[PID_RATE_ROLL + i].i = 0;\n+\t\t\t\t\t\t\t}\n+\n+\t\t\t\t\t// Compute the inner loop\n+\t\t\t\t\tactuatorDesiredAxis[i] = pid_apply_setpoint(&pids[PID_RATE_ROLL + i], rateDesiredAxis[i], gyro_filtered[i], dT);\n+\t\t\t\t\tactuatorDesiredAxis[i] = bound_sym(actuatorDesiredAxis[i], 1.0f);","path":"flight/Modules/Stabilization/stabilization.c","position":44,"original_position":44,"commit_id":"bf9b000793566e51bd5312647206845602c402a0","original_commit_id":"bf9b000793566e51bd5312647206845602c402a0","user":{"login":"fujin","id":6873,"avatar_url":"https://avatars.githubusercontent.com/u/6873?v=3","gravatar_id":"","url":"https://api.github.com/users/fujin","html_url":"https://github.com/fujin","followers_url":"https://api.github.com/users/fujin/followers","following_url":"https://api.github.com/users/fujin/following{/other_user}","gists_url":"https://api.github.com/users/fujin/gists{/gist_id}","starred_url":"https://api.github.com/users/fujin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fujin/subscriptions","organizations_url":"https://api.github.com/users/fujin/orgs","repos_url":"https://api.github.com/users/fujin/repos","events_url":"https://api.github.com/users/fujin/events{/privacy}","received_events_url":"https://api.github.com/users/fujin/received_events","type":"User","site_admin":false},"body":"Cool, doing","created_at":"2015-08-26T21:43:50Z","updated_at":"2015-08-26T21:43:50Z","html_url":"https://github.com/TauLabs/TauLabs/pull/1816#discussion_r38038851","pull_request_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816","_links":{"self":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments/38038851"},"html":{"href":"https://github.com/TauLabs/TauLabs/pull/1816#discussion_r38038851"},"pull_request":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816"}}},"pull_request":{"url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816","id":43079848,"html_url":"https://github.com/TauLabs/TauLabs/pull/1816","diff_url":"https://github.com/TauLabs/TauLabs/pull/1816.diff","patch_url":"https://github.com/TauLabs/TauLabs/pull/1816.patch","issue_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/1816","number":1816,"state":"open","locked":false,"title":"Acro+ for Stabilization inner loop","user":{"login":"fujin","id":6873,"avatar_url":"https://avatars.githubusercontent.com/u/6873?v=3","gravatar_id":"","url":"https://api.github.com/users/fujin","html_url":"https://github.com/fujin","followers_url":"https://api.github.com/users/fujin/followers","following_url":"https://api.github.com/users/fujin/following{/other_user}","gists_url":"https://api.github.com/users/fujin/gists{/gist_id}","starred_url":"https://api.github.com/users/fujin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fujin/subscriptions","organizations_url":"https://api.github.com/users/fujin/orgs","repos_url":"https://api.github.com/users/fujin/repos","events_url":"https://api.github.com/users/fujin/events{/privacy}","received_events_url":"https://api.github.com/users/fujin/received_events","type":"User","site_admin":false},"body":"* Allow acro stabilizationdesired with rate pid/expo\n* Correctly scale the stick factor for gyro suppres\n\n@mlyle -- connects to TauLabs/taulabs#1778","created_at":"2015-08-21T20:52:15Z","updated_at":"2015-08-26T21:43:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17e6983b3bb2ca606409df0926d409db7f5720ec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816/commits","review_comments_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816/comments","review_comment_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/1816/comments","statuses_url":"https://api.github.com/repos/TauLabs/TauLabs/statuses/bf9b000793566e51bd5312647206845602c402a0","head":{"label":"fujin:acro-plus","ref":"acro-plus","sha":"bf9b000793566e51bd5312647206845602c402a0","user":{"login":"fujin","id":6873,"avatar_url":"https://avatars.githubusercontent.com/u/6873?v=3","gravatar_id":"","url":"https://api.github.com/users/fujin","html_url":"https://github.com/fujin","followers_url":"https://api.github.com/users/fujin/followers","following_url":"https://api.github.com/users/fujin/following{/other_user}","gists_url":"https://api.github.com/users/fujin/gists{/gist_id}","starred_url":"https://api.github.com/users/fujin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fujin/subscriptions","organizations_url":"https://api.github.com/users/fujin/orgs","repos_url":"https://api.github.com/users/fujin/repos","events_url":"https://api.github.com/users/fujin/events{/privacy}","received_events_url":"https://api.github.com/users/fujin/received_events","type":"User","site_admin":false},"repo":{"id":23608798,"name":"TauLabs","full_name":"fujin/TauLabs","owner":{"login":"fujin","id":6873,"avatar_url":"https://avatars.githubusercontent.com/u/6873?v=3","gravatar_id":"","url":"https://api.github.com/users/fujin","html_url":"https://github.com/fujin","followers_url":"https://api.github.com/users/fujin/followers","following_url":"https://api.github.com/users/fujin/following{/other_user}","gists_url":"https://api.github.com/users/fujin/gists{/gist_id}","starred_url":"https://api.github.com/users/fujin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fujin/subscriptions","organizations_url":"https://api.github.com/users/fujin/orgs","repos_url":"https://api.github.com/users/fujin/repos","events_url":"https://api.github.com/users/fujin/events{/privacy}","received_events_url":"https://api.github.com/users/fujin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fujin/TauLabs","description":"","fork":true,"url":"https://api.github.com/repos/fujin/TauLabs","forks_url":"https://api.github.com/repos/fujin/TauLabs/forks","keys_url":"https://api.github.com/repos/fujin/TauLabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fujin/TauLabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fujin/TauLabs/teams","hooks_url":"https://api.github.com/repos/fujin/TauLabs/hooks","issue_events_url":"https://api.github.com/repos/fujin/TauLabs/issues/events{/number}","events_url":"https://api.github.com/repos/fujin/TauLabs/events","assignees_url":"https://api.github.com/repos/fujin/TauLabs/assignees{/user}","branches_url":"https://api.github.com/repos/fujin/TauLabs/branches{/branch}","tags_url":"https://api.github.com/repos/fujin/TauLabs/tags","blobs_url":"https://api.github.com/repos/fujin/TauLabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fujin/TauLabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fujin/TauLabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/fujin/TauLabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fujin/TauLabs/statuses/{sha}","languages_url":"https://api.github.com/repos/fujin/TauLabs/languages","stargazers_url":"https://api.github.com/repos/fujin/TauLabs/stargazers","contributors_url":"https://api.github.com/repos/fujin/TauLabs/contributors","subscribers_url":"https://api.github.com/repos/fujin/TauLabs/subscribers","subscription_url":"https://api.github.com/repos/fujin/TauLabs/subscription","commits_url":"https://api.github.com/repos/fujin/TauLabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/fujin/TauLabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/fujin/TauLabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/fujin/TauLabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/fujin/TauLabs/contents/{+path}","compare_url":"https://api.github.com/repos/fujin/TauLabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fujin/TauLabs/merges","archive_url":"https://api.github.com/repos/fujin/TauLabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fujin/TauLabs/downloads","issues_url":"https://api.github.com/repos/fujin/TauLabs/issues{/number}","pulls_url":"https://api.github.com/repos/fujin/TauLabs/pulls{/number}","milestones_url":"https://api.github.com/repos/fujin/TauLabs/milestones{/number}","notifications_url":"https://api.github.com/repos/fujin/TauLabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fujin/TauLabs/labels{/name}","releases_url":"https://api.github.com/repos/fujin/TauLabs/releases{/id}","created_at":"2014-09-03T06:15:44Z","updated_at":"2015-01-17T22:32:51Z","pushed_at":"2015-08-25T23:30:16Z","git_url":"git://github.com/fujin/TauLabs.git","ssh_url":"git@github.com:fujin/TauLabs.git","clone_url":"https://github.com/fujin/TauLabs.git","svn_url":"https://github.com/fujin/TauLabs","homepage":"taulabs.org","size":270132,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"next"}},"base":{"label":"TauLabs:next","ref":"next","sha":"b2825bda2e211c0f10a08a4c4ebf926cb93234a8","user":{"login":"TauLabs","id":3201381,"avatar_url":"https://avatars.githubusercontent.com/u/3201381?v=3","gravatar_id":"","url":"https://api.github.com/users/TauLabs","html_url":"https://github.com/TauLabs","followers_url":"https://api.github.com/users/TauLabs/followers","following_url":"https://api.github.com/users/TauLabs/following{/other_user}","gists_url":"https://api.github.com/users/TauLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/TauLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TauLabs/subscriptions","organizations_url":"https://api.github.com/users/TauLabs/orgs","repos_url":"https://api.github.com/users/TauLabs/repos","events_url":"https://api.github.com/users/TauLabs/events{/privacy}","received_events_url":"https://api.github.com/users/TauLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":6589168,"name":"TauLabs","full_name":"TauLabs/TauLabs","owner":{"login":"TauLabs","id":3201381,"avatar_url":"https://avatars.githubusercontent.com/u/3201381?v=3","gravatar_id":"","url":"https://api.github.com/users/TauLabs","html_url":"https://github.com/TauLabs","followers_url":"https://api.github.com/users/TauLabs/followers","following_url":"https://api.github.com/users/TauLabs/following{/other_user}","gists_url":"https://api.github.com/users/TauLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/TauLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TauLabs/subscriptions","organizations_url":"https://api.github.com/users/TauLabs/orgs","repos_url":"https://api.github.com/users/TauLabs/repos","events_url":"https://api.github.com/users/TauLabs/events{/privacy}","received_events_url":"https://api.github.com/users/TauLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TauLabs/TauLabs","description":"","fork":false,"url":"https://api.github.com/repos/TauLabs/TauLabs","forks_url":"https://api.github.com/repos/TauLabs/TauLabs/forks","keys_url":"https://api.github.com/repos/TauLabs/TauLabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TauLabs/TauLabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TauLabs/TauLabs/teams","hooks_url":"https://api.github.com/repos/TauLabs/TauLabs/hooks","issue_events_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/events{/number}","events_url":"https://api.github.com/repos/TauLabs/TauLabs/events","assignees_url":"https://api.github.com/repos/TauLabs/TauLabs/assignees{/user}","branches_url":"https://api.github.com/repos/TauLabs/TauLabs/branches{/branch}","tags_url":"https://api.github.com/repos/TauLabs/TauLabs/tags","blobs_url":"https://api.github.com/repos/TauLabs/TauLabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TauLabs/TauLabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TauLabs/TauLabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/TauLabs/TauLabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TauLabs/TauLabs/statuses/{sha}","languages_url":"https://api.github.com/repos/TauLabs/TauLabs/languages","stargazers_url":"https://api.github.com/repos/TauLabs/TauLabs/stargazers","contributors_url":"https://api.github.com/repos/TauLabs/TauLabs/contributors","subscribers_url":"https://api.github.com/repos/TauLabs/TauLabs/subscribers","subscription_url":"https://api.github.com/repos/TauLabs/TauLabs/subscription","commits_url":"https://api.github.com/repos/TauLabs/TauLabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/TauLabs/TauLabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/TauLabs/TauLabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/TauLabs/TauLabs/contents/{+path}","compare_url":"https://api.github.com/repos/TauLabs/TauLabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TauLabs/TauLabs/merges","archive_url":"https://api.github.com/repos/TauLabs/TauLabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TauLabs/TauLabs/downloads","issues_url":"https://api.github.com/repos/TauLabs/TauLabs/issues{/number}","pulls_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls{/number}","milestones_url":"https://api.github.com/repos/TauLabs/TauLabs/milestones{/number}","notifications_url":"https://api.github.com/repos/TauLabs/TauLabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TauLabs/TauLabs/labels{/name}","releases_url":"https://api.github.com/repos/TauLabs/TauLabs/releases{/id}","created_at":"2012-11-08T01:01:18Z","updated_at":"2015-08-25T19:58:07Z","pushed_at":"2015-08-26T21:40:19Z","git_url":"git://github.com/TauLabs/TauLabs.git","ssh_url":"git@github.com:TauLabs/TauLabs.git","clone_url":"https://github.com/TauLabs/TauLabs.git","svn_url":"https://github.com/TauLabs/TauLabs","homepage":"taulabs.org","size":334866,"stargazers_count":255,"watchers_count":255,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":295,"mirror_url":null,"open_issues_count":239,"forks":295,"open_issues":239,"watchers":255,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816"},"html":{"href":"https://github.com/TauLabs/TauLabs/pull/1816"},"issue":{"href":"https://api.github.com/repos/TauLabs/TauLabs/issues/1816"},"comments":{"href":"https://api.github.com/repos/TauLabs/TauLabs/issues/1816/comments"},"review_comments":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816/comments"},"review_comment":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/1816/commits"},"statuses":{"href":"https://api.github.com/repos/TauLabs/TauLabs/statuses/bf9b000793566e51bd5312647206845602c402a0"}}}}