Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
tryuan99 committed Oct 10, 2024
1 parent 1743e03 commit d592047
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Assets/Scripts/Interceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ private Vector3 CalculateAccelerationCommand(SensorOutput sensorOutput) {
float acc_el = 0;
// Handle negative closing velocity scenario
if (closing_velocity < 0) {
// Target is moving away, apply stronger turn
float turnFactor = Mathf.Max(1f, Mathf.Abs(closing_velocity) * 100f);
acc_az = N * turnFactor * los_rate_az;
acc_el = N * turnFactor * los_rate_el;
// Target is moving away, apply stronger turn
float turnFactor = Mathf.Max(1f, Mathf.Abs(closing_velocity) * 100f);
acc_az = N * turnFactor * los_rate_az;
acc_el = N * turnFactor * los_rate_el;
} else {
// Normal PN guidance for positive closing velocity
acc_az = N * closing_velocity * los_rate_az;
acc_el = N * closing_velocity * los_rate_el;
// Normal PN guidance for positive closing velocity
acc_az = N * closing_velocity * los_rate_az;
acc_el = N * closing_velocity * los_rate_el;
}
// Convert acceleration commands to craft body frame
accelerationCommand = transform.right * acc_az + transform.up * acc_el;
Expand Down

0 comments on commit d592047

Please sign in to comment.