From 6854b14dd6f0d6f7445db97ff5fb31ef00844d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 14 Oct 2019 13:39:34 +0200 Subject: [PATCH] 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%. --- msg/esc_report.msg | 4 +--- .../df_bebop_bus_wrapper/df_bebop_bus_wrapper.cpp | 1 - src/drivers/mkblctrl/mkblctrl.cpp | 10 ---------- src/drivers/uavcan/actuators/esc.cpp | 2 -- 4 files changed, 1 insertion(+), 16 deletions(-) diff --git a/msg/esc_report.msg b/msg/esc_report.msg index 8aaadb39f9..a31230586d 100644 --- a/msg/esc_report.msg +++ b/msg/esc_report.msg @@ -4,7 +4,5 @@ int32 esc_rpm # Motor RPM, negative for reverse rotation [RPM] - if support float32 esc_voltage # Voltage measured from current ESC [V] - if supported float32 esc_current # Current measured from current ESC [A] - if supported uint8 esc_temperature # Temperature measured from current ESC [degC] - if supported -float32 esc_setpoint # setpoint of current ESC -uint16 esc_setpoint_raw # setpoint of current ESC (Value sent to ESC) -uint16 esc_address # Address of current ESC (in most cases 1-8 / must be set by driver) +uint8 esc_address # Address of current ESC (in most cases 1-8 / must be set by driver) uint8 esc_state # State of ESC - depend on Vendor diff --git a/src/drivers/driver_framework_wrapper/df_bebop_bus_wrapper/df_bebop_bus_wrapper.cpp b/src/drivers/driver_framework_wrapper/df_bebop_bus_wrapper/df_bebop_bus_wrapper.cpp index 172ae94657..548b537f6d 100644 --- a/src/drivers/driver_framework_wrapper/df_bebop_bus_wrapper/df_bebop_bus_wrapper.cpp +++ b/src/drivers/driver_framework_wrapper/df_bebop_bus_wrapper/df_bebop_bus_wrapper.cpp @@ -219,7 +219,6 @@ int DfBebopBusWrapper::_publish(struct bebop_state_data &data) for (int i = 0; i < 4; i++) { esc_status.esc[_esc_map[i]].timestamp = esc_status.timestamp; esc_status.esc[_esc_map[i]].esc_rpm = data.rpm[i]; - esc_status.esc[_esc_map[i]].esc_setpoint_raw = esc_speed_setpoint_rpm[i]; } // TODO: when is this ever blocked? diff --git a/src/drivers/mkblctrl/mkblctrl.cpp b/src/drivers/mkblctrl/mkblctrl.cpp index a20a1dc36c..b58fc98324 100644 --- a/src/drivers/mkblctrl/mkblctrl.cpp +++ b/src/drivers/mkblctrl/mkblctrl.cpp @@ -617,16 +617,6 @@ MK::task_main() esc.esc[i].esc_voltage = 0.0F; esc.esc[i].esc_current = static_cast(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(Motor[i].Temperature); esc.esc[i].esc_state = (uint8_t) Motor[i].State; diff --git a/src/drivers/uavcan/actuators/esc.cpp b/src/drivers/uavcan/actuators/esc.cpp index 61683a6cdb..ac67f00fc0 100644 --- a/src/drivers/uavcan/actuators/esc.cpp +++ b/src/drivers/uavcan/actuators/esc.cpp @@ -129,7 +129,6 @@ UavcanEscController::update_outputs(float *outputs, unsigned num_outputs) msg.cmd.push_back(static_cast(scaled)); - _esc_status.esc[i].esc_setpoint_raw = abs(static_cast(scaled)); actuator_outputs.output[i] = scaled; } else { @@ -201,7 +200,6 @@ UavcanEscController::esc_status_sub_cb(const uavcan::ReceivedDataStructure