diff --git a/src/modules/land_detector/MulticopterLandDetector.cpp b/src/modules/land_detector/MulticopterLandDetector.cpp index 72f06daf54..724c781d0a 100644 --- a/src/modules/land_detector/MulticopterLandDetector.cpp +++ b/src/modules/land_detector/MulticopterLandDetector.cpp @@ -224,7 +224,8 @@ bool MulticopterLandDetector::_get_ground_contact_state() // If pilots commands down or in auto mode and we are already below minimal thrust and we do not move down we assume ground contact // TODO: we need an accelerometer based check for vertical movement for flying without GPS - if (manual_control_idle_or_auto && _has_low_thrust() && (!horizontalMovement || !_has_position_lock()) && + if (manual_control_idle_or_auto && (_has_low_thrust() || hit_ground) && (!horizontalMovement || !_has_position_lock()) + && (!verticalMovement || !_has_altitude_lock())) { return true; } diff --git a/src/modules/mc_pos_control/mc_pos_control_main.cpp b/src/modules/mc_pos_control/mc_pos_control_main.cpp index e22a1eef49..99a16e9c95 100644 --- a/src/modules/mc_pos_control/mc_pos_control_main.cpp +++ b/src/modules/mc_pos_control/mc_pos_control_main.cpp @@ -1807,7 +1807,7 @@ MulticopterPositionControl::calculate_thrust_setpoint(float dt) thrust_sp(1) = 0.0f; } - if (!in_auto_takeoff) { + if (!in_auto_takeoff()) { if (_vehicle_land_detected.ground_contact) { /* if still or already on ground command zero xy thrust_sp in body * frame to consider uneven ground */