Remove horizontal slow down close to ground

Because based on the numerous complaints it was disabled by default
(only velocities above 10m/s were limited)
and since then no one intentionally used it anymore. But
there were some minor investigations of drones not reaching
their maximum speed which always showed 10m/s.
This commit is contained in:
Matthias Grob
2021-06-25 11:15:41 +02:00
committed by Lorenz Meier
parent 055c9db178
commit 5ac5399d83
5 changed files with 4 additions and 40 deletions
@@ -102,8 +102,6 @@ void FlightTaskManualPosition::_scaleSticks()
_velocity_scale = _constraints.speed_xy;
}
_velocity_scale = fminf(_computeVelXYGroundDist(), _velocity_scale);
// scale velocity to its maximum limits
Vector2f vel_sp_xy = stick_xy * _velocity_scale;
@@ -118,20 +116,6 @@ void FlightTaskManualPosition::_scaleSticks()
_velocity_setpoint.xy() = vel_sp_xy;
}
float FlightTaskManualPosition::_computeVelXYGroundDist()
{
float max_vel_xy = _constraints.speed_xy;
// limit speed gradually within the altitudes MPC_LAND_ALT1 and MPC_LAND_ALT2
if (PX4_ISFINITE(_dist_to_ground)) {
max_vel_xy = math::gradual(_dist_to_ground,
_param_mpc_land_alt2.get(), _param_mpc_land_alt1.get(),
_param_mpc_land_vel_xy.get(), _constraints.speed_xy);
}
return max_vel_xy;
}
void FlightTaskManualPosition::_updateXYlock()
{
/* If position lock is not active, position setpoint is set to NAN.*/
@@ -65,12 +65,10 @@ protected:
DEFINE_PARAMETERS_CUSTOM_PARENT(FlightTaskManualAltitude,
(ParamFloat<px4::params::MPC_VEL_MANUAL>) _param_mpc_vel_manual,
(ParamFloat<px4::params::MPC_LAND_VEL_XY>) _param_mpc_land_vel_xy,
(ParamFloat<px4::params::MPC_ACC_HOR_MAX>) _param_mpc_acc_hor_max,
(ParamFloat<px4::params::MPC_HOLD_MAX_XY>) _param_mpc_hold_max_xy
)
private:
float _computeVelXYGroundDist();
float _velocity_scale{0.0f}; //scales the stick input to velocity
uint8_t _reset_counter{0}; /**< counter for estimator resets in xy-direction */