aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_att_control/fw_att_control_main.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-05-13 09:28:46 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-05-13 09:28:46 +0200
commit8f6cd3a3ae58e1c1190dc8adb5169871b99ce5e9 (patch)
tree15c234a3c0fd0ec8d5797b43a2f0f45a538fad27 /src/modules/fw_att_control/fw_att_control_main.cpp
parent15699549a21e08e9bf384dba7a1b65d092f1cb9a (diff)
parent80ecaf7946d39abe44dd3b45590e2c73004b4fda (diff)
downloadpx4-firmware-8f6cd3a3ae58e1c1190dc8adb5169871b99ce5e9.tar.gz
px4-firmware-8f6cd3a3ae58e1c1190dc8adb5169871b99ce5e9.tar.bz2
px4-firmware-8f6cd3a3ae58e1c1190dc8adb5169871b99ce5e9.zip
Merge remote-tracking branch 'upstream/master' into manualcontrolrename
Conflicts: src/modules/fw_att_control/fw_att_control_main.cpp
Diffstat (limited to 'src/modules/fw_att_control/fw_att_control_main.cpp')
-rw-r--r--src/modules/fw_att_control/fw_att_control_main.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp
index 7b2d1e249..1c411fa06 100644
--- a/src/modules/fw_att_control/fw_att_control_main.cpp
+++ b/src/modules/fw_att_control/fw_att_control_main.cpp
@@ -706,19 +706,20 @@ FixedwingAttitudeControl::task_main()
} else {
/*
* Scale down roll and pitch as the setpoints are radians
- * and a typical remote can only do 45 degrees, the mapping is
- * -1..+1 to -45..+45 degrees or -0.75..+0.75 radians.
+ * and a typical remote can only do around 45 degrees, the mapping is
+ * -1..+1 to -man_roll_max rad..+man_roll_max rad (equivalent for pitch)
*
* With this mapping the stick angle is a 1:1 representation of
- * the commanded attitude. If more than 45 degrees are desired,
- * a scaling parameter can be applied to the remote.
+ * the commanded attitude.
*
* The trim gets subtracted here from the manual setpoint to get
* the intended attitude setpoint. Later, after the rate control step the
* trim is added again to the control signal.
*/
- roll_sp = (_manual.y * _parameters.man_roll_max - _parameters.trim_roll) + _parameters.rollsp_offset_rad;
- pitch_sp = (-_manual.x * _parameters.man_pitch_max - _parameters.trim_pitch) + _parameters.pitchsp_offset_rad;
+ roll_sp = (_manual.y * _parameters.man_roll_max - _parameters.trim_roll)
+ + _parameters.rollsp_offset_rad;
+ pitch_sp = -(_manual.x * _parameters.man_pitch_max - _parameters.trim_pitch)
+ + _parameters.pitchsp_offset_rad;
throttle_sp = _manual.z;
_actuators.control[4] = _manual.flaps;