Copter: acro_level_mix becomes local variable
Coverity uncovered this as an uninitialised member defect
This commit is contained in:
parent
d366c30358
commit
a0d97f1160
@ -343,9 +343,6 @@ private:
|
||||
float throttle_average; // estimated throttle required to hover
|
||||
int16_t desired_climb_rate; // pilot desired climb rate - for logging purposes only
|
||||
|
||||
// ACRO Mode
|
||||
float acro_level_mix; // scales back roll, pitch and yaw inversely proportional to input from pilot
|
||||
|
||||
// Loiter control
|
||||
uint16_t loiter_time_max; // How long we should stay in Loiter Mode for mission scripting (time in seconds)
|
||||
uint32_t loiter_time; // How long have we been loitering - The start time in millis
|
||||
|
@ -123,7 +123,7 @@ void Copter::get_pilot_desired_angle_rates(int16_t roll_in, int16_t pitch_in, in
|
||||
rate_bf_request.y += rate_bf_level.y;
|
||||
rate_bf_request.z += rate_bf_level.z;
|
||||
}else{
|
||||
acro_level_mix = constrain_float(1-max(max(abs(roll_in), abs(pitch_in)), abs(yaw_in))/4500.0, 0, 1)*ahrs.cos_pitch();
|
||||
float acro_level_mix = constrain_float(1-max(max(abs(roll_in), abs(pitch_in)), abs(yaw_in))/4500.0, 0, 1)*ahrs.cos_pitch();
|
||||
|
||||
// Scale leveling rates by stick input
|
||||
rate_bf_level = rate_bf_level*acro_level_mix;
|
||||
|
Loading…
Reference in New Issue
Block a user