mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 15:03:34 +08:00
battery: check source param inside battery lib
This moves the handling of the BAT%d_SOURCE param inside of the battery library. Users of the library now pass the source instead of the flag whether to publish. The battery library then checks if the source is selected using the param and publishes accordingly. Since we removed the strange system_source flag, we now need to look at all batteries in commander. For current estimation - I think - it makes sense to sum them up.
This commit is contained in:
@@ -10,7 +10,11 @@ float32 scale # Power scaling factor, >= 1, or -1 if unknown
|
||||
float32 temperature # temperature of the battery. NaN if unknown
|
||||
int32 cell_count # Number of cells
|
||||
bool connected # Whether or not a battery is connected, based on a voltage threshold
|
||||
bool system_source # Whether or not a this battery is the active power source for VDD_5V_IN
|
||||
|
||||
uint8 BATTERY_SOURCE_POWER_MODULE = 0
|
||||
uint8 BATTERY_SOURCE_EXTERNAL = 0
|
||||
uint8 BATTERY_SOURCE_ESCS = 0
|
||||
uint8 source # Battery source
|
||||
uint8 priority # Zero based priority is the connection on the Power Controller V1..Vn AKA BrickN-1
|
||||
uint16 capacity # actual capacity of the battery
|
||||
uint16 cycle_count # number of discharge cycles the battery has experienced
|
||||
|
||||
Reference in New Issue
Block a user