Skip to content

AP_BattMonitor: Keep mavlink_charge_state instanced - #34063

Open
Georacer wants to merge 1 commit into
ArduPilot:masterfrom
Georacer:bugfix/individual_battery_charge_state
Open

AP_BattMonitor: Keep mavlink_charge_state instanced#34063
Georacer wants to merge 1 commit into
ArduPilot:masterfrom
Georacer:bugfix/individual_battery_charge_state

Conversation

@Georacer

Copy link
Copy Markdown
Contributor

Summary

Currently the method will report unhealthy in BATTERY_STATUS.charge_state for ALL batteries, if one battery is unhealthy.

Fix it to refer to the current instance only.

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

I did a SITL flight with a Loweheiser generator and 3 battery monitors configured:

BATT_MONITOR     4.000000 # Analog Voltage and Current
BATT2_MONITOR    17.000000 # Generator-Elec
BATT3_MONITOR    18.000000 # Generator-Fuel

Mid-flight, I turned off and on SIM_EFI_TYPE from 2 to 0.

Description

Currently the instanced MAVLink message BATTERY_STATUS.charge_state will go unhealthy for all backends.
Screenshot from 2026-08-14 22-36-58

This PR makes it so that it responds individually and correctly per-instance.
Screenshot from 2026-08-14 22-58-55

Currently the method will report unhealthy in
BATTERY_STATUS.charge_state for ALL batteries, if one battery is
unhealthy.

Fix it to refer to the current instance only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants