mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
Acro fix - we had lost the scaling of Acro mode in 2.1. This restores that.
This commit is contained in:
parent
18e994de4f
commit
f3547a04a5
@ -1415,8 +1415,8 @@ void update_roll_pitch_mode(void)
|
||||
switch(roll_pitch_mode){
|
||||
case ROLL_PITCH_ACRO:
|
||||
// ACRO does not get SIMPLE mode ability
|
||||
g.rc_1.servo_out = get_rate_roll(g.rc_1.control_in);
|
||||
g.rc_2.servo_out = get_rate_pitch(g.rc_2.control_in);
|
||||
g.rc_1.servo_out = get_acro_roll(g.rc_1.control_in);
|
||||
g.rc_2.servo_out = get_acro_pitch(g.rc_2.control_in);
|
||||
break;
|
||||
|
||||
case ROLL_PITCH_STABLE:
|
||||
|
@ -80,6 +80,22 @@ get_stabilize_yaw(int32_t target_angle)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
get_acro_roll(int32_t target_rate)
|
||||
{
|
||||
target_rate = target_rate * g.pi_stabilize_roll.kP();
|
||||
target_rate = constrain(target_rate, -10000, 10000);
|
||||
return get_rate_roll(target_rate);
|
||||
}
|
||||
|
||||
static int
|
||||
get_acro_pitch(int32_t target_rate)
|
||||
{
|
||||
target_rate = target_rate * g.pi_stabilize_pitch.kP();
|
||||
target_rate = constrain(target_rate, -10000, 10000);
|
||||
return get_rate_pitch(target_rate);
|
||||
}
|
||||
|
||||
static int
|
||||
get_rate_roll(int32_t target_rate)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user