Skip to content
Snippets Groups Projects
Commit f9ec0cd5 authored by Matthias Grob's avatar Matthias Grob
Browse files

LandDetector: use vertical velocity estimate for threshold

instead of the derivative of the vertical position which is
not the same value when using the ekf2 estimation.

Using the position derivative resulted in delayed landing because
the value for some reason often bumped over the theshold before
slowly converging towards zero while the velocity was within expected
accuary in all these cases.
parent d5903853
No related branches found
No related tags found
No related merge requests found
......@@ -175,7 +175,7 @@ bool MulticopterLandDetector::_get_ground_contact_state()
// Adjust maxClimbRate if land_speed is lower than 2x maxClimbrate
float maxClimbRate = ((land_speed_threshold * 0.5f) < _params.maxClimbRate) ? (0.5f * land_speed_threshold) :
_params.maxClimbRate;
verticalMovement = fabsf(_vehicleLocalPosition.z_deriv) > maxClimbRate;
verticalMovement = fabsf(_vehicleLocalPosition.vz) > maxClimbRate;
}
// Check if we are moving horizontally.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment