mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-12 01:45:34 +08:00
esc_report: remove unused fields to reduce message size
esc_setpoint in UAVCAN was just wrong, this is what it really is: uint7 power_rating_pct # Instant demand factor in percent (percent of maximum power); range 0% to 127%.
This commit is contained in:
@@ -617,16 +617,6 @@ MK::task_main()
|
||||
esc.esc[i].esc_voltage = 0.0F;
|
||||
esc.esc[i].esc_current = static_cast<float>(Motor[i].Current) * 0.1F;
|
||||
esc.esc[i].esc_rpm = (uint16_t) 0;
|
||||
esc.esc[i].esc_setpoint = (float) Motor[i].SetPoint_PX4;
|
||||
|
||||
if (Motor[i].Version == 1) {
|
||||
// BLCtrl 2.0 (11Bit)
|
||||
esc.esc[i].esc_setpoint_raw = (uint16_t)(Motor[i].SetPoint << 3) | Motor[i].SetPointLowerBits;
|
||||
|
||||
} else {
|
||||
// BLCtrl < 2.0 (8Bit)
|
||||
esc.esc[i].esc_setpoint_raw = (uint16_t) Motor[i].SetPoint;
|
||||
}
|
||||
|
||||
esc.esc[i].esc_temperature = static_cast<uint8_t>(Motor[i].Temperature);
|
||||
esc.esc[i].esc_state = (uint8_t) Motor[i].State;
|
||||
|
||||
Reference in New Issue
Block a user