Commit 43ad0f56 authored by Don Gagne's avatar Don Gagne

Change battery.current to float with 2 decimal places

parent 36ce0c1d
......@@ -23,8 +23,8 @@
{
"name": "current",
"shortDescription": "Current",
"type": "int32",
"decimalPlaces": 0,
"type": "float",
"decimalPlaces": 2,
"units": "A"
},
{
......
......@@ -714,7 +714,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message)
_batteryFactGroup.current()->setRawValue(VehicleBatteryFactGroup::_currentUnavailable);
} else {
// Current is in Amps, current_battery is 10 * milliamperes (1 = 10 milliampere)
_batteryFactGroup.current()->setRawValue((int)(sysStatus.current_battery / 100));
_batteryFactGroup.current()->setRawValue((float)sysStatus.current_battery / 100.0f);
}
if (sysStatus.voltage_battery == UINT16_MAX) {
_batteryFactGroup.voltage()->setRawValue(VehicleBatteryFactGroup::_voltageUnavailable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment