aboutsummaryrefslogtreecommitdiff
path: root/src/modules/ekf_att_pos_estimator
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-07-13 14:58:57 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-07-13 14:58:57 +0200
commitb4b3a2a2c68a523af5141a4452e533befc873384 (patch)
tree07dad299883c61addc45f69de62852dcc2885f28 /src/modules/ekf_att_pos_estimator
parentc610050dc305884a704b51c00cfff5f2f9984bcb (diff)
downloadpx4-firmware-b4b3a2a2c68a523af5141a4452e533befc873384.tar.gz
px4-firmware-b4b3a2a2c68a523af5141a4452e533befc873384.tar.bz2
px4-firmware-b4b3a2a2c68a523af5141a4452e533befc873384.zip
EKF hotfix: Force zero initialization of vectors
Diffstat (limited to 'src/modules/ekf_att_pos_estimator')
-rw-r--r--src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp4
-rw-r--r--src/modules/ekf_att_pos_estimator/estimator_23states.cpp2
-rw-r--r--src/modules/ekf_att_pos_estimator/estimator_utilities.h8
3 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
index 5d768b73d..a835599e7 100644
--- a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
+++ b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
@@ -743,8 +743,8 @@ FixedwingEstimator::task_main()
/* sets also parameters in the EKF object */
parameters_update();
- Vector3f lastAngRate = {0.0f, 0.0f, 0.0f};
- Vector3f lastAccel = {0.0f, 0.0f, 0.0f};
+ Vector3f lastAngRate;
+ Vector3f lastAccel;
/* wakeup source(s) */
struct pollfd fds[2];
diff --git a/src/modules/ekf_att_pos_estimator/estimator_23states.cpp b/src/modules/ekf_att_pos_estimator/estimator_23states.cpp
index 3da92b264..a41b58250 100644
--- a/src/modules/ekf_att_pos_estimator/estimator_23states.cpp
+++ b/src/modules/ekf_att_pos_estimator/estimator_23states.cpp
@@ -73,7 +73,7 @@ void AttPosEKF::UpdateStrapdownEquationsNED()
float qUpdated[4];
float quatMag;
float deltaQuat[4];
- const Vector3f gravityNED = {0.0,0.0,GRAVITY_MSS};
+ const Vector3f gravityNED(0.0f, 0.0f, GRAVITY_MSS);
// Remove sensor bias errors
correctedDelAng.x = dAngIMU.x - states[10];
diff --git a/src/modules/ekf_att_pos_estimator/estimator_utilities.h b/src/modules/ekf_att_pos_estimator/estimator_utilities.h
index 5648cb05c..0cafdc808 100644
--- a/src/modules/ekf_att_pos_estimator/estimator_utilities.h
+++ b/src/modules/ekf_att_pos_estimator/estimator_utilities.h
@@ -19,6 +19,14 @@ public:
float y;
float z;
+ Vector3f() { zero(); }
+
+ Vector3f(float a, float b, float c) :
+ x(a),
+ y(b),
+ z(c)
+ {}
+
float length(void) const;
void zero(void);
};