mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-12 01:23:56 -03:00
AP_NavEKF: Add protection for negative height above ground
This commit is contained in:
parent
963cc4d60a
commit
b1d44d4dde
@ -3628,7 +3628,7 @@ void NavEKF::getEkfControlLimits(float &ekfGndSpdLimit, float &ekfNavVelGainScal
|
|||||||
{
|
{
|
||||||
if (useOptFlow() || gpsInhibitMode == 2) {
|
if (useOptFlow() || gpsInhibitMode == 2) {
|
||||||
// allow 1.0 rad/sec margin for angular motion
|
// allow 1.0 rad/sec margin for angular motion
|
||||||
ekfGndSpdLimit = max((_maxFlowRate - 1.0f), 0.0f) * (flowStates[1] - state.position[2]);
|
ekfGndSpdLimit = max((_maxFlowRate - 1.0f), 0.0f) * max((flowStates[1] - state.position[2]), 0.1f);
|
||||||
// use standard gains up to 5.0 metres height and reduce above that
|
// use standard gains up to 5.0 metres height and reduce above that
|
||||||
ekfNavVelGainScaler = 5.0f / max((flowStates[1] - state.position[2]),5.0f);
|
ekfNavVelGainScaler = 5.0f / max((flowStates[1] - state.position[2]),5.0f);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user