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

[7.1-RC1] Autoland-Fix #9794

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

Scavanger
Copy link
Contributor

Redo of #9754

@DzikuVx DzikuVx added this to the 7.1 milestone Mar 14, 2024
@@ -2400,14 +2422,14 @@ static navigationFSMEvent_t navOnEnteringState_NAV_STATE_FW_LANDING_GLIDE(naviga
return NAV_FSM_EVENT_SWITCH_TO_NAV_STATE_FW_LANDING_ABORT;
}

if (getLandAltitude() <= posControl.fwLandState.landAltAgl + navFwAutolandConfig()->flareAltitude) {
if (getHwRangefinderStatus() == HW_SENSOR_OK && getLandAltitude() <= posControl.fwLandState.landAltAgl + navFwAutolandConfig()->flareAltitude) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

posControl.flags.estAglStatus >= EST_USABLE might be better here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If then posControl.flags.estAglStatus == EST_TRUSTED we are very close to the ground, should only be active if the rangefinder is accurate.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, I realised you're using the direct output from the range finder in getLandAltitude so this makes sense in that case.

} else if (landEvent == NAV_FSM_EVENT_SWITCH_TO_RTH_HOVER_ABOVE_HOME) {
} else
#endif
if (landEvent == NAV_FSM_EVENT_SWITCH_TO_RTH_HOVER_ABOVE_HOME) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this ever be returned from navOnEnteringState_NAV_STATE_RTH_LANDING ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, occurs at landing waypoints.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But it isn't specifically returned from navOnEnteringState_NAV_STATE_RTH_LANDING is my point so landEvent can never have this value surely ?

It can though have a value of NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING which isn't handled by the WP RTH landing state. But that's an existing error so nothing to do with Auto Landing.

Would probably be better to have RTH/WP landing handled as a separate common end phase of either mode ... a future change though to tidy things up.

Copy link
Contributor Author

@Scavanger Scavanger Mar 14, 2024

Choose a reason for hiding this comment

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

Oh, you mean NAV_FSM_EVENT_SWITCH_TO_RTH_HOVER_ABOVE_HOME sorry.
Yes, you're right.
I slipped in the line.
This is from an old version, yes that can go.
Yes, you're right.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, yes I meant NAV_FSM_EVENT_SWITCH_TO_RTH_HOVER_ABOVE_HOME. Swap it for NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING and it'll fix 2 issues at the same time.

@DzikuVx DzikuVx merged commit 3f3b152 into iNavFlight:release_7.1.0 Mar 18, 2024
14 checks passed
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