mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 06:21:35 +08:00
FailureDetector - update hysteresis to comply with new interface
This commit is contained in:
@@ -77,11 +77,13 @@ FailureDetector::updateAttitudeStatus()
|
|||||||
const bool roll_status = (max_roll > 0.0f) && (fabsf(roll) > max_roll);
|
const bool roll_status = (max_roll > 0.0f) && (fabsf(roll) > max_roll);
|
||||||
const bool pitch_status = (max_pitch > 0.0f) && (fabsf(pitch) > max_pitch);
|
const bool pitch_status = (max_pitch > 0.0f) && (fabsf(pitch) > max_pitch);
|
||||||
|
|
||||||
|
hrt_abstime time_now = hrt_absolute_time();
|
||||||
|
|
||||||
// Update hysteresis
|
// Update hysteresis
|
||||||
_roll_failure_hysteresis.set_hysteresis_time_from(false, (hrt_abstime)(1e6f * _param_fd_fail_r_ttri.get()));
|
_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()));
|
_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);
|
_roll_failure_hysteresis.set_state_and_update(roll_status, time_now);
|
||||||
_pitch_failure_hysteresis.set_state_and_update(pitch_status);
|
_pitch_failure_hysteresis.set_state_and_update(pitch_status, time_now);
|
||||||
|
|
||||||
// Update bitmask
|
// Update bitmask
|
||||||
_status &= ~(FAILURE_ROLL | FAILURE_PITCH);
|
_status &= ~(FAILURE_ROLL | FAILURE_PITCH);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#include <matrix/matrix/math.hpp>
|
#include <matrix/matrix/math.hpp>
|
||||||
#include <mathlib/mathlib.h>
|
#include <mathlib/mathlib.h>
|
||||||
#include <px4_module_params.h>
|
#include <px4_module_params.h>
|
||||||
#include <systemlib/hysteresis/hysteresis.h>
|
#include <hysteresis/hysteresis.h>
|
||||||
|
|
||||||
// subscriptions
|
// subscriptions
|
||||||
#include <uORB/Subscription.hpp>
|
#include <uORB/Subscription.hpp>
|
||||||
|
|||||||
Reference in New Issue
Block a user