mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
GCS_MAVLink: send GCS voltage to GCS
may be resting voltage of option enabled
This commit is contained in:
parent
d900eeac50
commit
9105c931b5
@ -244,7 +244,7 @@ void GCS_MAVLINK::send_battery_status(const uint8_t instance) const
|
|||||||
// for battery monitors that cannot provide voltages for individual cells the battery's total voltage is put into the first cell
|
// for battery monitors that cannot provide voltages for individual cells the battery's total voltage is put into the first cell
|
||||||
// if the total voltage cannot fit into a single field, the remainder into subsequent fields.
|
// if the total voltage cannot fit into a single field, the remainder into subsequent fields.
|
||||||
// the GCS can then recover the pack voltage by summing all non ignored cell values an we can report a pack up to 655.34 V
|
// the GCS can then recover the pack voltage by summing all non ignored cell values an we can report a pack up to 655.34 V
|
||||||
float voltage = battery.voltage(instance) * 1e3f;
|
float voltage = battery.gcs_voltage(instance) * 1e3f;
|
||||||
for (uint8_t i = 0; i < MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN; i++) {
|
for (uint8_t i = 0; i < MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN; i++) {
|
||||||
if (voltage < 0.001f) {
|
if (voltage < 0.001f) {
|
||||||
// too small to send to the GCS, set it to the no cell value
|
// too small to send to the GCS, set it to the no cell value
|
||||||
@ -4894,7 +4894,7 @@ void GCS_MAVLINK::send_sys_status()
|
|||||||
control_sensors_health,
|
control_sensors_health,
|
||||||
static_cast<uint16_t>(AP::scheduler().load_average() * 1000),
|
static_cast<uint16_t>(AP::scheduler().load_average() * 1000),
|
||||||
#if !defined(HAL_BUILD_AP_PERIPH) || defined(HAL_PERIPH_ENABLE_BATTERY)
|
#if !defined(HAL_BUILD_AP_PERIPH) || defined(HAL_PERIPH_ENABLE_BATTERY)
|
||||||
battery.voltage() * 1000, // mV
|
battery.gcs_voltage() * 1000, // mV
|
||||||
battery_current, // in 10mA units
|
battery_current, // in 10mA units
|
||||||
battery_remaining, // in %
|
battery_remaining, // in %
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user