1 #include "../BlockLocalPositionEstimator.hpp" 39 if (euler.
phi() > 0.5f || euler.
theta() > 0.5f) {
51 if (qual < _param_lpe_flw_qmin.get()) {
60 float d =
agl() * cosf(euler.
phi()) * cosf(euler.
theta());
68 if (dt_flow > 0.5
f || dt_flow < 1.0e-6
f) {
89 +(flow_y_rad - gyro_y_rad) * d,
90 -(flow_x_rad - gyro_x_rad) * d,
126 const float p[5] = {0.04005232f, -0.00656446f, -0.26265873f, 0.13686658f, -0.00397357f};
131 const float h_min = 2.0f;
132 const float h_max = 8.0f;
133 const float v_min = 0.5f;
134 const float v_max = 1.0f;
153 float flow_vxy_stddev = p[0] * h + p[1] * h * h + p[2] * v + p[3] * v * h + p[4] * v * h * h;
156 float rotrate_sq = rates(0) * rates(0)
157 + rates(1) * rates(1)
158 + rates(2) * rates(2);
164 _param_lpe_flw_r.get() * _param_lpe_flw_r.get() * rot_sq +
165 _param_lpe_flw_rr.get() * _param_lpe_flw_rr.get() * rotrate_sq;
184 float beta = (r.
transpose() * (S_I * r))(0, 0);
#define mavlink_log_critical(_pub, _text,...)
Send a mavlink critical message and print to console.
orb_advert_t mavlink_log_pub
static const float BETA_TABLE[7]
static const uint32_t REQ_FLOW_INIT_COUNT
uint8_t _estimatorInitialized
float gyro_x_rate_integral
matrix::Vector< Type, M > getMean()
BlockStats< float, 1 > _flowQStats
float pixel_flow_y_integral
uORB::SubscriptionData< optical_flow_s > _sub_flow
static const uint32_t FLOW_TIMEOUT
uORB::SubscriptionData< vehicle_angular_velocity_s > _sub_angular_velocity
matrix::Dcm< float > _R_att
float min_ground_distance
float pixel_flow_x_integral
Matrix< Type, N, M > transpose() const
#define mavlink_and_console_log_info(_pub, _text,...)
Send a mavlink emergency message and print to console.
uORB::SubscriptionData< vehicle_attitude_s > _sub_att
float update(float input)
BlockHighPass _flow_gyro_y_high_pass
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
int flowMeasure(Vector< float, n_y_flow > &y)
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
Matrix< float, n_x, n_x > m_P
matrix::Vector< Type, M > getStdDev()
uint32_t integration_timespan
BlockHighPass _flow_gyro_x_high_pass
float gyro_y_rate_integral
uORB::PublicationData< ekf2_innovations_s > _pub_innov
void update(const matrix::Vector< Type, M > &u)