Skip to content
Snippets Groups Projects
Commit 5464f0dc authored by Michael Day's avatar Michael Day
Browse files

Plane: Fixed bug where NAV_LOITER_TO_ALT was not verifying heading.

NAV_LOITER_TO_ALT now verifying that the plane was heading
towards the next waypoint before breaking out of loiter IF the
first parameter of the mavlink message is not 0.
parent 4ba5be5c
Branches loiter_hdg
No related tags found
No related merge requests found
...@@ -690,6 +690,11 @@ bool Plane::verify_loiter_to_alt() ...@@ -690,6 +690,11 @@ bool Plane::verify_loiter_to_alt()
if (labs(condition_value - current_loc.alt) < 500 && loiter.sum_cd > 1) { if (labs(condition_value - current_loc.alt) < 500 && loiter.sum_cd > 1) {
// primary goal completed, initialize secondary heading goal // primary goal completed, initialize secondary heading goal
condition_value = 0; condition_value = 0;
if (mission.get_current_nav_cmd().content.location.flags.loiter_hdg_chk != 0) {
loiter.sum_cd = 3; //don't immediately stop loitering;
//wait for heading toward next wp or 3 complete loiters,
// whichever comes first.
}
result = verify_loiter_heading(true); result = verify_loiter_heading(true);
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment