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

Plane: is_landing to use mission_landing_seq #24141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

magicrub
Copy link
Contributor

Plane's AP_Vehicle()->is_landing() to also check if the mission thinks it's landing soon.

This is a follow-up from PR #24021

@IamPete1
Copy link
Member

I don't think the landing sequence flag is close enough to a landing to count. A landing sequence does not even have to end in a landing.

@@ -162,5 +162,5 @@ bool ModeAuto::_pre_arm_checks(size_t buflen, char *buffer) const

bool ModeAuto::is_landing() const
{
return (plane.flight_stage == AP_FixedWing::FlightStage::LAND);
return (plane.flight_stage == AP_FixedWing::FlightStage::LAND) || (plane.mission.get_in_landing_sequence_flag());
Copy link
Contributor

Choose a reason for hiding this comment

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

a in landing sequence binding makes more sense I think

Copy link
Contributor

Choose a reason for hiding this comment

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

a in landing sequence binding makes more sense I think

Yes that makes more sense. I was struggling with a binding for is_landingIO where the inverse may not be !in_landing(). i.e if you wrote "not is_landing()" in your script or had an "if is_landing() .. else ..." you might not get what you expect. This is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants