mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 06:43:35 +08:00
BatteryStatus: remove current_filtered_a
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Matthias Grob
parent
e03e0261a1
commit
c2ae6a7e24
@@ -31,15 +31,11 @@ def rls_update(theta, P, x, V, I, lam):
|
||||
return theta_corr, P_corr, error, data_cov, 0, 0
|
||||
return theta_temp, P_temp, error, data_cov, gamma[0], gamma[1]
|
||||
|
||||
def main(log_name, n_cells, full_cell, empty_cell, lam, filtered):
|
||||
def main(log_name, n_cells, full_cell, empty_cell, lam):
|
||||
log = ULog(log_name)
|
||||
timestamps = us2s(getData(log, 'battery_status', 'timestamp'))
|
||||
if (filtered):
|
||||
I = getData(log, 'battery_status', 'current_filtered_a')
|
||||
V = getData(log, 'battery_status', 'voltage_filtered_v')
|
||||
else:
|
||||
I = getData(log, 'battery_status', 'current_a')
|
||||
V = getData(log, 'battery_status', 'voltage_v')
|
||||
I = getData(log, 'battery_status', 'current_a')
|
||||
V = getData(log, 'battery_status', 'voltage_v')
|
||||
remaining = getData(log, 'battery_status', 'remaining')
|
||||
|
||||
if not timestamps.size or not I.size or not V.size or not remaining.size:
|
||||
@@ -176,6 +172,5 @@ if __name__ == "__main__":
|
||||
parser.add_argument('-u', type = float, required = False, default = 4.05, help = 'Full cell voltage')
|
||||
parser.add_argument('-e', type = float, required = False, default = 3.6, help = 'Empty cell voltage')
|
||||
parser.add_argument('-l', type = float, required = False, default = 0.99, help = 'Forgetting factor')
|
||||
parser.add_argument('-d', type = bool, required = False, default = False, help = 'Filter measurements')
|
||||
args = parser.parse_args()
|
||||
main(args.f, args.c, args.u, args.e, args.l, args.d)
|
||||
main(args.f, args.c, args.u, args.e, args.l)
|
||||
|
||||
@@ -267,7 +267,6 @@ int SMBUS_SBS_BaseClass<T>::populate_smbus_data(battery_status_s &data)
|
||||
ret |= _interface->read_word(BATT_SMBUS_CURRENT, result);
|
||||
|
||||
data.current_a = (-1.0f * ((float)(*(int16_t *)&result)) * 0.001f);
|
||||
data.current_filtered_a = data.current_a;
|
||||
|
||||
// Read remaining capacity.
|
||||
ret |= _interface->read_word(BATT_SMBUS_RELATIVE_SOC, result);
|
||||
|
||||
Reference in New Issue
Block a user