Fix metis and HOT to use new scheme

This commit is contained in:
Brandon Danyluk 2021-04-12 00:12:16 -06:00
parent bac6a0b6dd
commit cf40622b52
9 changed files with 31 additions and 25 deletions

View File

@ -36,9 +36,8 @@ class CfgAmmo {
maxControlRange = 1500;
class ace_missileguidance {
minDeflection = 0;
maxDeflection = 0;
incDeflection = 0;
pitchRate = 0;
yawRate = 0;
canVanillaLock = 0;
@ -49,6 +48,9 @@ class CfgAmmo {
defaultSeekerLockMode = "LOAL";
seekerLockModes[] = { "LOAL", "LOBL" };
defaultNavigationType = "LineOfSight";
navigationTypes[] = { "LineOfSight" };
seekLastTargetPos = 0;
seekerAngle = 30;
seekerAccuracy = 1;

View File

@ -57,9 +57,8 @@ class CfgAmmo {
class ace_missileguidance {
enabled = 1;
minDeflection = 0; // Minium flap deflection for guidance
maxDeflection = 0.0030; // Maximum flap deflection for guidance
incDeflection = 0.0005; // The incrmeent in which deflection adjusts.
pitchRate = 15; // Minium flap deflection for guidance
yawRate = 15; // Maximum flap deflection for guidance
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
@ -70,6 +69,9 @@ class CfgAmmo {
defaultSeekerLockMode = "LOAL";
seekerLockModes[] = { "LOAL", "LOBL" };
defaultNavigationType = "LineOfSight";
navigationTypes[] = { "LineOfSight" };
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 30; // Angle from the shooter's view that can track the missile
seekerAccuracy = 1; // seeker accuracy multiplier

View File

@ -10,9 +10,8 @@ class CfgAmmo {
class ace_missileguidance {
enabled = 1;
minDeflection = 0; // Minium flap deflection for guidance
maxDeflection = 0.0027; // Maximum flap deflection for guidance
incDeflection = 0.0005; // The incrmeent in which deflection adjusts.
pitchRate = 25; // Minium flap deflection for guidance
yawRate = 25; // Maximum flap deflection for guidance
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
@ -23,6 +22,9 @@ class CfgAmmo {
defaultSeekerLockMode = "LOAL";
seekerLockModes[] = { "LOAL", "LOBL" };
defaultNavigationType = "LineOfSight";
navigationTypes[] = { "LineOfSight" };
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
seekerAccuracy = 1; // seeker accuracy multiplier
@ -50,9 +52,8 @@ class CfgAmmo {
class ace_missileguidance {
enabled = 1;
minDeflection = 0; // Minium flap deflection for guidance
maxDeflection = 0.0027; // Maximum flap deflection for guidance
incDeflection = 0.0005; // The incrmeent in which deflection adjusts.
pitchRate = 25; // Minium flap deflection for guidance
yawRate = 25; // Maximum flap deflection for guidance
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
@ -63,6 +64,9 @@ class CfgAmmo {
defaultSeekerLockMode = "LOAL";
seekerLockModes[] = { "LOAL", "LOBL" };
defaultNavigationType = "LineOfSight";
navigationTypes[] = { "LineOfSight" };
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
seekerAccuracy = 1; // seeker accuracy multiplier
@ -70,7 +74,7 @@ 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
correctionDistance = 6; // 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

@ -24,7 +24,7 @@ params ["_args", "_pfID"];
_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"];
_firedEH params ["_shooter","","","","_ammo","","_projectile"];
_launchParams params ["","_targetLaunchParams","","","","","_navigationType"];
_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState", "_navigationParameters"];
_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState", "_navigationParameters", "_guidanceParameters"];
if (!alive _projectile || isNull _projectile || isNull _shooter) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
@ -55,8 +55,7 @@ if ((_pitchRate != 0 || {_yawRate != 0}) && {_profileAdjustedTargetPos isNotEqua
// activate missile servos and change direction
if (!isGamePaused && accTime > 0) then {
_navigationParameters params ["", "_currentPitchYawRoll"];
_currentPitchYawRoll params ["_yaw", "_roll", "_pitch"];
_guidanceParameters params ["_yaw", "_roll", "_pitch"];
_commandedAcceleration = _projectile vectorWorldToModelVisual _commandedAcceleration;
_commandedAcceleration params ["_yawChange", "", "_pitchChange"];
@ -90,10 +89,10 @@ if ((_pitchRate != 0 || {_yawRate != 0}) && {_profileAdjustedTargetPos isNotEqua
[_projectile, _pitch, _yaw, 0] call FUNC(changeMissileDirection);
_projectile setVelocityModelSpace [0, vectorMagnitude velocity _projectile, 0];
_currentPitchYawRoll set [0, _yaw];
_currentPitchYawRoll set [2, _pitch];
_guidanceParameters set [0, _yaw];
_guidanceParameters set [2, _pitch];
_navigationParameters set [1, _currentPitchYawRoll];
_stateParams set [5, _guidanceParameters];
};
_stateParams set [4, _navigationParameters];

View File

@ -19,4 +19,4 @@ _args params ["_firedEH"];
_firedEH params ["","","","","","","_projectile"];
private _lineOfSight = vectorNormalized (_profileAdjustedTargetPos vectorDiff getPosASLVisual _projectile);
_lineOfSight
_lineOfSight vectorMultiply 50

View File

@ -18,7 +18,7 @@ params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos"];
_args params ["_firedEH", "", "", "", "_stateParams"];
_firedEH params ["","","","","","","_projectile"];
_stateParams params ["", "", "", "","_navigationParams"];
_navigationParams params ["_lastMissileFrame", "", "_navigationGain"];
_navigationParams params ["_lastMissileFrame", "_navigationGain"];
_lastMissileFrame params ["_lastTargetPosition", "_lastTargetVelocity", "_lastLineOfSight"];
// Proportional navigation implemented via "Fundamentals of proportional navigation" by Stephen Murtaugh and Harry Criel

View File

@ -118,6 +118,7 @@ if (isNumber (_config >> "pitchRate")) then {
_bangBang = 1 == getNumber (_config >> "bangBangGuidance");
};
private _pitchYaw = (vectorDir _projectile) call CBA_fnc_vect2Polar;
TRACE_5("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile,_navigationType);
private _args = [_this,
[ _shooter,
@ -139,7 +140,7 @@ private _args = [_this,
getNumber ( _config >> "seekerMaxRange" ),
getNumber ( _config >> "seekerMinRange" )
],
[ diag_tickTime, [], [], _lastKnownPosState, _navigationParameters]
[ diag_tickTime, [], [], _lastKnownPosState, _navigationParameters, [_pitchYaw select 1, 0, _pitchYaw select 2]]
];
private _onFiredFunc = getText (configFile >> QGVAR(SeekerTypes) >> _seekerType >> "onFired");

View File

@ -27,14 +27,12 @@ if (_navigationGain == 0) then {
_navigationGain = 3;
};
private _pitchYaw = (vectorDir _projectile) call CBA_fnc_vect2Polar;
_navigationParams = [
[ // Last Missile Frame
[0, 0, 0], // Last target position array
[0, 0, 0], // Last target velocity
[0, 0, 0] // Last line of sight
],
[_pitchYaw select 1, 0, _pitchYaw select 2], // current yaw/roll/pitch
_navigationGain // navigation gain of missile. Set in the navigation onFired function
];
_stateParams set [4, _navigationParams];

View File

@ -15,7 +15,7 @@ Seeker Types:
Laser - causes lots of weapon noise, causing bad guidance
Navigation Types:
GBU-12 - LOS Guidance
GBU-12 - Simple ProNav Guidance
NLAW - LOS Guidance
Dragon - LOS Guidance
Metis - LOS Guidance