mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 08:13:34 +08:00
refactor(msg): remove esc_address from EscReport
This commit is contained in:
committed by
Matthias Grob
parent
aeb71cc8b4
commit
8765275b5d
@@ -80,7 +80,6 @@ void VertiqTelemetryManager::StartPublishing(uORB::Publication<esc_status_s> *es
|
||||
|
||||
for (unsigned i = 0; i < _number_of_module_ids_for_telem; i++) {
|
||||
_esc_status.esc[i].timestamp = 0;
|
||||
_esc_status.esc[i].esc_address = 0;
|
||||
_esc_status.esc[i].esc_rpm = 0;
|
||||
_esc_status.esc[i].esc_state = 0;
|
||||
_esc_status.esc[i].esc_voltage = 0;
|
||||
@@ -111,7 +110,6 @@ uint16_t VertiqTelemetryManager::UpdateTelemetry()
|
||||
IFCITelemetryData telem_response = _telem_interface.telemetry_.get_reply();
|
||||
|
||||
// also update our internal report for logging
|
||||
_esc_status.esc[_current_module_id_target_index].esc_address = _module_ids_in_use[_number_of_module_ids_for_telem];
|
||||
_esc_status.esc[_current_module_id_target_index].timestamp = time_now;
|
||||
_esc_status.esc[_current_module_id_target_index].esc_rpm = telem_response.speed * 60.0f * M_1_PI_F *
|
||||
0.5f; //We get back rad/s, convert to rpm
|
||||
|
||||
@@ -63,7 +63,6 @@ VoxlEsc::VoxlEsc() :
|
||||
|
||||
for (unsigned i = 0; i < VOXL_ESC_OUTPUT_CHANNELS; i++) {
|
||||
_esc_status.esc[i].timestamp = 0;
|
||||
_esc_status.esc[i].esc_address = 0;
|
||||
_esc_status.esc[i].esc_rpm = 0;
|
||||
_esc_status.esc[i].esc_state = 0;
|
||||
_esc_status.esc[i].esc_voltage = 0;
|
||||
@@ -520,7 +519,6 @@ int VoxlEsc::parse_response(uint8_t *buf, uint8_t len, bool print_feedback)
|
||||
_esc_chans[id].feedback_time = tnow;
|
||||
|
||||
// also update our internal report for logging
|
||||
_esc_status.esc[id].esc_address = motor_idx + 1; //remapped motor ID
|
||||
_esc_status.esc[id].timestamp = tnow;
|
||||
_esc_status.esc[id].esc_rpm = fb.rpm;
|
||||
_esc_status.esc[id].esc_power = fb.power;
|
||||
@@ -559,14 +557,6 @@ int VoxlEsc::parse_response(uint8_t *buf, uint8_t len, bool print_feedback)
|
||||
}
|
||||
|
||||
|
||||
//print ESC status just for debugging
|
||||
/*
|
||||
PX4_INFO("[%lld] ID=%d, ADDR %d, STATE=%d, RPM=%5d, PWR=%3d%%, V=%.2fdV, I=%.2fA, T=%+3dC, FAIL %d",
|
||||
_esc_status.esc[id].timestamp, id, _esc_status.esc[id].esc_address,
|
||||
_esc_status.esc[id].esc_state, _esc_status.esc[id].esc_rpm, _esc_status.esc[id].esc_power,
|
||||
(double)_esc_status.esc[id].esc_voltage, (double)_esc_status.esc[id].esc_current, _esc_status.esc[id].esc_temperature,
|
||||
_esc_status.esc[id].failures);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user