mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
always update armed flag (#5434)
otherwise the battery estimator does not compute bat_v_empty_dynamic correctly
This commit is contained in:
1 parent
d03611763a
commit
a071ef94db
1 file changed
+1
-2
@@ -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