Update all Line guidance missiles

This commit is contained in:
Bailey Danyluk 2022-04-04 18:46:40 -06:00
parent f9241fe595
commit 71e01a2ee4
5 changed files with 23 additions and 28 deletions

View File

@ -75,8 +75,8 @@ class CfgAmmo {
defaultNavigationType = "Line";
navigationTypes[] = { "Line" };
lineGainP = 35;
lineGainD = 30;
lineGainP = 7;
lineGainD = 6;
initialPitch = 2;
@ -87,7 +87,6 @@ class CfgAmmo {
seekerMinRange = 75;
seekerMaxRange = 4000; // Range from the missile which the seeker can visually search
correctionDistance = 30; // distance from center of crosshair where missile slows down
offsetFromCrosshair[] = { 0, 0, 0.5 }; // where the missile wants to stay in relation to the center of the crosshair.
// Attack profile type selection

View File

@ -28,8 +28,8 @@ class CfgAmmo {
defaultNavigationType = "Line";
navigationTypes[] = { "Line" };
lineGainP = 30;
lineGainD = 30;
lineGainP = 10;
lineGainD = 9;
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 15; // Angle from the shooter's view that can track the missile
@ -38,7 +38,6 @@ class CfgAmmo {
seekerMinRange = 80;
seekerMaxRange = 2000; // Range from the missile which the seeker can visually search
correctionDistance = 3; // distance from center of crosshair where missile slows down
offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair.
// Attack profile type selection

View File

@ -20,26 +20,24 @@ _targetData params ["", "_targetDir", "_distance"];
_flightParams params ["_pitchRate", "_yawRate"];
_navigationParams params ["_proportionalGain", "", "_derivativeGain", "_lastErrorX", "_lastErrorY", "_correctionDistance"];
private _targetDistance = _projectile vectorWorldToModelVisual (_targetDir vectorMultiply _distance);
private _relativeTargetDirection = [0, (velocityModelSpace _projectile) select 1, 0] vectorAdd (_projectile vectorWorldToModelVisual (_targetDir vectorMultiply _distance));
//_proportionalGain = 30;
//_derivativeGain = 30;
//_correctionDistance = 3;
private _errorX = _targetDistance#0 / _correctionDistance;
private _errorY = _targetDistance#2 / _correctionDistance;
_proportionalGain = 50;
_derivativeGain = 0;
private _pX = _proportionalGain * _errorX;
private _dX = if (_timestep != 0) then {
_derivativeGain * (_errorX - _lastErrorX) / _timestep
} else {
0
private _angleX = ((_relativeTargetDirection select 0) atan2 (_relativeTargetDirection select 1));
private _angleY = ((_relativeTargetDirection select 2) atan2 (_relativeTargetDirection select 1));
private _pX = _proportionalGain * _angleX;
private _dX = 0;
if (_timestep > 0) then {
_dX = _derivativeGain * (_angleX - _lastErrorX) / _timestep;
};
private _pY = _proportionalGain * _errorY;
private _dY = if (_timestep != 0) then {
_derivativeGain * (_errorY - _lastErrorY) / _timestep
} else {
0
private _pY = _proportionalGain * _angleY;
private _dY = 0;
if (_timestep > 0) then {
_dY = _derivativeGain * (_angleY - _lastErrorY) / _timestep;
};
private _accelerationX = _pX + _dX;
@ -51,7 +49,7 @@ private _commandedAcceleration = [
_accelerationY
];
_navigationParams set [3, _errorX];
_navigationParams set [4, _errorY];
_navigationParams set [3, _angleX];
_navigationParams set [4, _angleY];
_projectile vectorModelToWorldVisual _commandedAcceleration;

View File

@ -22,7 +22,7 @@ class CfgAmmo {
navigationTypes[] = { "LINE" };
lineGainP = 50;
lineGainD = 1;
lineGainD = 0;
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 60; // Angle from the shooter's view that can track the missile

View File

@ -27,9 +27,8 @@ class CfgAmmo {
defaultNavigationType = "Line";
navigationTypes[] = { "Line" };
lineGainP = 40;
lineGainD = 30;
correctionDistance = 5;
lineGainP = 8;
lineGainD = 6;
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 15; // Angle from the shooter's view that can track the missile