Attitude filter for multirotors: Let users choose between filters

This commit is contained in:
Lorenz Meier 2015-05-06 09:16:34 +02:00
parent 6c859245e2
commit 9892f12d2e
2 changed files with 16 additions and 3 deletions

View File

@ -4,11 +4,21 @@
# att & pos estimator, att & pos control.
#
# previously (2014) the system was relying on
# INAV, which defaults to 0 now.
# The system is defaulting to INAV_ENABLED = 1
# but users can alternatively try the EKF-based
# filter by setting INAV_ENABLED = 0
if param compare INAV_ENABLED 1
then
attitude_estimator_q start
# The system is defaulting to EKF_ATT_ENABLED = 0
# and uses the new quaternion based complimentary
# filter. However users can enable the older EKF
# filter if they choose to.
if param compare EKF_ATT_ENABLED 1
then
attitude_estimator_ekf start
else
attitude_estimator_q start
fi
position_estimator_inav start
else
ekf_att_pos_estimator start

View File

@ -94,6 +94,9 @@ PARAM_DEFINE_FLOAT(EKF_ATT_V4_R1, 10000.0f);
*/
PARAM_DEFINE_FLOAT(EKF_ATT_V4_R2, 100.0f);
/* magnetic declination, in degrees */
PARAM_DEFINE_INT32(EKF_ATT_ENABLED, 0);
/* magnetic declination, in degrees */
PARAM_DEFINE_FLOAT(ATT_MAG_DECL, 0.0f);