aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-03-16 23:41:24 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-03-16 23:41:24 +0100
commita0afed400f129eeb43a0cce124459b9c997fbaa6 (patch)
tree230a813816d0763854f15cf66d0863aa9c79b250 /apps
parent1b16387a996dcad53c3179b053162f7fee543254 (diff)
downloadpx4-firmware-a0afed400f129eeb43a0cce124459b9c997fbaa6.tar.gz
px4-firmware-a0afed400f129eeb43a0cce124459b9c997fbaa6.tar.bz2
px4-firmware-a0afed400f129eeb43a0cce124459b9c997fbaa6.zip
Fix signs for fixed wing control, issue resulted from consistently flipped pitch response for IO and FMU
Diffstat (limited to 'apps')
-rw-r--r--apps/controllib/fixedwing.cpp4
-rw-r--r--apps/px4io/controls.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/controllib/fixedwing.cpp b/apps/controllib/fixedwing.cpp
index b84a54fee..9ab534522 100644
--- a/apps/controllib/fixedwing.cpp
+++ b/apps/controllib/fixedwing.cpp
@@ -323,7 +323,7 @@ void BlockMultiModeBacksideAutopilot::update()
_att.rollspeed, _att.pitchspeed, _att.yawspeed
);
_actuators.control[CH_AIL] = _backsideAutopilot.getAileron();
- _actuators.control[CH_ELV] = - _backsideAutopilot.getElevator();
+ _actuators.control[CH_ELV] = _backsideAutopilot.getElevator();
_actuators.control[CH_RDR] = _backsideAutopilot.getRudder();
_actuators.control[CH_THR] = _backsideAutopilot.getThrottle();
@@ -355,7 +355,7 @@ void BlockMultiModeBacksideAutopilot::update()
_att.rollspeed, _att.pitchspeed, _att.yawspeed);
_actuators.control[CH_AIL] = _stabilization.getAileron();
- _actuators.control[CH_ELV] = - _stabilization.getElevator();
+ _actuators.control[CH_ELV] = _stabilization.getElevator();
_actuators.control[CH_RDR] = _stabilization.getRudder();
_actuators.control[CH_THR] = _manual.throttle;
}
diff --git a/apps/px4io/controls.c b/apps/px4io/controls.c
index b507078a1..e80a41f15 100644
--- a/apps/px4io/controls.c
+++ b/apps/px4io/controls.c
@@ -192,6 +192,10 @@ controls_tick() {
unsigned mapped = conf[PX4IO_P_RC_CONFIG_ASSIGNMENT];
ASSERT(mapped < MAX_CONTROL_CHANNELS);
+ /* invert channel if pitch - pulling the lever down means pitching up by convention */
+ if (mapped == 1) /* roll, pitch, yaw, throttle, override is the standard order */
+ scaled = -scaled;
+
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
assigned_channels |= (1 << mapped);
}