mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 06:23:34 +08:00
Takeoff: remove updateRamp() early return
This commit is contained in:
@@ -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 Takeoff::updateRamp(const float dt, const float takeoff_desired_vz)
|
||||||
{
|
{
|
||||||
|
float upwards_velocity_limit = takeoff_desired_vz;
|
||||||
|
|
||||||
if (_takeoff_state < TakeoffState::rampup) {
|
if (_takeoff_state < TakeoffState::rampup) {
|
||||||
return _takeoff_ramp_vz_init;
|
upwards_velocity_limit = _takeoff_ramp_vz_init;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_takeoff_state == TakeoffState::rampup) {
|
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) {
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user