AP_L1_Control: Simplify the decision process by initializing the stack variables

This commit is contained in:
murata 2021-11-14 18:14:04 +09:00 committed by Tom Pittenger
parent 9c329a95b6
commit 23253d0d26

View File

@ -141,10 +141,8 @@ float AP_L1_Control::loiter_radius(const float radius) const
float sanitized_bank_limit = constrain_float(_loiter_bank_limit, 0.0f, 89.0f);
float lateral_accel_sea_level = tanf(radians(sanitized_bank_limit)) * GRAVITY_MSS;
float nominal_velocity_sea_level;
if(_tecs == nullptr) {
nominal_velocity_sea_level = 0.0f;
} else {
float nominal_velocity_sea_level = 0.0f;
if(_tecs != nullptr) {
nominal_velocity_sea_level = _tecs->get_target_airspeed();
}