Fix for missing battery voltage from UAVCAN power modules (#16138)

It seems that battery.voltage_* is no longer used and QGC is getting voltage data from the cell voltage array instead.
This commit is contained in:
stou-sandalski 2020-11-08 03:34:41 -08:00 committed by GitHub
parent 91d1825fcf
commit 6b23e28971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -95,7 +95,12 @@ UavcanBatteryBridge::battery_sub_cb(const uavcan::ReceivedDataStructure<uavcan::
battery.serial_number = msg.model_instance_id;
battery.id = msg.getSrcNodeID().get();
// battery.voltage_cell_v[0] = msg.;
// Mavlink 2 needs individual cell voltages or cell[0] if cell voltages are not available.
battery.voltage_cell_v[0] = msg.voltage;
// Set cell count to 1 so the the battery code in mavlink_messages.cpp copies the values correctly (hack?)
battery.cell_count = 1;
// battery.max_cell_voltage_delta = msg.;
// battery.is_powering_off = msg.;