aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-05-06 09:16:34 +0200
committerLorenz Meier <lm@inf.ethz.ch>2015-05-06 09:16:34 +0200
commit9892f12d2e2d1655792429a214efb3cdd5314542 (patch)
tree78d44dcfec3695c9a1440b845e1e4c4e4145c1f6
parent6c859245e28f7e1d5a019c8f36461ba73d1f080d (diff)
downloadpx4-firmware-9892f12d2e2d1655792429a214efb3cdd5314542.tar.gz
px4-firmware-9892f12d2e2d1655792429a214efb3cdd5314542.tar.bz2
px4-firmware-9892f12d2e2d1655792429a214efb3cdd5314542.zip
Attitude filter for multirotors: Let users choose between filters
-rw-r--r--ROMFS/px4fmu_common/init.d/rc.mc_apps16
-rwxr-xr-xsrc/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c3
2 files changed, 16 insertions, 3 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.mc_apps b/ROMFS/px4fmu_common/init.d/rc.mc_apps
index a28ff1bbe..12049096a 100644
--- a/ROMFS/px4fmu_common/init.d/rc.mc_apps
+++ b/ROMFS/px4fmu_common/init.d/rc.mc_apps
@@ -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
diff --git a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
index fe480e12b..7eb1baeae 100755
--- a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
+++ b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
@@ -95,6 +95,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);
PARAM_DEFINE_INT32(ATT_ACC_COMP, 2);