{"action":"created","comment":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments/165801416","pull_request_review_id":93803470,"id":165801416,"diff_hunk":"@@ -744,6 +753,15 @@ bool AC_PosControl::is_active_xy() const\n     return ((AP_HAL::millis() - _last_update_xy_ms) <= POSCONTROL_ACTIVE_TIMEOUT_MS);\n }\n \n+/// get_lean_angle_max_cd - returns the maximum pilot commanded angle in degrees\n+float AC_PosControl::get_lean_angle_max_cd() const\n+{\n+    if (is_zero(_lean_angle_max)) {\n+        return _attitude_control.lean_angle_max();\n+    }\n+    return _lean_angle_max*100.0f;","path":"libraries/AC_AttitudeControl/AC_PosControl.cpp","position":209,"original_position":26,"commit_id":"d4d65b0127f93025c9f958c074556bd2ce3bc7cf","original_commit_id":"c5adb23a8c858d9ce35c35e4b78d313ce09778d9","user":{"login":"rmackay9","id":1498098,"avatar_url":"https://avatars2.githubusercontent.com/u/1498098?v=4","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},"body":"OK, zapped that commit I added.","created_at":"2018-02-03T02:20:43Z","updated_at":"2018-02-03T02:20:43Z","html_url":"https://github.com/ArduPilot/ardupilot/pull/7606#discussion_r165801416","pull_request_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments/165801416"},"html":{"href":"https://github.com/ArduPilot/ardupilot/pull/7606#discussion_r165801416"},"pull_request":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606"}},"in_reply_to_id":164934379},"pull_request":{"url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606","id":164828353,"html_url":"https://github.com/ArduPilot/ardupilot/pull/7606","diff_url":"https://github.com/ArduPilot/ardupilot/pull/7606.diff","patch_url":"https://github.com/ArduPilot/ardupilot/pull/7606.patch","issue_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7606","number":7606,"state":"open","locked":false,"title":"Copter: lthall's new loiter","user":{"login":"rmackay9","id":1498098,"avatar_url":"https://avatars2.githubusercontent.com/u/1498098?v=4","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},"body":"This is the bulk of @lthall's \"New Loiter\".  Leonard is the best one to explain what it all does but here is a breakdown of the changes:\r\n\r\nAC_AttitudeController changes:\r\n\r\n- smoothing_gain is provided by a new set_smoothing_gain() functions instead of being passed into each call to input_euler_angle_xxx.  This is an intermediate step, the longer-term plan is to move the RC_FEEL_RP parameter (from which the smoothing gain is calculated) into the attitude controller.\r\n- add accessor for maximum pitch/roll/yaw acceleration\r\n- add angular velocity limits (aka rotational rate maximums), these are held in ATC_ANG_V_R/P/Y_MAX parameters\r\n- add input-shaping-rate-predictor which is used by AC_WPNav's Loiter.  Maybe @lthall can explain what it's for.\r\n- some renaming of members\r\n\r\nAC_PosControl changes: \r\n\r\n- add acceleration feed-forward.  Again @lthall should explain.\r\n- horizontal position control methods (i.e. pos_to_rate_xy, rate_to_accel_xy and accel_to_lean_angles) are each consolidated into single method (called run_xy_controller).  This is a non-functional change that @lthall thinks makes it easier to read.  Same is done for the z-axis position control methods.\r\n- velocity PID gains are doubled.  This gain increase is required or the new controller's error correction response is too weak.  We should consider whether we want to automatically scale all users existing gains instead of just increasing the defaults.  Very few users actually adjust these gains but a safer thing to do would be to automatically change the scaling.\r\n- PSC_ANGLE_MAX parameter added to allow controlling the maximum lean angle in all modes that use the position controller (Loiter, Auto, etc).  It still has a maximum lean angle of 45degrees enforced by the POSCONROL_ACCEL_XY_MAX definition.\r\n- add set_leash_length_xy() to allow the caller (i.e. AC_WPNav) to limit the maximum position error the controller will use.  I believe there will be a problem though if AC_WPNav uses this and then the user sends a do-change-speed command to the vehicle.\r\n\r\nLoiter changes (in AC_WPNav):\r\n\r\n- Loiter gets active braking.  rate of braking can be configured with WPNAV_BRK_JERK, BRK_ACCEL and BRK_DELAY parameters\r\n- Another maximum lean angle limit (WPNAV_LOIT_ANGM).\r\n\r\nVehicle code changes are mostly just to integrate the above changes.\r\n\r\n","created_at":"2018-01-24T11:54:34Z","updated_at":"2018-02-03T02:20:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2c1433a4e7548458ada5b5fb380c5eb4bad02fa","assignee":null,"assignees":[],"requested_reviewers":[{"login":"tridge","id":831867,"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}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606/commits","review_comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606/comments","review_comment_url":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7606/comments","statuses_url":"https://api.github.com/repos/ArduPilot/ardupilot/statuses/d4d65b0127f93025c9f958c074556bd2ce3bc7cf","head":{"label":"rmackay9:lthall-new-loiter10","ref":"lthall-new-loiter10","sha":"d4d65b0127f93025c9f958c074556bd2ce3bc7cf","user":{"login":"rmackay9","id":1498098,"avatar_url":"https://avatars2.githubusercontent.com/u/1498098?v=4","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},"repo":{"id":7716869,"name":"rmackay9-ardupilot","full_name":"rmackay9/rmackay9-ardupilot","owner":{"login":"rmackay9","id":1498098,"avatar_url":"https://avatars2.githubusercontent.com/u/1498098?v=4","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},"private":false,"html_url":"https://github.com/rmackay9/rmackay9-ardupilot","description":"Randy's fork of ArduPilot","fork":true,"url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot","forks_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/forks","keys_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/teams","hooks_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/hooks","issue_events_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/issues/events{/number}","events_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/events","assignees_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/assignees{/user}","branches_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/branches{/branch}","tags_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/tags","blobs_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/statuses/{sha}","languages_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/languages","stargazers_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/stargazers","contributors_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/contributors","subscribers_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/subscribers","subscription_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/subscription","commits_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/contents/{+path}","compare_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/merges","archive_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/downloads","issues_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/issues{/number}","pulls_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/pulls{/number}","milestones_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/milestones{/number}","notifications_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/labels{/name}","releases_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/releases{/id}","deployments_url":"https://api.github.com/repos/rmackay9/rmackay9-ardupilot/deployments","created_at":"2013-01-20T13:54:04Z","updated_at":"2017-10-22T06:09:41Z","pushed_at":"2018-02-02T12:00:45Z","git_url":"git://github.com/rmackay9/rmackay9-ardupilot.git","ssh_url":"git@github.com:rmackay9/rmackay9-ardupilot.git","clone_url":"https://github.com/rmackay9/rmackay9-ardupilot.git","svn_url":"https://github.com/rmackay9/rmackay9-ardupilot","homepage":"","size":98898,"stargazers_count":12,"watchers_count":12,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":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"},"forks":14,"open_issues":0,"watchers":12,"default_branch":"master"}},"base":{"label":"ArduPilot:master","ref":"master","sha":"3165d7264777d9bfebfa4eadef37db3ce70744d4","user":{"login":"ArduPilot","id":17919847,"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,"name":"ardupilot","full_name":"ArduPilot/ardupilot","owner":{"login":"ArduPilot","id":17919847,"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},"private":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":"2018-02-02T16:29:49Z","pushed_at":"2018-02-03T00:36:04Z","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":95037,"stargazers_count":2966,"watchers_count":2966,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5928,"mirror_url":null,"archived":false,"open_issues_count":1037,"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"},"forks":5928,"open_issues":1037,"watchers":2966,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606"},"html":{"href":"https://github.com/ArduPilot/ardupilot/pull/7606"},"issue":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7606"},"comments":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/issues/7606/comments"},"review_comments":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606/comments"},"review_comment":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/pulls/7606/commits"},"statuses":{"href":"https://api.github.com/repos/ArduPilot/ardupilot/statuses/d4d65b0127f93025c9f958c074556bd2ce3bc7cf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rmackay9"}}