FailureDetector - update hysteresis to comply with new interface

This commit is contained in:
bresch 2019-06-05 14:02:13 +02:00 committed by Beat Küng
parent 57c2085ce4
commit ac4458460d
2 changed files with 5 additions and 3 deletions

View File

@ -77,11 +77,13 @@ FailureDetector::updateAttitudeStatus()
const bool roll_status = (max_roll > 0.0f) && (fabsf(roll) > max_roll);
const bool pitch_status = (max_pitch > 0.0f) && (fabsf(pitch) > max_pitch);
hrt_abstime time_now = hrt_absolute_time();
// Update hysteresis
_roll_failure_hysteresis.set_hysteresis_time_from(false, (hrt_abstime)(1e6f * _param_fd_fail_r_ttri.get()));
_pitch_failure_hysteresis.set_hysteresis_time_from(false, (hrt_abstime)(1e6f * _param_fd_fail_p_ttri.get()));
_roll_failure_hysteresis.set_state_and_update(roll_status);
_pitch_failure_hysteresis.set_state_and_update(pitch_status);
_roll_failure_hysteresis.set_state_and_update(roll_status, time_now);
_pitch_failure_hysteresis.set_state_and_update(pitch_status, time_now);
// Update bitmask
_status &= ~(FAILURE_ROLL | FAILURE_PITCH);

View File

@ -46,7 +46,7 @@
#include <matrix/matrix/math.hpp>
#include <mathlib/mathlib.h>
#include <px4_module_params.h>
#include <systemlib/hysteresis/hysteresis.h>
#include <hysteresis/hysteresis.h>
// subscriptions
#include <uORB/Subscription.hpp>