From 45cd05b57a7e3aa1bb288b402ee5437c35d688d3 Mon Sep 17 00:00:00 2001 From: tumbili Date: Wed, 10 Jun 2015 17:06:42 +0200 Subject: [PATCH] invert pitch trim parameter --- src/modules/commander/rc_calibration.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/commander/rc_calibration.cpp b/src/modules/commander/rc_calibration.cpp index 6ddd734931..08261c9890 100644 --- a/src/modules/commander/rc_calibration.cpp +++ b/src/modules/commander/rc_calibration.cpp @@ -71,7 +71,11 @@ int do_trim_calibration(int mavlink_fd) /* set parameters */ float p = sp.y; int p1r = param_set(param_find("TRIM_ROLL"), &p); - p = sp.x; + /* + we explicitly swap sign here because the trim is added to the actuator controls + which are moving in an inverse sense to manual pitch inputs + */ + p = -sp.x; int p2r = param_set(param_find("TRIM_PITCH"), &p); p = sp.r; int p3r = param_set(param_find("TRIM_YAW"), &p);