mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 17:35:22 +08:00
land_detector: don't estimate freefall on 0 data
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user