Refactored to work with new battery_status module

This commit is contained in:
Timothy Scott
2019-12-05 16:38:04 +01:00
committed by Julian Oes
parent d7bb5d46bb
commit 993fa5bd37
35 changed files with 1101 additions and 1837 deletions
+2 -1
View File
@@ -693,7 +693,8 @@ protected:
if (_battery_status_sub[i]->update(&_battery_status_timestamp[i], &battery_status)) {
/* battery status message with higher resolution */
mavlink_battery_status_t bat_msg{};
bat_msg.id = i;
// TODO: Determine how to better map between battery ID within the firmware and in MAVLink
bat_msg.id = battery_status.id - 1;
bat_msg.battery_function = MAV_BATTERY_FUNCTION_ALL;
bat_msg.type = MAV_BATTERY_TYPE_LIPO;
bat_msg.current_consumed = (battery_status.connected) ? battery_status.discharged_mah : -1;