PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.26k stars 13.41k forks source link

Improved Fixed Wing Loss of GPS (global position) failsafe behavior when landing #10906

Open Antiheavy opened 5 years ago

Antiheavy commented 5 years ago

The Fixed Wing loss of GPS failsafe triggers the "open loop loiter" which is great when at mission altitude.

However, in the special case of GPS loss when on a landing approach we do not want the aircraft going into a bank. In this case, the preferred behavior is to continue straight ahead on a dumb landing path (cut throttle, control airspeed/pitch. hold current body yaw angle). Regain of GPS should pick-up where it left off on the mission landing and get back onto the guided landing approach.

The simpliest way to improve this would be to override NAV_GPSF_R and force it to 0 degrees bank angle if entering GPS Failure Navigation from a Landing approach.

almaaro commented 5 years ago

One solution would be: In navigator_main.cpp in case vehicle_status_s::NAVIGATION_STATE_AUTO_LANDENGFAIL: there would be a check to see if the current waypoint type is LAND to avoid entering the open loop loiter. Also, in FixedwingPositionControl.cpp there would be a check to see if the GPS is in failsafe to enable specific landing control.

Also, some other thoughts arise regarding the whole GPS failsafe.

I noticed that there was this comment in commander/state_machine_helper.cpp: // TODO: FW position controller doesn't run without condition_global_position_valid. So it is kind of against the idea of moving the open loop loiter to the fw position controller.

IMO all in all, it seems quite interwined to have dynamic control over anything while the GPS failsafe is active.

JohnSnowball commented 5 years ago

I got a question, when you suffer gps loss during mission, will your fixed wing goes to open-loop loiter every time? or just go landing slope?

Antiheavy commented 5 years ago

I got a question, when you suffer gps loss during mission, will your fixed wing goes to open-loop loiter every time? or just go landing slope?

@JohnSnowball I am noticing that the documentation on this isn't very good: https://docs.px4.io/en/config/safety.html https://docs.px4.io/en/advanced_config/parameter_reference.html#gps-failure-navigation Multiple terms are used "loss of position", "loss of global position", and "loss of GPS". They all have slightly different meanings are are not used consistently. ( @hamishwillee maybe something for a separate discussion)

Here is more information specific to fixed wing: When you lose GPS (i'm talking losing satellite based position lock here) the system doesn't do anything at first. The EKF2 continues to estimate its global position using the other sensors and dead reckoning. The EKF2 can do a pretty good job for several seconds or even up to several minutes on a fixed wing that uses an airspeed sensor and has both EKF2_ARSP_THR and EKF2_FUSE_BETA enabled. Once the EKF2's reported estimates for position and velocity errors exceed the position failsafe thresholds in Commander (i.e. COM_POS_FS_xx...) then the "GPS Failure Navigation" kicks in.

GPS Failure Navigation is NOT a landing glide slope. It just sets the aircraft to fixed pitch, bank, and throttle settings. The default parameters for NAV_GPSF_xx result in an open loop loiter down to the ground on most fixed wing aircraft. If the reported estimates for position and velocity errors come back within the limits then the vehicle resumes whatever mode it was in before (e.g. back into Mission mode and climbs and turns back to the waypoint it was tracking).

The feature request in this issue is to override NAV_GPSF_R and set to 0 if entering GPS Failure Navigation from a "Land Mode" (for fixed wings).

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Antiheavy commented 5 years ago

@kjkinney let’s look at this

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Antiheavy commented 5 years ago

I think we may have an inprovement for this coming soon. Keep this issue open for that.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.