Skip to content

Commit

Permalink
LandDetector: use vertical velocity estimate for threshold
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MaEtUgR committed Jan 26, 2019
1 parent d590385 commit f9ec0cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/land_detector/MulticopterLandDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f9ec0cd

Please sign in to comment.