From 950dcf924235f499513efe5a72f8e51abaddc9a7 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sun, 29 Aug 2021 12:52:24 +0100 Subject: [PATCH] AP_MotorsUGV: ignore servo reverse when setting trim for brushed with relay --- libraries/AR_Motors/AP_MotorsUGV.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/AR_Motors/AP_MotorsUGV.cpp b/libraries/AR_Motors/AP_MotorsUGV.cpp index 1a6f3ab7f5..fb62e007c2 100644 --- a/libraries/AR_Motors/AP_MotorsUGV.cpp +++ b/libraries/AR_Motors/AP_MotorsUGV.cpp @@ -145,9 +145,10 @@ void AP_MotorsUGV::setup_safety_output() { if (_pwm_type == PWM_TYPE_BRUSHED_WITH_RELAY) { // set trim to min to set duty cycle range (0 - 100%) to servo range - SRV_Channels::set_trim_to_min_for(SRV_Channel::k_throttle); - SRV_Channels::set_trim_to_min_for(SRV_Channel::k_throttleLeft); - SRV_Channels::set_trim_to_min_for(SRV_Channel::k_throttleRight); + // ignore servo revese flag, it is used by the relay + SRV_Channels::set_trim_to_min_for(SRV_Channel::k_throttle, true); + SRV_Channels::set_trim_to_min_for(SRV_Channel::k_throttleLeft, true); + SRV_Channels::set_trim_to_min_for(SRV_Channel::k_throttleRight, true); } // stop sending pwm if main CPU fails