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

Navigator: Add takeoff complete check when using local pos est #14226

Closed

Conversation

mortenfyhn
Copy link
Contributor

Related to (possibly needed by) #14193.

The current check only works with global position estimates, so if using
local estimation, takeoff mode never finishes.
}
const auto global_altitude_acceptable =
_navigator->get_global_position()->alt > altitude_amsl - altitude_acceptance_radius;
const auto local_altitude_acceptable =
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that this is safe in general. As a first step what about only checking local acceptable if _mission_item.altitude_is_relative?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're probably right. This implementation is very crude and not properly tested, just kind of a "what I had to do to be able to fly". I'll check out the altitude is relative thing.

Copy link
Contributor Author

@mortenfyhn mortenfyhn Feb 25, 2020

Choose a reason for hiding this comment

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

When I'm flying SITL, pushing pose data in via the "external vision" input and setting EKF2_AID_MASK to 24 (vision only, no gps), so that my local estimate is valid but global invalid (checked with ekf2 status), it seems that _mission_item.altitude_is_relative is false. So I don't think I can use that to decide which check to use.

Copy link
Member

@MaEtUgR MaEtUgR Feb 25, 2020

Choose a reason for hiding this comment

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

I wanted to bring up the same concern, the things that come to my mind to make sure would be:

  • a local origin that doesn't have z component 0 where the drone is currently standing (we should make that a default in SITL to catch these bugs early on)
  • having GPS and loosing it again in which case something in the setup e.g. ground station might still be sending absolute altitude
    With the altitude_is_relative it might work the right way.

@mortenfyhn
Copy link
Contributor Author

Would you all like me to make further effort on this, or will you take over? I'm not sure if I should consider myself the assignee of this or not.

@mortenfyhn mortenfyhn requested review from MaEtUgR and dagar April 28, 2020 11:37
@mortenfyhn
Copy link
Contributor Author

mortenfyhn commented Apr 28, 2020

I re-requested reviews so we can decide how to proceed.

@stale stale bot added the stale label Jul 27, 2020
@MaEtUgR MaEtUgR requested a review from RomanBapst September 24, 2020 11:05
@PX4 PX4 deleted a comment from stale bot Sep 24, 2020
@stale stale bot removed the stale label Sep 24, 2020
_waypoint_position_reached = true;
}
const auto global_altitude_acceptable =
_navigator->get_global_position()->alt > altitude_amsl - altitude_acceptance_radius;
Copy link
Member

Choose a reason for hiding this comment

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

Check validity before using global?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely. I'll rebase and revisit this PR soon.

@mortenfyhn
Copy link
Contributor Author

I'll close this, since it's gotten so old. I reckon this probably has changed upstream since I opened this.

@mortenfyhn mortenfyhn closed this Mar 27, 2023
@MaEtUgR
Copy link
Member

MaEtUgR commented Mar 27, 2023

Thanks! This part of the code is still very similar but the original issue #14193 was solved already. In case there's something else this fixes then we could take it up again.

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

Successfully merging this pull request may close these issues.

3 participants