aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-04-04 18:47:30 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-04-04 18:47:30 +0200
commit1e25ceb085a8ca5cd53825a2eb30d9cf69c3a8d9 (patch)
treeec5d2e80f2056d34ee0880569c27f3143b9b6f46 /src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
parent2b6a9c5122008ca47cf7524b6887d7de9b0b8a5d (diff)
downloadpx4-firmware-1e25ceb085a8ca5cd53825a2eb30d9cf69c3a8d9.tar.gz
px4-firmware-1e25ceb085a8ca5cd53825a2eb30d9cf69c3a8d9.tar.bz2
px4-firmware-1e25ceb085a8ca5cd53825a2eb30d9cf69c3a8d9.zip
Create EKF object in right context
Diffstat (limited to 'src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp')
-rw-r--r--src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp b/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
index 20c5d3719..840cd585e 100644
--- a/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
+++ b/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
@@ -292,7 +292,7 @@ FixedwingEstimator::FixedwingEstimator() :
_initialized(false),
_gps_initialized(false),
_mavlink_fd(-1),
- _ekf(new AttPosEKF())
+ _ekf(nullptr)
{
_mavlink_fd = open(MAVLINK_LOG_DEVICE, 0);
@@ -396,6 +396,8 @@ void
FixedwingEstimator::task_main()
{
+ _ekf = new AttPosEKF();
+
if (!_ekf) {
errx(1, "failed allocating EKF filter - out of RAM!");
}