-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[7.1-RC1] Autoland-Fix #9794
Conversation
@@ -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) { |
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.
posControl.flags.estAglStatus >= EST_USABLE
might be better here ?
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.
If then posControl.flags.estAglStatus == EST_TRUSTED
we are very close to the ground, should only be active if the rangefinder is accurate.
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.
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) { |
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.
Can this ever be returned from navOnEnteringState_NAV_STATE_RTH_LANDING
?
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.
Yes, occurs at landing waypoints.
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.
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.
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.
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.
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.
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.
Redo of #9754