diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-13 00:04:46 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-13 00:04:46 -0700 |
commit | 80ecaf7946d39abe44dd3b45590e2c73004b4fda (patch) | |
tree | 6dc58f5b6cbd71865f5bd92f00526e638b1f9fe6 | |
parent | 965b42fe96aad5d9ae50832e9ed6b6ef45e6461e (diff) | |
parent | bafa344dcb2e7b7612f6db4198d87f2fc37c4366 (diff) | |
download | px4-firmware-80ecaf7946d39abe44dd3b45590e2c73004b4fda.tar.gz px4-firmware-80ecaf7946d39abe44dd3b45590e2c73004b4fda.tar.bz2 px4-firmware-80ecaf7946d39abe44dd3b45590e2c73004b4fda.zip |
Merge pull request #931 from PX4/fwtrim
fw att control: manual setpoint: fix comment and trim sign
-rw-r--r-- | src/modules/fw_att_control/fw_att_control_main.cpp | 13 |
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 a40c402d6..654b7d56b 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.roll * _parameters.man_roll_max - _parameters.trim_roll) + _parameters.rollsp_offset_rad; - pitch_sp = (-_manual.pitch * _parameters.man_pitch_max - _parameters.trim_pitch) + _parameters.pitchsp_offset_rad; + roll_sp = (_manual.roll * _parameters.man_roll_max - _parameters.trim_roll) + + _parameters.rollsp_offset_rad; + pitch_sp = -(_manual.pitch * _parameters.man_pitch_max - _parameters.trim_pitch) + + _parameters.pitchsp_offset_rad; throttle_sp = _manual.throttle; _actuators.control[4] = _manual.flaps; |