StickAccelerationXY: Simplify collision prevention call

This commit is contained in:
Matthias Grob 2024-11-11 15:53:30 +01:00 committed by Claudio Chies
parent 0cd6a553b9
commit 079f3ca67c

View File

@ -97,11 +97,7 @@ void StickAccelerationXY::generateSetpoints(Vector2f stick_xy, const float yaw,
_acceleration_setpoint = stick_xy.emult(acceleration_scale);
if (_collision_prevention.is_active()) {
matrix::Vector2f accel_setpoint_xy = _acceleration_setpoint;
matrix::Vector2f vel_setpoint_xy = _velocity_setpoint;
_collision_prevention.modifySetpoint(accel_setpoint_xy, vel_setpoint_xy);
_acceleration_setpoint = accel_setpoint_xy;
_collision_prevention.modifySetpoint(_acceleration_setpoint, _velocity_setpoint);
}
// Add drag to limit speed and brake again