mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 12:54:07 +08:00
Takeoff: remove updateRamp() early return
This commit is contained in:
parent
b7600f4e4d
commit
8ca76feaba
@ -111,8 +111,10 @@ void Takeoff::updateTakeoffState(const bool armed, const bool landed, const bool
|
||||
|
||||
float Takeoff::updateRamp(const float dt, const float takeoff_desired_vz)
|
||||
{
|
||||
float upwards_velocity_limit = takeoff_desired_vz;
|
||||
|
||||
if (_takeoff_state < TakeoffState::rampup) {
|
||||
return _takeoff_ramp_vz_init;
|
||||
upwards_velocity_limit = _takeoff_ramp_vz_init;
|
||||
}
|
||||
|
||||
if (_takeoff_state == TakeoffState::rampup) {
|
||||
@ -124,9 +126,9 @@ float Takeoff::updateRamp(const float dt, const float takeoff_desired_vz)
|
||||
}
|
||||
|
||||
if (_takeoff_ramp_vz < takeoff_desired_vz) {
|
||||
return _takeoff_ramp_vz;
|
||||
upwards_velocity_limit = _takeoff_ramp_vz;
|
||||
}
|
||||
}
|
||||
|
||||
return takeoff_desired_vz;
|
||||
return upwards_velocity_limit;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user