aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-06-01 09:53:04 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-06-01 09:53:04 +0200
commitbb87cb8c612bb733f0d37226c2157eb080aaf07a (patch)
treef88c3e40d81ec5dbdaea376e1354cd80c3b7d0bf /src
parentdb925db460fc24ae4d02b87e6fc9cebf2b100b7a (diff)
downloadpx4-firmware-bb87cb8c612bb733f0d37226c2157eb080aaf07a.tar.gz
px4-firmware-bb87cb8c612bb733f0d37226c2157eb080aaf07a.tar.bz2
px4-firmware-bb87cb8c612bb733f0d37226c2157eb080aaf07a.zip
fw pos control: don't call tecs 50hz update loop if mtecs is enabled
Diffstat (limited to 'src')
-rw-r--r--src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
index acd623c30..954431fa3 100644
--- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
+++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
@@ -845,7 +845,10 @@ FixedwingPositionControl::control_position(const math::Vector<2> &current_positi
math::Vector<3> accel_body(_sensor_combined.accelerometer_m_s2);
math::Vector<3> accel_earth = _R_nb * accel_body;
- _tecs.update_50hz(baro_altitude, _airspeed.indicated_airspeed_m_s, _R_nb, accel_body, accel_earth);
+ if (!_mTecs.getEnabled()) {
+ _tecs.update_50hz(baro_altitude, _airspeed.indicated_airspeed_m_s, _R_nb, accel_body, accel_earth);
+ }
+
float altitude_error = _pos_sp_triplet.current.alt - _global_pos.alt;
/* no throttle limit as default */