[add] throttle high fix for boats and rovers

This commit is contained in:
Tomas Twardzik
2025-02-12 11:10:28 +01:00
parent d4c51ce762
commit 18d823f9e3
2 changed files with 8 additions and 3 deletions
+7 -3
View File
@@ -572,9 +572,12 @@ transition_result_t Commander::arm(arm_disarm_reason_t calling_reason, bool run_
return TRANSITION_DENIED;
}
if (!_vehicle_control_mode.flag_control_climb_rate_enabled &&
!_failsafe_flags.manual_control_signal_lost && !_is_throttle_low
&& _vehicle_status.vehicle_type != vehicle_status_s::VEHICLE_TYPE_ROVER) {
if ((!_failsafe_flags.manual_control_signal_lost) &&
((!_vehicle_control_mode.flag_control_climb_rate_enabled &&
!_is_throttle_low) ||
((_vehicle_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROVER ||
_vehicle_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_BOAT) &&
!_is_throttle_near_center))) {
mavlink_log_critical(&_mavlink_log_pub, "Arming denied: high throttle\t");
events::send(events::ID("commander_arm_denied_throttle_high"), {events::Log::Critical, events::LogInternal::Info},
@@ -2932,6 +2935,7 @@ void Commander::manualControlCheck()
_is_throttle_above_center = (manual_control_setpoint.throttle > 0.2f);
_is_throttle_low = (manual_control_setpoint.throttle < -0.8f);
_is_throttle_near_center = (fabsf(manual_control_setpoint.throttle) < 0.05f);
if (isArmed()) {
// Abort autonomous mode and switch to position mode if sticks are moved significantly
+1
View File
@@ -277,6 +277,7 @@ private:
bool _is_throttle_above_center{false};
bool _is_throttle_low{false};
bool _is_throttle_near_center{false};
bool _arm_tune_played{false};
bool _have_taken_off_since_arming{false};