From 70eecf6070e3f529ddbf7aaf74ce082b335845b8 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Thu, 15 May 2025 16:41:44 +0200 Subject: [PATCH] FailureDetector: adhere to the parameter naming convention --- .../commander/failure_detector/FailureDetector.cpp | 8 ++++---- .../commander/failure_detector/FailureDetector.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/commander/failure_detector/FailureDetector.cpp b/src/modules/commander/failure_detector/FailureDetector.cpp index 2cf3608e5b..dfd0a0daef 100644 --- a/src/modules/commander/failure_detector/FailureDetector.cpp +++ b/src/modules/commander/failure_detector/FailureDetector.cpp @@ -77,7 +77,7 @@ bool FailureDetector::update(const vehicle_status_s &vehicle_status, const vehic updateEscsStatus(vehicle_status, esc_status); } - if (_param_fd_actuator_en.get()) { + if (_param_fd_act_en.get()) { updateMotorStatus(vehicle_status, esc_status); } } @@ -306,9 +306,9 @@ void FailureDetector::updateMotorStatus(const vehicle_status_s &vehicle_status, esc_throttle = fabsf(actuator_motors.control[i_esc]); } - const bool throttle_above_threshold = esc_throttle > _param_fd_motor_throttle_thres.get(); + const bool throttle_above_threshold = esc_throttle > _param_fd_act_mot_thr.get(); const bool current_too_low = cur_esc_report.esc_current < esc_throttle * - _param_fd_motor_current2throttle_thres.get(); + _param_fd_act_mot_c2t.get(); if (throttle_above_threshold && current_too_low && !esc_timed_out) { if (_motor_failure_undercurrent_start_time[i_esc] == 0) { @@ -322,7 +322,7 @@ void FailureDetector::updateMotorStatus(const vehicle_status_s &vehicle_status, } if (_motor_failure_undercurrent_start_time[i_esc] != 0 - && now > (_motor_failure_undercurrent_start_time[i_esc] + (_param_fd_motor_time_thres.get() * 1_ms)) + && now > (_motor_failure_undercurrent_start_time[i_esc] + (_param_fd_act_mot_tout.get() * 1_ms)) && (_motor_failure_esc_under_current_mask & (1 << i_esc)) == 0) { // Set flag _motor_failure_esc_under_current_mask |= (1 << i_esc); diff --git a/src/modules/commander/failure_detector/FailureDetector.hpp b/src/modules/commander/failure_detector/FailureDetector.hpp index d84581ca5e..4a77f49df8 100644 --- a/src/modules/commander/failure_detector/FailureDetector.hpp +++ b/src/modules/commander/failure_detector/FailureDetector.hpp @@ -137,9 +137,9 @@ private: (ParamInt) _param_fd_imb_prop_thr, // Actuator failure - (ParamBool) _param_fd_actuator_en, - (ParamFloat) _param_fd_motor_throttle_thres, - (ParamFloat) _param_fd_motor_current2throttle_thres, - (ParamInt) _param_fd_motor_time_thres + (ParamBool) _param_fd_act_en, + (ParamFloat) _param_fd_act_mot_thr, + (ParamFloat) _param_fd_act_mot_c2t, + (ParamInt) _param_fd_act_mot_tout ) };