|
|
|
@ -89,10 +89,8 @@ void FlightTaskManualPosition::_scaleSticks()
@@ -89,10 +89,8 @@ void FlightTaskManualPosition::_scaleSticks()
|
|
|
|
|
float velocity_scale = _param_mpc_vel_manual.get(); |
|
|
|
|
|
|
|
|
|
if (PX4_ISFINITE(max_speed_from_estimator)) { |
|
|
|
|
// use the minimum of the estimator and user specified limit
|
|
|
|
|
velocity_scale = fminf(velocity_scale, max_speed_from_estimator); |
|
|
|
|
// Allow for a minimum of 0.3 m/s for repositioning
|
|
|
|
|
velocity_scale = fmaxf(velocity_scale, 0.3f); |
|
|
|
|
// Constrain with optical flow limit but leave 0.3 m/s for repositioning
|
|
|
|
|
velocity_scale = math::constrain(velocity_scale, 0.3f, max_speed_from_estimator); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// scale velocity to its maximum limits
|
|
|
|
|