mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
GCS_MAVLink: battery2 current is in 10*mAh over mavlink
This commit is contained in:
parent
a8c14e68da
commit
8b405e26ea
@ -1401,7 +1401,13 @@ void GCS_MAVLINK::send_parameter_value_all(const char *param_name, ap_var_type p
|
|||||||
void GCS_MAVLINK::send_battery2(const AP_BattMonitor &battery)
|
void GCS_MAVLINK::send_battery2(const AP_BattMonitor &battery)
|
||||||
{
|
{
|
||||||
if (battery.num_instances() > 1) {
|
if (battery.num_instances() > 1) {
|
||||||
mavlink_msg_battery2_send(chan, battery.voltage(1)*1000, battery.current_amps(1));
|
int16_t current;
|
||||||
|
if (battery.has_current(1)) {
|
||||||
|
current = battery.current_amps(1) * 100; // 10*mA
|
||||||
|
} else {
|
||||||
|
current = -1;
|
||||||
|
}
|
||||||
|
mavlink_msg_battery2_send(chan, battery.voltage(1)*1000, current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user