mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-28 23:24:09 +08:00
FailureDetector - update hysteresis to comply with new interface
This commit is contained in:
parent
57c2085ce4
commit
ac4458460d
@ -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);
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user