mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 02:01:37 +08:00
FlightTaskManualPosition: simplify optical flow limiting logic
This commit is contained in:
committed by
Daniel Agar
parent
10e329ce9e
commit
dd05cb3496
@@ -89,10 +89,8 @@ void FlightTaskManualPosition::_scaleSticks()
|
|||||||
float velocity_scale = _param_mpc_vel_manual.get();
|
float velocity_scale = _param_mpc_vel_manual.get();
|
||||||
|
|
||||||
if (PX4_ISFINITE(max_speed_from_estimator)) {
|
if (PX4_ISFINITE(max_speed_from_estimator)) {
|
||||||
// use the minimum of the estimator and user specified limit
|
// Constrain with optical flow limit but leave 0.3 m/s for repositioning
|
||||||
velocity_scale = fminf(velocity_scale, max_speed_from_estimator);
|
velocity_scale = math::constrain(velocity_scale, 0.3f, max_speed_from_estimator);
|
||||||
// Allow for a minimum of 0.3 m/s for repositioning
|
|
||||||
velocity_scale = fmaxf(velocity_scale, 0.3f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// scale velocity to its maximum limits
|
// scale velocity to its maximum limits
|
||||||
|
|||||||
Reference in New Issue
Block a user