mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 11:57:34 +08:00
always update armed flag (#5434)
otherwise the battery estimator does not compute bat_v_empty_dynamic correctly
This commit is contained in:
committed by
Lorenz Meier
parent
d03611763a
commit
a071ef94db
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user