mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 06:23:34 +08:00
hysteresis: remove dependency/side effect on time
This commit is contained in:
@@ -207,11 +207,12 @@ void LandDetector::_update_state()
|
||||
{
|
||||
/* when we are landed we also have ground contact for sure but only one output state can be true at a particular time
|
||||
* with higher priority for landed */
|
||||
_freefall_hysteresis.set_state_and_update(_get_freefall_state());
|
||||
_landed_hysteresis.set_state_and_update(_get_landed_state());
|
||||
_maybe_landed_hysteresis.set_state_and_update(_get_maybe_landed_state());
|
||||
_ground_contact_hysteresis.set_state_and_update(_get_ground_contact_state());
|
||||
_ground_effect_hysteresis.set_state_and_update(_get_ground_effect_state());
|
||||
const hrt_abstime now_us = hrt_absolute_time();
|
||||
_freefall_hysteresis.set_state_and_update(_get_freefall_state(), now_us);
|
||||
_landed_hysteresis.set_state_and_update(_get_landed_state(), now_us);
|
||||
_maybe_landed_hysteresis.set_state_and_update(_get_maybe_landed_state(), now_us);
|
||||
_ground_contact_hysteresis.set_state_and_update(_get_ground_contact_state(), now_us);
|
||||
_ground_effect_hysteresis.set_state_and_update(_get_ground_effect_state(), now_us);
|
||||
|
||||
if (_freefall_hysteresis.get_state()) {
|
||||
_state = LandDetectionState::FREEFALL;
|
||||
|
||||
Reference in New Issue
Block a user