mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_DroneCAN: populate ESC power percentage
This commit is contained in:
parent
a974f3fd42
commit
8ec3d0f0a9
@ -1447,14 +1447,21 @@ void AP_DroneCAN::handle_ESC_status(const CanardRxTransfer& transfer, const uavc
|
|||||||
.temperature_cdeg = int16_t((KELVIN_TO_C(msg.temperature)) * 100),
|
.temperature_cdeg = int16_t((KELVIN_TO_C(msg.temperature)) * 100),
|
||||||
.voltage = msg.voltage,
|
.voltage = msg.voltage,
|
||||||
.current = msg.current,
|
.current = msg.current,
|
||||||
|
#if AP_EXTENDED_ESC_TELEM_ENABLED
|
||||||
|
.power_percentage = msg.power_rating_pct,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
update_rpm(esc_index, msg.rpm, msg.error_count);
|
update_rpm(esc_index, msg.rpm, msg.error_count);
|
||||||
update_telem_data(esc_index, t,
|
update_telem_data(esc_index, t,
|
||||||
(isnan(msg.current) ? 0 : AP_ESC_Telem_Backend::TelemetryType::CURRENT)
|
(isnan(msg.current) ? 0 : AP_ESC_Telem_Backend::TelemetryType::CURRENT)
|
||||||
| (isnan(msg.voltage) ? 0 : AP_ESC_Telem_Backend::TelemetryType::VOLTAGE)
|
| (isnan(msg.voltage) ? 0 : AP_ESC_Telem_Backend::TelemetryType::VOLTAGE)
|
||||||
| (isnan(msg.temperature) ? 0 : AP_ESC_Telem_Backend::TelemetryType::TEMPERATURE));
|
| (isnan(msg.temperature) ? 0 : AP_ESC_Telem_Backend::TelemetryType::TEMPERATURE)
|
||||||
|
#if AP_EXTENDED_ESC_TELEM_ENABLED
|
||||||
|
| AP_ESC_Telem_Backend::TelemetryType::POWER_PERCENTAGE
|
||||||
#endif
|
#endif
|
||||||
|
);
|
||||||
|
#endif // HAL_WITH_ESC_TELEM
|
||||||
}
|
}
|
||||||
|
|
||||||
#if AP_EXTENDED_ESC_TELEM_ENABLED
|
#if AP_EXTENDED_ESC_TELEM_ENABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user