From 70784e83d7e7777f600b185f6bae5da17a805926 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 e475328566..9848153bd2 100644 --- a/src/modules/commander/failure_detector/FailureDetector.cpp +++ b/src/modules/commander/failure_detector/FailureDetector.cpp @@ -194,7 +194,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); } } @@ -426,9 +426,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) { @@ -442,7 +442,7 @@ void FailureDetector::updateMotorStatus(const vehicle_status_s &vehicle_status, } if (_motor_failure_undercurrent_start_time[i_esc] != 0 - && (time_now - _motor_failure_undercurrent_start_time[i_esc]) > _param_fd_motor_time_thres.get() * 1_ms + && (time_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 e89719d2aa..4bbe59f047 100644 --- a/src/modules/commander/failure_detector/FailureDetector.hpp +++ b/src/modules/commander/failure_detector/FailureDetector.hpp @@ -152,9 +152,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 ) };