From 0577af2e944a0f53919aeb1367d580f744004b2c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 28 May 2015 17:38:55 -0700 Subject: [PATCH] Hotfix for sprung-loaded throttles and RC calibration: Enforce correct trim value --- src/AutoPilotPlugins/PX4/RadioComponentController.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/AutoPilotPlugins/PX4/RadioComponentController.cc b/src/AutoPilotPlugins/PX4/RadioComponentController.cc index 914c706f5..e642f84cc 100644 --- a/src/AutoPilotPlugins/PX4/RadioComponentController.cc +++ b/src/AutoPilotPlugins/PX4/RadioComponentController.cc @@ -428,6 +428,13 @@ void RadioComponentController::_inputStickMin(enum rcCalFunctions function, int } else { _rgChannelInfo[channel].rcMin = value; } + + // Check if this is throttle and set trim accordingly + if (function == rcCalFunctionThrottle) { + _rgChannelInfo[channel].rcTrim = value; + } + // XXX to support configs which can reverse they need to check a reverse + // flag here and not do this. _advanceState(); } -- 2.22.0