-
Notifications
You must be signed in to change notification settings - Fork 15k
Fixedwing: Fix circular landing when global origin is not set #26223
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
Conversation
When not specified by navigator, the center of the landing orbit is set to the current position when landing is triggered.
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 136 byte (0.01 %)]px4_fmu-v6x [Total VM Diff: 128 byte (0.01 %)]Updated: 2026-01-07T15:18:37 |
| const bool abort_on_terrain_timeout = checkLandingAbortBitMask(_param_fw_lnd_abort.get(), | ||
| position_controller_landing_status_s::TERRAIN_TIMEOUT); | ||
| const float terrain_alt = getLandingTerrainAltitudeEstimate(now, pos_sp_curr.alt, false, abort_on_terrain_timeout); | ||
| const float land_point_alt = _position_setpoint_current_valid ? pos_sp_curr.alt : 0.f; |
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.
Should we instead of 0 AMSL init the land alt to something surely never reached, even with an baro offset? So e.g. -1000? Or even better, we init with NAN and only do anything (=trigger flaring) with that terrain alt if actually derived from a distance sensor measurement.
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.
Right, I changed it to let the NAN propagate and handle it properly here: https://github.com/PX4/PX4-Autopilot/pull/26223/changes#diff-0e624ccf7b4ffa7466c2bef13a4a129ea57adf4581ce1593102dedd1d8dd4826R2328-R2331 (otherwise the roll was constrained to 0).
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.
A couple of lines below:
if ((_current_altitude < terrain_alt + flare_rel_alt)
Did you double check that _current_altitude < NaN is always false? By the cpp definition I found it should be.
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, it is, I checked in sim.
sfuhrer
left a comment
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.
Neat, thanks!
Solved Problem
Fixedwings can often have a valid local position without a global origin when flying with an airspeed sensor. This lets the user fly in manual position mode, but should also allow autonomous circular landings. The latter is currently not working as no position setpoint is specified by Navigator.
Solution
When not specified by navigator, the center of the landing orbit is set to the current position when landing is triggered.
Changelog Entry
For release notes:
Test coverage
tested in SITL https://logs.px4.io/plot_app?log=21e5d5d0-cd1a-4f4a-b726-fef6727fad43
-->