StickAccelerationXY: brake a bit faster

The drag is based on max_acc/max_vel, which means that increasing the
maximum velocity leads to slower braking (at the same starting speed).

Especially a combination of small max_acc (slow responsiveness) with high
max_vel led to an exceedingly high braking distance.
This improves that while still being smooth.
This commit is contained in:
Beat Küng
2021-02-05 10:11:55 +01:00
committed by Lorenz Meier
parent 1be4163506
commit 836c7c6575

View File

@@ -123,7 +123,7 @@ Vector2f StickAccelerationXY::calculateDrag(Vector2f drag_coefficient, const flo
_brake_boost_filter.setParameters(dt, .8f);
if (stick_xy.norm_squared() < FLT_EPSILON) {
_brake_boost_filter.update(2.f);
_brake_boost_filter.update(math::max(2.f, sqrtf(_param_mpc_vel_manual.get())));
} else {
_brake_boost_filter.update(1.f);