aboutsummaryrefslogtreecommitdiff
path: root/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2013-11-22 21:44:37 +0400
committerAnton Babushkin <anton.babushkin@me.com>2013-11-22 21:44:37 +0400
commitdada0b85998ac46a5b447e13a0c2f54819d07360 (patch)
tree4c3a7b9057fe5ee25743f32f13499e2f126d3613 /src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
parent4afb420bedf40de3b5b30929defd9a79b77aed32 (diff)
downloadpx4-firmware-dada0b85998ac46a5b447e13a0c2f54819d07360.tar.gz
px4-firmware-dada0b85998ac46a5b447e13a0c2f54819d07360.tar.bz2
px4-firmware-dada0b85998ac46a5b447e13a0c2f54819d07360.zip
attitude_estimator_ekf: mag declination parameter implemented
Diffstat (limited to 'src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c')
-rwxr-xr-xsrc/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c7
1 files changed, 7 insertions, 0 deletions
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 52dac652b..a6a40b4a1 100755
--- a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
+++ b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
@@ -63,6 +63,9 @@ PARAM_DEFINE_FLOAT(ATT_ROLL_OFF3, 0.0f);
PARAM_DEFINE_FLOAT(ATT_PITCH_OFF3, 0.0f);
PARAM_DEFINE_FLOAT(ATT_YAW_OFF3, 0.0f);
+/* magnetic declination, in degrees */
+PARAM_DEFINE_FLOAT(ATT_MAG_DECL, 0.0f);
+
int parameters_init(struct attitude_estimator_ekf_param_handles *h)
{
/* PID parameters */
@@ -81,6 +84,8 @@ int parameters_init(struct attitude_estimator_ekf_param_handles *h)
h->pitch_off = param_find("ATT_PITCH_OFF3");
h->yaw_off = param_find("ATT_YAW_OFF3");
+ h->mag_decl = param_find("ATT_MAG_DECL");
+
return OK;
}
@@ -101,5 +106,7 @@ int parameters_update(const struct attitude_estimator_ekf_param_handles *h, stru
param_get(h->pitch_off, &(p->pitch_off));
param_get(h->yaw_off, &(p->yaw_off));
+ param_get(h->mag_decl, &(p->mag_decl));
+
return OK;
}