Browse Source

Merge pull request #4298 from DonLakeFlyer/Vehicle.Battery.Current

Change Vehicle.Battery.current to Amps units
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
064be228a9
  1. 2
      src/Vehicle/BatteryFact.json
  2. 3
      src/Vehicle/Vehicle.cc

2
src/Vehicle/BatteryFact.json

@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
"shortDescription": "Current",
"type": "int32",
"decimalPlaces": 0,
"units": "mA"
"units": "A"
},
{
"name": "temperature",

3
src/Vehicle/Vehicle.cc

@ -657,7 +657,8 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message) @@ -657,7 +657,8 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message)
if (sysStatus.current_battery == -1) {
_batteryFactGroup.current()->setRawValue(VehicleBatteryFactGroup::_currentUnavailable);
} else {
_batteryFactGroup.current()->setRawValue((double)sysStatus.current_battery * 10);
// Current is in Amps, current_battery is 10 * milliamperes (1 = 10 milliampere)
_batteryFactGroup.current()->setRawValue((int)(sysStatus.current_battery / 100));
}
if (sysStatus.voltage_battery == UINT16_MAX) {
_batteryFactGroup.voltage()->setRawValue(VehicleBatteryFactGroup::_voltageUnavailable);

Loading…
Cancel
Save