mirror of https://github.com/ArduPilot/ardupilot
Rescale TradHeli roll_out and pitch_out into the min and max ranges to provide linear motion across the input range instead of stopping when the input hits the constrain value. These calculations are based on an assumption of the user specified roll_max and pitch_max coming into this equation at 4500 or less, and based on the original assumption of the total g.heli_servo_x.servo_out range being -4500 to 4500.
Signed-off-by: Robert Lefebvre <robert.lefebvre@gmail.com>
This commit is contained in:
parent
ee5e331f3c
commit
e49c2d2871
|
@ -142,6 +142,15 @@ static void heli_move_swash(int roll_out, int pitch_out, int coll_out, int yaw_o
|
||||||
coll_out = constrain(coll_out, 0, 1000);
|
coll_out = constrain(coll_out, 0, 1000);
|
||||||
coll_out_scaled = coll_out * heli_collective_scalar + g.heli_collective_min - 1000;
|
coll_out_scaled = coll_out * heli_collective_scalar + g.heli_collective_min - 1000;
|
||||||
|
|
||||||
|
// rescale roll_out and pitch-out into the min and max ranges to provide linear motion
|
||||||
|
// across the input range instead of stopping when the input hits the constrain value
|
||||||
|
// these calculations are based on an assumption of the user specified roll_max and pitch_max
|
||||||
|
// coming into this equation at 4500 or less, and based on the original assumption of the
|
||||||
|
// total g.heli_servo_x.servo_out range being -4500 to 4500.
|
||||||
|
roll_out = (-g.heli_roll_max + (float)( 2 * g.heli_roll_max * (roll_out + 4500.0)/9000.0));
|
||||||
|
pitch_out = (-g.heli_pitch_max + (float)(2 * g.heli_pitch_max * (pitch_out + 4500.0)/9000.0));
|
||||||
|
|
||||||
|
|
||||||
// rudder feed forward based on collective
|
// rudder feed forward based on collective
|
||||||
#if HIL_MODE == HIL_MODE_DISABLED // don't do rudder feed forward in simulator
|
#if HIL_MODE == HIL_MODE_DISABLED // don't do rudder feed forward in simulator
|
||||||
if( !g.heli_ext_gyro_enabled ) {
|
if( !g.heli_ext_gyro_enabled ) {
|
||||||
|
|
Loading…
Reference in New Issue