-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Add Autoland fence action #29280
base: master
Are you sure you want to change the base?
Add Autoland fence action #29280
Conversation
06bef54
to
77bbc60
Compare
ArduPlane/fence.cpp
Outdated
@@ -80,6 +81,13 @@ void Plane::fence_check() | |||
switch (fence_act) { | |||
case AC_FENCE_ACTION_REPORT_ONLY: | |||
break; | |||
#if MODE_AUTOLAND_ENABLED | |||
case AC_FENCE_ACTION_AUTOLAND_OR_RTL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need the same check as on line 95. Probably easier to fall through to that case and then add the if on 94.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to protect against RLT vs AUTOLAND. It should not switch out of one to go into the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this what you mean?
a05fb49
to
06b02b7
Compare
@@ -66,7 +66,7 @@ const AP_Param::GroupInfo AC_Fence::var_info[] = { | |||
// @Description: What action should be taken when fence is breached | |||
// @Values{Copter}: 0:Report Only,1:RTL or Land,2:Always Land,3:SmartRTL or RTL or Land,4:Brake or Land,5:SmartRTL or Land | |||
// @Values{Rover}: 0:Report Only,1:RTL or Hold,2:Hold,3:SmartRTL or RTL or Hold,4:SmartRTL or Hold | |||
// @Values{Plane}: 0:Report Only,1:RTL,6:Guided,7:GuidedThrottlePass | |||
// @Values{Plane}: 0:Report Only,1:RTL,6:Guided,7:GuidedThrottlePass,8:AUTOLAND if possible or RTL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @Values{Plane}: 0:Report Only,1:RTL,6:Guided,7:GuidedThrottlePass,8:AUTOLAND if possible or RTL | |
// @Values{Plane}: 0:Report Only,1:RTL,6:Guided,7:GuidedThrottlePass,8:AUTOLAND if possible else RTL |
Maybe that is a little clearer that RTL is the backup plan.
#if MODE_AUTOLAND_ENABLED | ||
|| fence_act == AC_FENCE_ACTION_AUTOLAND_OR_RTL | ||
#endif | ||
) { | ||
if (control_mode == &mode_auto && | ||
mission.get_in_landing_sequence_flag() && | ||
(g.rtl_autoland == RtlAutoland::RTL_THEN_DO_LAND_START || | ||
g.rtl_autoland == RtlAutoland::RTL_IMMEDIATE_DO_LAND_START)) { | ||
// already landing | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this early return needs a check for being in either RTL or Autoland.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a check to not change modes on a breach when AUTOLANDING in is LAND stage
06b02b7
to
a25f73a
Compare
a25f73a
to
81f9e9f
Compare
And again.....