Missileguidance - Update Javelin (#10030)

This commit is contained in:
Bailey Danyluk 2024-08-23 08:51:55 -06:00 committed by GitHub
parent b36961937c
commit 7279b94945
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 61 additions and 6 deletions

View File

@ -70,9 +70,11 @@ class CfgAmmo {
// Begin ACE guidance Configs
class ADDON {
enabled = 1;
minDeflection = 0.00005; // Minium flap deflection for guidance
maxDeflection = 0.025; // Maximum flap deflection for guidance
incDeflection = 0.00005; // The incrmeent in which deflection adjusts.
pitchRate = 100; // degrees per second
yawRate = 100;
stabilityCoefficient = 0.2;
bangBangGuidance = 0;
canVanillaLock = 0;
@ -83,6 +85,11 @@ class CfgAmmo {
defaultSeekerLockMode = "LOBL";
seekerLockModes[] = { "LOBL" };
defaultNavigationType = "Direct";
navigationTypes[] = { "Direct", "ZeroEffortMiss" };
navigationGain = 3;
seekerAngle = 180; // Angle in front of the missile which can be searched
seekerAccuracy = 1; // seeker accuracy multiplier
@ -95,6 +102,19 @@ class CfgAmmo {
defaultAttackProfile = "JAV_TOP";
attackProfiles[] = { "JAV_TOP", "JAV_DIR" };
useModeForAttackProfile = 1;
class navigationStates {
class initial {
transitionCondition = QFUNC(javelin_midCourseTransition);
navigationType = "Direct";
};
class terminal {
transitionCondition = "";
navigationType = "ZeroEffortMiss";
};
// transitions from initial -> termimal
states[] = {"initial", "terminal"};
};
};
};
class ACE_Javelin_FGM148_static: ACE_Javelin_FGM148 {

View File

@ -32,6 +32,7 @@ PREP(attackProfile_BEAM);
// Javelin profiles
PREP(attackProfile_JAV_DIR);
PREP(attackProfile_JAV_TOP);
PREP(javelin_midCourseTransition);
// Navigation Profiles
PREP(navigationType_zeroEffortMiss);

View File

@ -47,7 +47,7 @@ private _returnTargetPos = _seekerTargetPos;
switch (_attackProfileStateParams select 0) do {
case STAGE_LAUNCH: {
TRACE_1("STAGE_LAUNCH","");
if (_distanceToShooter < 10) then {
if (_distanceToShooter < 6) then {
_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2];
} else {
_attackProfileStateParams set [0, STAGE_CLIMB];
@ -55,7 +55,8 @@ switch (_attackProfileStateParams select 0) do {
};
case STAGE_CLIMB: {
TRACE_1("STAGE_CLIMB","");
private _cruisAlt = 60 * (_distanceShooterToTarget/2000);
// 65 is min range
private _cruisAlt = 60 * ((0 max (_distanceShooterToTarget - 65))/2000);
if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then {
_attackProfileStateParams set [0, STAGE_TERMINAL];

View File

@ -57,7 +57,7 @@ switch( (_attackProfileStateParams select 0) ) do {
TRACE_1("STAGE_CLIMB","");
private _cruisAlt = 140;
if (_distanceShooterToTarget < 1250) then {
_cruisAlt = 140 * (_distanceShooterToTarget/1250);
_cruisAlt = 140 * ((0 max (_distanceShooterToTarget - 150))/1250);
TRACE_1("_cruisAlt",_cruisAlt);
};
if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then {

View File

@ -0,0 +1,33 @@
#include "..\script_component.hpp"
/*
* Author: tcvm
* Condition to switch to next navigation profile
*
* Arguments:
* Guidance Arg Array <ARRAY>
*
* Return Value:
* None
*
* Example:
* [] call ace_missileguidance_fnc_javelin_midCourseTransition
*
* Public: No
*/
#define STAGE_LAUNCH 1
#define STAGE_CLIMB 2
#define STAGE_COAST 3
#define STAGE_TERMINAL 4
_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"];
_firedEH params ["_shooter","","","","_ammo","","_projectile"];
_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"];
_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"];
_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"];
_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams", "_guidanceParameters"];
_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"];
_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"];
_attackProfileStateParams params ["_state"];
_state isEqualTo STAGE_TERMINAL