VTOL: don't wait on TECS in FW state if TECS is not running

This commit is contained in:
Andreas Antener 2016-07-19 22:37:05 +02:00
parent 254358ef86
commit f069880504
1 changed files with 4 additions and 2 deletions

View File

@ -173,8 +173,10 @@ void VtolType::update_fw_state()
_tecs_running_ts = hrt_absolute_time();
}
// tecs didn't publish yet or the position controller didn't publish yet AFTER tecs
if (!_tecs_running || (_tecs_running && _fw_virtual_att_sp->timestamp <= _tecs_running_ts)) {
// TECS didn't publish yet or the position controller didn't publish yet AFTER tecs
// only wait on TECS we're in a mode where it is actually running
if ((!_tecs_running || (_tecs_running && _fw_virtual_att_sp->timestamp <= _tecs_running_ts))
&& _v_control_mode->flag_control_altitude_enabled) {
waiting_on_tecs();
}