always update armed flag (#5434)

otherwise the battery estimator does not compute bat_v_empty_dynamic correctly
This commit is contained in:
Nicolas de Palezieux
2016-09-03 21:59:27 +02:00
committed by Lorenz Meier
parent d03611763a
commit a071ef94db
+1 -2
View File
@@ -1355,19 +1355,18 @@ Sensors::vehicle_control_mode_poll()
if (vcontrol_mode_updated) {
orb_copy(ORB_ID(vehicle_control_mode), _vcontrol_mode_sub, &vcontrol_mode);
_armed = vcontrol_mode.flag_armed;
/* switching from non-HIL to HIL mode */
if (vcontrol_mode.flag_system_hil_enabled && !_hil_enabled) {
_hil_enabled = true;
_publishing = false;
_armed = vcontrol_mode.flag_armed;
/* switching from HIL to non-HIL mode */
} else if (!_publishing && !_hil_enabled) {
_hil_enabled = false;
_publishing = true;
_armed = vcontrol_mode.flag_armed;
}
}
}