mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
FlightTaskManualPosition: simplify optical flow limiting logic
This commit is contained in:
parent
10e329ce9e
commit
dd05cb3496
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user