diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-03-17 03:16:55 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-03-17 03:16:55 -0700 |
commit | 002fb1b4ea90f0cdb7709a3668fb8387b64fcc1e (patch) | |
tree | 4ff254a5da263f9ed6b4fd9e3d3a635cb6c93920 /apps/px4io | |
parent | 0ee5293ceb1231704b2a513b02f0d4c8400598c5 (diff) | |
parent | a0afed400f129eeb43a0cce124459b9c997fbaa6 (diff) | |
download | px4-firmware-002fb1b4ea90f0cdb7709a3668fb8387b64fcc1e.tar.gz px4-firmware-002fb1b4ea90f0cdb7709a3668fb8387b64fcc1e.tar.bz2 px4-firmware-002fb1b4ea90f0cdb7709a3668fb8387b64fcc1e.zip |
Merge pull request #225 from PX4/sign_fix
Fix signs for fixed wing control
Diffstat (limited to 'apps/px4io')
-rw-r--r-- | apps/px4io/controls.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |