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

Add Autoland fence action #29280

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hwurzburg
Copy link
Collaborator

And again.....

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Feb 12, 2025
@Hwurzburg Hwurzburg requested review from tridge and IamPete1 February 12, 2025 16:29
@@ -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:
Copy link
Member

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.

Copy link
Member

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.

Copy link
Collaborator Author

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?

@Hwurzburg Hwurzburg force-pushed the autoland_fence_action branch 2 times, most recently from a05fb49 to 06b02b7 Compare February 17, 2025 02:22
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// @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;
Copy link
Member

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.

Copy link
Collaborator Author

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

@Hwurzburg Hwurzburg force-pushed the autoland_fence_action branch from a25f73a to 81f9e9f Compare February 18, 2025 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants