{"action":"closed","number":2935,"pull_request":{"url":"https://api.github.com/repos/iNavFlight/inav/pulls/2935","id":175703015,"html_url":"https://github.com/iNavFlight/inav/pull/2935","diff_url":"https://github.com/iNavFlight/inav/pull/2935.diff","patch_url":"https://github.com/iNavFlight/inav/pull/2935.patch","issue_url":"https://api.github.com/repos/iNavFlight/inav/issues/2935","number":2935,"state":"closed","locked":false,"title":"Alternative failsafe procedure for minimum altitude","user":{"login":"nmaggioni","id":3594528,"avatar_url":"https://avatars2.githubusercontent.com/u/3594528?v=4","gravatar_id":"","url":"https://api.github.com/users/nmaggioni","html_url":"https://github.com/nmaggioni","followers_url":"https://api.github.com/users/nmaggioni/followers","following_url":"https://api.github.com/users/nmaggioni/following{/other_user}","gists_url":"https://api.github.com/users/nmaggioni/gists{/gist_id}","starred_url":"https://api.github.com/users/nmaggioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmaggioni/subscriptions","organizations_url":"https://api.github.com/users/nmaggioni/orgs","repos_url":"https://api.github.com/users/nmaggioni/repos","events_url":"https://api.github.com/users/nmaggioni/events{/privacy}","received_events_url":"https://api.github.com/users/nmaggioni/received_events","type":"User","site_admin":false},"body":"Having recently seen a [pilot of a fixed wing lose signal right after having landed](https://www.youtube.com/watch?v=GtWOXLt_10U) - presumably not near the home point and/or without the [minimum distance setting](https://github.com/iNavFlight/inav/blob/master/docs/Failsafe.md#failsafe_min_distance) enabled - and having its RTH failsafe engaged even though the craft was on the ground, I thought that an additional failsafe modifier would be useful for such situations; it could avoid smoking motors or blowing ESCs under specific conditions.\r\n\r\nI've copied the `failsafe_min_distance` logic and replicated it and its settings as `failsafe_min_altitude`. The minimum **distance** still has precedence over the minimum altitude, as can be clearly seen in the code. I've also made the altitude threshold signed, in case someone plans to fly lower than their home position.\r\n\r\n---\r\n\r\n**CLARIFICATION NEEDED BEFORE MERGING:** I'd like someone to confirm me that [`getEstimatedActualPosition(Z)`](https://github.com/nmaggioni/inav/blob/failsafe_min_altitude/src/main/flight/failsafe.c#L404) and  [`baro.alt`](https://github.com/nmaggioni/inav/blob/failsafe_min_altitude/src/main/flight/failsafe.c#L406) both return the altitude relative to the home position. I've deducted so from the OSD code, but a confirmation from a more experienced contributor would make this final.\r\n\r\n---\r\n\r\n- [X] New settings added\r\n- [X] Docs updated\r\n- [X] Tests ran\r\n- [X] Compilation ran (_OMNIBUSF4PRO_ target)","created_at":"2018-03-17T14:28:01Z","updated_at":"2018-03-18T16:43:07Z","closed_at":"2018-03-18T16:43:07Z","merged_at":null,"merge_commit_sha":"fcc38c875b4edc2be62369789703e5cbdb270b08","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/iNavFlight/inav/pulls/2935/commits","review_comments_url":"https://api.github.com/repos/iNavFlight/inav/pulls/2935/comments","review_comment_url":"https://api.github.com/repos/iNavFlight/inav/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iNavFlight/inav/issues/2935/comments","statuses_url":"https://api.github.com/repos/iNavFlight/inav/statuses/38083cf08fd82a41e1f55a657c513e40a351d285","head":{"label":"nmaggioni:failsafe_min_altitude","ref":"failsafe_min_altitude","sha":"38083cf08fd82a41e1f55a657c513e40a351d285","user":{"login":"nmaggioni","id":3594528,"avatar_url":"https://avatars2.githubusercontent.com/u/3594528?v=4","gravatar_id":"","url":"https://api.github.com/users/nmaggioni","html_url":"https://github.com/nmaggioni","followers_url":"https://api.github.com/users/nmaggioni/followers","following_url":"https://api.github.com/users/nmaggioni/following{/other_user}","gists_url":"https://api.github.com/users/nmaggioni/gists{/gist_id}","starred_url":"https://api.github.com/users/nmaggioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmaggioni/subscriptions","organizations_url":"https://api.github.com/users/nmaggioni/orgs","repos_url":"https://api.github.com/users/nmaggioni/repos","events_url":"https://api.github.com/users/nmaggioni/events{/privacy}","received_events_url":"https://api.github.com/users/nmaggioni/received_events","type":"User","site_admin":false},"repo":{"id":125627648,"name":"inav","full_name":"nmaggioni/inav","owner":{"login":"nmaggioni","id":3594528,"avatar_url":"https://avatars2.githubusercontent.com/u/3594528?v=4","gravatar_id":"","url":"https://api.github.com/users/nmaggioni","html_url":"https://github.com/nmaggioni","followers_url":"https://api.github.com/users/nmaggioni/followers","following_url":"https://api.github.com/users/nmaggioni/following{/other_user}","gists_url":"https://api.github.com/users/nmaggioni/gists{/gist_id}","starred_url":"https://api.github.com/users/nmaggioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmaggioni/subscriptions","organizations_url":"https://api.github.com/users/nmaggioni/orgs","repos_url":"https://api.github.com/users/nmaggioni/repos","events_url":"https://api.github.com/users/nmaggioni/events{/privacy}","received_events_url":"https://api.github.com/users/nmaggioni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmaggioni/inav","description":"INAV: Navigation-enabled flight control software","fork":true,"url":"https://api.github.com/repos/nmaggioni/inav","forks_url":"https://api.github.com/repos/nmaggioni/inav/forks","keys_url":"https://api.github.com/repos/nmaggioni/inav/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmaggioni/inav/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmaggioni/inav/teams","hooks_url":"https://api.github.com/repos/nmaggioni/inav/hooks","issue_events_url":"https://api.github.com/repos/nmaggioni/inav/issues/events{/number}","events_url":"https://api.github.com/repos/nmaggioni/inav/events","assignees_url":"https://api.github.com/repos/nmaggioni/inav/assignees{/user}","branches_url":"https://api.github.com/repos/nmaggioni/inav/branches{/branch}","tags_url":"https://api.github.com/repos/nmaggioni/inav/tags","blobs_url":"https://api.github.com/repos/nmaggioni/inav/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmaggioni/inav/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmaggioni/inav/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmaggioni/inav/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmaggioni/inav/statuses/{sha}","languages_url":"https://api.github.com/repos/nmaggioni/inav/languages","stargazers_url":"https://api.github.com/repos/nmaggioni/inav/stargazers","contributors_url":"https://api.github.com/repos/nmaggioni/inav/contributors","subscribers_url":"https://api.github.com/repos/nmaggioni/inav/subscribers","subscription_url":"https://api.github.com/repos/nmaggioni/inav/subscription","commits_url":"https://api.github.com/repos/nmaggioni/inav/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmaggioni/inav/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmaggioni/inav/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmaggioni/inav/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmaggioni/inav/contents/{+path}","compare_url":"https://api.github.com/repos/nmaggioni/inav/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmaggioni/inav/merges","archive_url":"https://api.github.com/repos/nmaggioni/inav/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmaggioni/inav/downloads","issues_url":"https://api.github.com/repos/nmaggioni/inav/issues{/number}","pulls_url":"https://api.github.com/repos/nmaggioni/inav/pulls{/number}","milestones_url":"https://api.github.com/repos/nmaggioni/inav/milestones{/number}","notifications_url":"https://api.github.com/repos/nmaggioni/inav/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmaggioni/inav/labels{/name}","releases_url":"https://api.github.com/repos/nmaggioni/inav/releases{/id}","deployments_url":"https://api.github.com/repos/nmaggioni/inav/deployments","created_at":"2018-03-17T12:37:39Z","updated_at":"2018-03-17T12:38:09Z","pushed_at":"2018-03-17T15:55:17Z","git_url":"git://github.com/nmaggioni/inav.git","ssh_url":"git@github.com:nmaggioni/inav.git","clone_url":"https://github.com/nmaggioni/inav.git","svn_url":"https://github.com/nmaggioni/inav","homepage":"https://inavflight.github.io","size":150143,"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":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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"iNavFlight:development","ref":"development","sha":"43648954ebc13e8110298a11e67a520ca88fbe3d","user":{"login":"iNavFlight","id":15979895,"avatar_url":"https://avatars2.githubusercontent.com/u/15979895?v=4","gravatar_id":"","url":"https://api.github.com/users/iNavFlight","html_url":"https://github.com/iNavFlight","followers_url":"https://api.github.com/users/iNavFlight/followers","following_url":"https://api.github.com/users/iNavFlight/following{/other_user}","gists_url":"https://api.github.com/users/iNavFlight/gists{/gist_id}","starred_url":"https://api.github.com/users/iNavFlight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iNavFlight/subscriptions","organizations_url":"https://api.github.com/users/iNavFlight/orgs","repos_url":"https://api.github.com/users/iNavFlight/repos","events_url":"https://api.github.com/users/iNavFlight/events{/privacy}","received_events_url":"https://api.github.com/users/iNavFlight/received_events","type":"Organization","site_admin":false},"repo":{"id":32148604,"name":"inav","full_name":"iNavFlight/inav","owner":{"login":"iNavFlight","id":15979895,"avatar_url":"https://avatars2.githubusercontent.com/u/15979895?v=4","gravatar_id":"","url":"https://api.github.com/users/iNavFlight","html_url":"https://github.com/iNavFlight","followers_url":"https://api.github.com/users/iNavFlight/followers","following_url":"https://api.github.com/users/iNavFlight/following{/other_user}","gists_url":"https://api.github.com/users/iNavFlight/gists{/gist_id}","starred_url":"https://api.github.com/users/iNavFlight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iNavFlight/subscriptions","organizations_url":"https://api.github.com/users/iNavFlight/orgs","repos_url":"https://api.github.com/users/iNavFlight/repos","events_url":"https://api.github.com/users/iNavFlight/events{/privacy}","received_events_url":"https://api.github.com/users/iNavFlight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iNavFlight/inav","description":"INAV: Navigation-enabled flight control software","fork":false,"url":"https://api.github.com/repos/iNavFlight/inav","forks_url":"https://api.github.com/repos/iNavFlight/inav/forks","keys_url":"https://api.github.com/repos/iNavFlight/inav/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iNavFlight/inav/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iNavFlight/inav/teams","hooks_url":"https://api.github.com/repos/iNavFlight/inav/hooks","issue_events_url":"https://api.github.com/repos/iNavFlight/inav/issues/events{/number}","events_url":"https://api.github.com/repos/iNavFlight/inav/events","assignees_url":"https://api.github.com/repos/iNavFlight/inav/assignees{/user}","branches_url":"https://api.github.com/repos/iNavFlight/inav/branches{/branch}","tags_url":"https://api.github.com/repos/iNavFlight/inav/tags","blobs_url":"https://api.github.com/repos/iNavFlight/inav/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iNavFlight/inav/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iNavFlight/inav/git/refs{/sha}","trees_url":"https://api.github.com/repos/iNavFlight/inav/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iNavFlight/inav/statuses/{sha}","languages_url":"https://api.github.com/repos/iNavFlight/inav/languages","stargazers_url":"https://api.github.com/repos/iNavFlight/inav/stargazers","contributors_url":"https://api.github.com/repos/iNavFlight/inav/contributors","subscribers_url":"https://api.github.com/repos/iNavFlight/inav/subscribers","subscription_url":"https://api.github.com/repos/iNavFlight/inav/subscription","commits_url":"https://api.github.com/repos/iNavFlight/inav/commits{/sha}","git_commits_url":"https://api.github.com/repos/iNavFlight/inav/git/commits{/sha}","comments_url":"https://api.github.com/repos/iNavFlight/inav/comments{/number}","issue_comment_url":"https://api.github.com/repos/iNavFlight/inav/issues/comments{/number}","contents_url":"https://api.github.com/repos/iNavFlight/inav/contents/{+path}","compare_url":"https://api.github.com/repos/iNavFlight/inav/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iNavFlight/inav/merges","archive_url":"https://api.github.com/repos/iNavFlight/inav/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iNavFlight/inav/downloads","issues_url":"https://api.github.com/repos/iNavFlight/inav/issues{/number}","pulls_url":"https://api.github.com/repos/iNavFlight/inav/pulls{/number}","milestones_url":"https://api.github.com/repos/iNavFlight/inav/milestones{/number}","notifications_url":"https://api.github.com/repos/iNavFlight/inav/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iNavFlight/inav/labels{/name}","releases_url":"https://api.github.com/repos/iNavFlight/inav/releases{/id}","deployments_url":"https://api.github.com/repos/iNavFlight/inav/deployments","created_at":"2015-03-13T09:58:19Z","updated_at":"2018-03-17T23:57:19Z","pushed_at":"2018-03-18T16:09:02Z","git_url":"git://github.com/iNavFlight/inav.git","ssh_url":"git@github.com:iNavFlight/inav.git","clone_url":"https://github.com/iNavFlight/inav.git","svn_url":"https://github.com/iNavFlight/inav","homepage":"https://inavflight.github.io","size":150140,"stargazers_count":478,"watchers_count":478,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":253,"mirror_url":null,"archived":false,"open_issues_count":343,"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":253,"open_issues":343,"watchers":478,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iNavFlight/inav/pulls/2935"},"html":{"href":"https://github.com/iNavFlight/inav/pull/2935"},"issue":{"href":"https://api.github.com/repos/iNavFlight/inav/issues/2935"},"comments":{"href":"https://api.github.com/repos/iNavFlight/inav/issues/2935/comments"},"review_comments":{"href":"https://api.github.com/repos/iNavFlight/inav/pulls/2935/comments"},"review_comment":{"href":"https://api.github.com/repos/iNavFlight/inav/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iNavFlight/inav/pulls/2935/commits"},"statuses":{"href":"https://api.github.com/repos/iNavFlight/inav/statuses/38083cf08fd82a41e1f55a657c513e40a351d285"}},"author_association":"NONE","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":8,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":33,"deletions":0,"changed_files":5}}
{"actor":{"display_login":"nmaggioni"}}