PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <PreFlightChecker.hpp>
Public Member Functions | |
PreFlightChecker ()=default | |
~PreFlightChecker ()=default | |
void | reset () |
void | update (float dt, const ekf2_innovations_s &innov) |
void | setVehicleCanObserveHeadingInFlight (bool val) |
void | setUsingGpsAiding (bool val) |
void | setUsingFlowAiding (bool val) |
void | setUsingEvPosAiding (bool val) |
bool | hasHeadingFailed () const |
bool | hasHorizVelFailed () const |
bool | hasVertVelFailed () const |
bool | hasHeightFailed () const |
bool | hasFailed () const |
bool | hasHorizFailed () const |
bool | hasVertFailed () const |
Static Public Member Functions | |
static bool | checkInnovFailed (float innov, float innov_lpf, float test_limit) |
static bool | checkInnov2DFailed (const Vector2f &innov, const Vector2f &innov_lpf, float test_limit) |
static constexpr float | sq (float var) |
Private Member Functions | |
bool | preFlightCheckHeadingFailed (const ekf2_innovations_s &innov, float alpha) |
float | selectHeadingTestLimit () |
bool | preFlightCheckHorizVelFailed (const ekf2_innovations_s &innov, float alpha) |
bool | preFlightCheckVertVelFailed (const ekf2_innovations_s &innov, float alpha) |
bool | preFlightCheckHeightFailed (const ekf2_innovations_s &innov, float alpha) |
void | resetPreFlightChecks () |
Private Attributes | |
bool | _has_heading_failed {} |
bool | _has_horiz_vel_failed {} |
bool | _has_vert_vel_failed {} |
bool | _has_height_failed {} |
bool | _can_observe_heading_in_flight {} |
bool | _is_using_gps_aiding {} |
bool | _is_using_flow_aiding {} |
bool | _is_using_ev_pos_aiding {} |
InnovationLpf | _filter_vel_n_innov |
Preflight low pass filter N axis velocity innovations (m/sec) More... | |
InnovationLpf | _filter_vel_e_innov |
Preflight low pass filter E axis velocity innovations (m/sec) More... | |
InnovationLpf | _filter_vel_d_innov |
Preflight low pass filter D axis velocity innovations (m/sec) More... | |
InnovationLpf | _filter_hgt_innov |
Preflight low pass filter height innovation (m) More... | |
InnovationLpf | _filter_heading_innov |
Preflight low pass filter heading innovation magntitude (rad) More... | |
InnovationLpf | _filter_flow_x_innov |
Preflight low pass filter optical flow innovation (rad) More... | |
InnovationLpf | _filter_flow_y_innov |
Preflight low pass filter optical flow innovation (rad) More... | |
Static Private Attributes | |
static constexpr float | _innov_lpf_tau_inv = 0.2f |
static constexpr float | _vel_innov_test_lim = 0.5f |
static constexpr float | _hgt_innov_test_lim = 1.5f |
static constexpr float | _nav_heading_innov_test_lim = 0.25f |
static constexpr float | _heading_innov_test_lim = 0.52f |
static constexpr float | _flow_innov_test_lim = 0.1f |
static constexpr float | _vel_innov_spike_lim = 2.0f * _vel_innov_test_lim |
static constexpr float | _hgt_innov_spike_lim = 2.0f * _hgt_innov_test_lim |
static constexpr float | _flow_innov_spike_lim = 2.0f * _flow_innov_test_lim |
Definition at line 53 of file PreFlightChecker.hpp.
|
default |
|
default |
|
static |
Definition at line 114 of file PreFlightChecker.cpp.
Referenced by hasVertFailed(), preFlightCheckHorizVelFailed(), and TEST_F().
|
static |
Definition at line 109 of file PreFlightChecker.cpp.
Referenced by hasVertFailed(), preFlightCheckHeadingFailed(), preFlightCheckHeightFailed(), preFlightCheckVertVelFailed(), and TEST_F().
|
inline |
Definition at line 89 of file PreFlightChecker.hpp.
References hasHorizFailed(), and hasVertFailed().
Referenced by Ekf2::Run().
|
inline |
Definition at line 80 of file PreFlightChecker.hpp.
References _has_heading_failed.
Referenced by Ekf2::Run().
|
inline |
Definition at line 83 of file PreFlightChecker.hpp.
References _has_height_failed.
Referenced by Ekf2::Run().
|
inline |
Definition at line 95 of file PreFlightChecker.hpp.
References _has_heading_failed, and _has_horiz_vel_failed.
Referenced by hasFailed(), and Ekf2::Run().
|
inline |
Definition at line 81 of file PreFlightChecker.hpp.
References _has_horiz_vel_failed.
Referenced by Ekf2::Run().
|
inline |
Definition at line 101 of file PreFlightChecker.hpp.
References _has_height_failed, _has_vert_vel_failed, checkInnov2DFailed(), and checkInnovFailed().
Referenced by hasFailed(), and Ekf2::Run().
|
inline |
Definition at line 82 of file PreFlightChecker.hpp.
References _has_vert_vel_failed.
Referenced by Ekf2::Run().
|
private |
Definition at line 51 of file PreFlightChecker.cpp.
References _filter_heading_innov, checkInnovFailed(), ekf2_innovations_s::heading_innov, selectHeadingTestLimit(), and InnovationLpf::update().
Referenced by sq(), and update().
|
private |
Definition at line 102 of file PreFlightChecker.cpp.
References _filter_hgt_innov, _hgt_innov_spike_lim, _hgt_innov_test_lim, checkInnovFailed(), InnovationLpf::update(), and ekf2_innovations_s::vel_pos_innov.
Referenced by sq(), and update().
|
private |
Definition at line 72 of file PreFlightChecker.cpp.
References _filter_flow_x_innov, _filter_vel_n_innov, _flow_innov_spike_lim, _flow_innov_test_lim, _is_using_ev_pos_aiding, _is_using_flow_aiding, _is_using_gps_aiding, _vel_innov_spike_lim, _vel_innov_test_lim, checkInnov2DFailed(), ekf2_innovations_s::flow_innov, InnovationLpf::update(), and ekf2_innovations_s::vel_pos_innov.
Referenced by sq(), and update().
|
private |
Definition at line 95 of file PreFlightChecker.cpp.
References _filter_vel_d_innov, _vel_innov_spike_lim, _vel_innov_test_lim, checkInnovFailed(), InnovationLpf::update(), and ekf2_innovations_s::vel_pos_innov.
Referenced by sq(), and update().
void PreFlightChecker::reset | ( | void | ) |
Definition at line 120 of file PreFlightChecker.cpp.
References _filter_flow_x_innov, _filter_flow_y_innov, _filter_heading_innov, _filter_hgt_innov, _filter_vel_d_innov, _filter_vel_e_innov, _filter_vel_n_innov, _has_heading_failed, _has_height_failed, _has_horiz_vel_failed, _has_vert_vel_failed, _is_using_ev_pos_aiding, _is_using_flow_aiding, _is_using_gps_aiding, and InnovationLpf::reset().
Referenced by Ekf2::resetPreFlightChecks().
|
private |
|
private |
Definition at line 61 of file PreFlightChecker.cpp.
References _can_observe_heading_in_flight, _heading_innov_test_lim, _is_using_ev_pos_aiding, _is_using_gps_aiding, and _nav_heading_innov_test_lim.
Referenced by preFlightCheckHeadingFailed(), and sq().
|
inline |
Definition at line 78 of file PreFlightChecker.hpp.
References _is_using_ev_pos_aiding.
Referenced by Ekf2::runPreFlightChecks().
|
inline |
Definition at line 77 of file PreFlightChecker.hpp.
References _is_using_flow_aiding.
Referenced by Ekf2::runPreFlightChecks().
|
inline |
Definition at line 76 of file PreFlightChecker.hpp.
References _is_using_gps_aiding.
Referenced by Ekf2::runPreFlightChecks().
|
inline |
Definition at line 74 of file PreFlightChecker.hpp.
References _can_observe_heading_in_flight.
Referenced by Ekf2::runPreFlightChecks().
|
inlinestatic |
Definition at line 127 of file PreFlightChecker.hpp.
References preFlightCheckHeadingFailed(), preFlightCheckHeightFailed(), preFlightCheckHorizVelFailed(), preFlightCheckVertVelFailed(), resetPreFlightChecks(), and selectHeadingTestLimit().
Referenced by checkInnov2DFailed().
void PreFlightChecker::update | ( | float | dt, |
const ekf2_innovations_s & | innov | ||
) |
Definition at line 41 of file PreFlightChecker.cpp.
References _has_heading_failed, _has_height_failed, _has_horiz_vel_failed, _has_vert_vel_failed, _innov_lpf_tau_inv, InnovationLpf::computeAlphaFromDtAndTauInv(), preFlightCheckHeadingFailed(), preFlightCheckHeightFailed(), preFlightCheckHorizVelFailed(), and preFlightCheckVertVelFailed().
Referenced by Ekf2::runPreFlightChecks().
|
private |
Definition at line 144 of file PreFlightChecker.hpp.
Referenced by selectHeadingTestLimit(), and setVehicleCanObserveHeadingInFlight().
|
private |
Preflight low pass filter optical flow innovation (rad)
Definition at line 155 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed(), and reset().
|
private |
Preflight low pass filter optical flow innovation (rad)
Definition at line 156 of file PreFlightChecker.hpp.
Referenced by reset().
|
private |
Preflight low pass filter heading innovation magntitude (rad)
Definition at line 154 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHeadingFailed(), and reset().
|
private |
Preflight low pass filter height innovation (m)
Definition at line 153 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHeightFailed(), and reset().
|
private |
Preflight low pass filter D axis velocity innovations (m/sec)
Definition at line 152 of file PreFlightChecker.hpp.
Referenced by preFlightCheckVertVelFailed(), and reset().
|
private |
Preflight low pass filter E axis velocity innovations (m/sec)
Definition at line 151 of file PreFlightChecker.hpp.
Referenced by reset().
|
private |
Preflight low pass filter N axis velocity innovations (m/sec)
Definition at line 150 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed(), and reset().
|
staticprivate |
Definition at line 175 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed().
|
staticprivate |
Definition at line 169 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed().
|
private |
Definition at line 139 of file PreFlightChecker.hpp.
Referenced by hasHeadingFailed(), hasHorizFailed(), reset(), and update().
|
private |
Definition at line 142 of file PreFlightChecker.hpp.
Referenced by hasHeightFailed(), hasVertFailed(), reset(), and update().
|
private |
Definition at line 140 of file PreFlightChecker.hpp.
Referenced by hasHorizFailed(), hasHorizVelFailed(), reset(), and update().
|
private |
Definition at line 141 of file PreFlightChecker.hpp.
Referenced by hasVertFailed(), hasVertVelFailed(), reset(), and update().
|
staticprivate |
Definition at line 167 of file PreFlightChecker.hpp.
Referenced by selectHeadingTestLimit().
|
staticprivate |
Definition at line 173 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHeightFailed().
|
staticprivate |
Definition at line 163 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHeightFailed().
|
staticprivate |
Definition at line 159 of file PreFlightChecker.hpp.
Referenced by update().
|
private |
Definition at line 147 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed(), reset(), selectHeadingTestLimit(), and setUsingEvPosAiding().
|
private |
Definition at line 146 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed(), reset(), and setUsingFlowAiding().
|
private |
Definition at line 145 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed(), reset(), selectHeadingTestLimit(), and setUsingGpsAiding().
|
staticprivate |
Definition at line 165 of file PreFlightChecker.hpp.
Referenced by selectHeadingTestLimit().
|
staticprivate |
Definition at line 171 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed(), and preFlightCheckVertVelFailed().
|
staticprivate |
Definition at line 161 of file PreFlightChecker.hpp.
Referenced by preFlightCheckHorizVelFailed(), and preFlightCheckVertVelFailed().