Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Nav code improvements #9947

Merged
merged 2 commits into from
Apr 21, 2024

Conversation

breadoven
Copy link
Collaborator

PR makes following changes:

  1. Improves WP reached detection for fixed wing to remove dependency on nav_fw_loiter_radius. Detection now relies on checking bearing to WP relative to initial bearing to WP which is more reliable than checking distance based on a loiter radius that may not actually be achieved if set incorrectly.
  2. Adds new Nav state flag NAV_CTL_HOLD to define when Nav hold states are active or will become active when WP is reached. Cleans up check for Nav Hold being active.
  3. Replaces "Hover" with "Loiter" where relevant which seems more appropriate given planes generally can't hover.
  4. Moves Landing Detected arm blocker reset code to fc_core.c updateArmingStatus which is the more correct location than in the landing detection code itself.

Tested OK for fixed wing on HITL.

@Jetrell
Copy link

Jetrell commented Apr 16, 2024

It works great.. Thanks.
I ran it through some back to back tests against the current method.. And even set nav_fw_loiter_radius to a low 5m. Which it couldn't possibly do. But it still made the safehome location each time based on the bearing, and instantly start descending to the nav_rth_home_altitude or Landing Approach altitude and loitered around.

@breadoven
Copy link
Collaborator Author

Yes, using using relative bearing is a much better method than distance for planes that loiter around and never actually reach the waypoint itself. Need to check this with multirotor though just to be sure odd things don't happen, might be possible in the next few days.

@breadoven breadoven added this to the 7.1.1 milestone Apr 16, 2024
@breadoven
Copy link
Collaborator Author

breadoven commented Apr 21, 2024

Managed to flight test multirotor with these changes and everything worked as expected for WP and RTH modes so this should be good to merge.

@DzikuVx DzikuVx merged commit 66e4526 into iNavFlight:release_7.1.1 Apr 21, 2024
14 checks passed
@breadoven breadoven deleted the abo_nav_improvements branch April 21, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants