StickAccelerationXY: boost low speed brake

This commit is contained in:
Matthias Grob
2020-12-03 18:19:42 +01:00
parent badaf1eae0
commit 25c113a527
@@ -121,7 +121,9 @@ Vector2f StickAccelerationXY::calculateDrag(Vector2f drag_coefficient, const flo
drag_coefficient *= _brake_boost_filter.getState();
return drag_coefficient.emult(vel_sp);
// increase drag with sqareroot function when velocity is lower than 1m/s
const Vector2f velocity_with_sqrt_boost = vel_sp.unit_or_zero() * math::sqrt_linear(vel_sp.norm());
return drag_coefficient.emult(velocity_with_sqrt_boost);
}
void StickAccelerationXY::applyTiltLimit(Vector2f &acceleration)
@@ -142,8 +144,6 @@ void StickAccelerationXY::lockPosition(const Vector2f &vel_sp, const Vector3f &p
pos_sp = Vector2f(pos);
}
pos_sp += vel_sp * dt;
} else {
pos_sp.setNaN();