AP_L1_Control: Simplify the decision process by initializing the stack variables
This commit is contained in:
parent
9c329a95b6
commit
23253d0d26
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user