diff --git a/src/modules/land_detector/MulticopterLandDetector.cpp b/src/modules/land_detector/MulticopterLandDetector.cpp index a87c3a6658..43b3a935b2 100644 --- a/src/modules/land_detector/MulticopterLandDetector.cpp +++ b/src/modules/land_detector/MulticopterLandDetector.cpp @@ -135,6 +135,11 @@ bool MulticopterLandDetector::get_freefall_state() const uint64_t now = hrt_absolute_time(); + if (_ctrl_state.timestamp == 0) { + // _ctrl_state is not valid yet, we have to assume we're not falling. + return false; + } + float acc_norm = _ctrl_state.x_acc * _ctrl_state.x_acc + _ctrl_state.y_acc * _ctrl_state.y_acc + _ctrl_state.z_acc * _ctrl_state.z_acc;