File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,17 @@ void Plane::fence_check()
52
52
// No returning to a previous mode, unless our action allows it
53
53
break ;
54
54
}
55
+
56
+ /*
57
+ clear mode reasons if they are FENCE_BREACHED to allow AUX
58
+ switch fence disable/enable to re-enable the fence after a breach
59
+ */
60
+ if (plane.previous_mode_reason == ModeReason::FENCE_BREACHED) {
61
+ plane.previous_mode_reason = ModeReason::FENCE_REENABLE;
62
+ }
63
+ if (plane.control_mode_reason == ModeReason::FENCE_BREACHED) {
64
+ plane.control_mode_reason = ModeReason::FENCE_REENABLE;
65
+ }
55
66
return ;
56
67
}
57
68
@@ -169,6 +180,11 @@ bool Plane::fence_stickmixing(void) const
169
180
170
181
bool Plane::in_fence_recovery () const
171
182
{
183
+ if (control_mode == &mode_auto && !mission.get_in_landing_sequence_flag ()) {
184
+ // the user may have changed target WP to be outside the
185
+ // landing sequence
186
+ return false ;
187
+ }
172
188
const bool current_mode_breach = plane.control_mode_reason == ModeReason::FENCE_BREACHED;
173
189
const bool previous_mode_breach = plane.previous_mode_reason == ModeReason::FENCE_BREACHED;
174
190
const bool previous_mode_complete = (plane.control_mode_reason == ModeReason::RTL_COMPLETE_SWITCHING_TO_VTOL_LAND_RTL) ||
You can’t perform that action at this time.
0 commit comments