mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 05:23:33 +08:00
fw att control: manual setpoint: fix comment and trim sign
This commit is contained in:
@@ -706,19 +706,20 @@ FixedwingAttitudeControl::task_main()
|
|||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Scale down roll and pitch as the setpoints are radians
|
* Scale down roll and pitch as the setpoints are radians
|
||||||
* and a typical remote can only do 45 degrees, the mapping is
|
* and a typical remote can only do around 45 degrees, the mapping is
|
||||||
* -1..+1 to -45..+45 degrees or -0.75..+0.75 radians.
|
* -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
|
* With this mapping the stick angle is a 1:1 representation of
|
||||||
* the commanded attitude. If more than 45 degrees are desired,
|
* the commanded attitude.
|
||||||
* a scaling parameter can be applied to the remote.
|
|
||||||
*
|
*
|
||||||
* The trim gets subtracted here from the manual setpoint to get
|
* The trim gets subtracted here from the manual setpoint to get
|
||||||
* the intended attitude setpoint. Later, after the rate control step the
|
* the intended attitude setpoint. Later, after the rate control step the
|
||||||
* trim is added again to the control signal.
|
* trim is added again to the control signal.
|
||||||
*/
|
*/
|
||||||
roll_sp = (_manual.roll * _parameters.man_roll_max - _parameters.trim_roll) + _parameters.rollsp_offset_rad;
|
roll_sp = (_manual.roll * _parameters.man_roll_max - _parameters.trim_roll)
|
||||||
pitch_sp = (-_manual.pitch * _parameters.man_pitch_max - _parameters.trim_pitch) + _parameters.pitchsp_offset_rad;
|
+ _parameters.rollsp_offset_rad;
|
||||||
|
pitch_sp = -(_manual.pitch * _parameters.man_pitch_max - _parameters.trim_pitch)
|
||||||
|
+ _parameters.pitchsp_offset_rad;
|
||||||
throttle_sp = _manual.throttle;
|
throttle_sp = _manual.throttle;
|
||||||
_actuators.control[4] = _manual.flaps;
|
_actuators.control[4] = _manual.flaps;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user