![]() |
VR-Forces 4.0.4 Class Documentation
|
DtLauncherController is a controller that accepts input from a target sensor, and provides ammunition type, load status, and trigger inputs to a missile launcher actuator. More...

Public Member Functions | |
| DtLauncherController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtLauncherController () |
| destructor | |
| virtual bool | init () |
| Overridden to register a detonation callback and to initialize myCreateMissileInfo. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | tick () |
| Calculate new control values. | |
| virtual void | tickMunitionLoader (const DtVrfObject *target) |
| This method sets the flags myLoading, myUnloading, myLoaded as the load state of the weapon changes. | |
| virtual bool | createMissileIdPort () |
| These are called in init to create the ports used to communicate with the actuator. | |
| virtual DtObjectIdOutputPort * | missileIdPort () const |
| virtual bool | createTargetPointPort () |
| virtual DtVectorOutputPort * | targetPointPort () const |
| virtual bool | createTargetEntityIdPort () |
| virtual DtObjectIdOutputPort * | targetEntityIdPort () const |
| virtual void | fire () |
| Creates and initializes a new missile object. | |
| virtual void | missileDetonated (DtDetonationInteraction *detInter) |
| For removing missile entities from local list after they are destroyed. | |
| virtual void | disconnectMissileFromLauncher (const DtEntityIdentifier &missId) |
| Takes a DtEntityIdentifier of a missile as an argument. | |
| virtual void | disconnectMissileFromLauncher (DtVrfObject *missile) |
| virtual DtVrfObject * | mostRecentMissileFired () |
| Returns the most recent missile fired (and still connected) or NULL. | |
| virtual double | abandonPassedMissileDistance () |
| virtual void | setAbandonPassedMissileDistance (const double &distance) |
Static Public Member Functions | |
| static void | detonationCallback (DtDetonationInteraction *detInter, void *usr) |
| This callback function is registered with the exercise connection to handle incoming DtDetonationInteractions. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual bool | createPorts () |
| Overridden to create the launcher's ports. | |
| virtual void | removeMissileFromActiveList (const DtEntityIdentifier &removeId) |
| Removes the DtObjectId of a given missile from myActiveMissiles list. | |
| DtLauncherController () | |
| default constructor; not implemented | |
| DtLauncherController (const DtLauncherController &orig) | |
| copy constructor; not implemented | |
| const DtLauncherController & | operator= (const DtLauncherController &orig) |
| assignment operator; not implemented | |
Protected Attributes | |
| DtIfCreateVrfObject | myCreateMissileInfo |
| DtList | myActiveMissiles |
| double | myAbandonPassedMissileDistance |
| If the missile passes its target within this distance, it will be abandoned and disconnected from the launcher. | |
| bool | myFirstTick |
Ports and Port Groups | |
| DtObjectIdOutputPort * | myMissileIdPort |
| Output Port Name: missile-id Output Port Description: Object id of the missile. | |
| DtObjectIdOutputPort * | myTargetEntityIdPort |
| Output Port Name: target-entity Output Port Description: Object id of the target. | |
| DtVectorOutputPort * | myTargetPointPort |
| Output Port Name: target-point Output Port Description: Local position of the target. | |
DtLauncherController is a controller that accepts input from a target sensor, and provides ammunition type, load status, and trigger inputs to a missile launcher actuator.
End User Description: It also provides azimuth and elevation inputs to corresponding azimuth and elevation mount actuators (moveable components upon which the launcher may be mounted). The launcher controller designates its target as the first target that appears in the entity's sector of responsibility. Based on the target type, it loads the appropriate munition type. If a change in target occurs, requiring a change in munition type, or fuse type, or both (that is, the new target detected is of a different type than the original target), the weapon unloads the old munition, and then loads the new type of munition. If no target is available, and the preload-weapon parameter is set, then the first munition type specified in the munition table is loaded.
When a guided missile is fired, reloading is suspended while the missile is active. Once the missile detonates or passes the target, reloading may resume.
The target is acquired when the azimuth and elevation of the weapon align with the azimuth and elevation to the target, within the ranges specified by the munition-maneuver-margin parameter. The controller reorients the weapon in azimuth and elevation as needed.
Once a target has been acquired, the weapon is loaded, and the entity has permission to fire (given by the entity's rules of engagement, for example, "fire-at-will"), the weapon controller fires. It creates a new missile entity, sets the ID of the missile entity in the missile ID port, sets the trigger port to true, and depletes the resource associated with the missile type.
Uses Descriptor Type: DtWeaponControllerDescriptor
| DtLauncherController::DtLauncherController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtLauncherController::~DtLauncherController | ( | ) | [virtual] |
destructor
| DtLauncherController::DtLauncherController | ( | ) | [protected] |
default constructor; not implemented
| DtLauncherController::DtLauncherController | ( | const DtLauncherController & | orig | ) | [protected] |
copy constructor; not implemented
| virtual bool DtLauncherController::init | ( | ) | [virtual] |
Overridden to register a detonation callback and to initialize myCreateMissileInfo.
Reimplemented from DtWeaponController.
| virtual DtString DtLauncherController::type | ( | ) | const [virtual] |
Returns a string identifies the class type of component.
Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.
Reimplemented from DtWeaponController.
Reimplemented in DtVerticalLauncherController.
| virtual void DtLauncherController::tick | ( | ) | [virtual] |
Calculate new control values.
Reimplemented from DtWeaponController.
| virtual void DtLauncherController::tickMunitionLoader | ( | const DtVrfObject * | target | ) | [virtual] |
This method sets the flags myLoading, myUnloading, myLoaded as the load state of the weapon changes.
The parameter is the entity object of the current target for the weapon. This override of the base performs pre-loading of the launcher even if there is no target. Overrides DtWeaponController::tickMunitionLoader(). Before calling down to the base class's version of this function, it checks to see if the last guided missile fired has missed its target. If no such missile exists, or if it is a fire-and-forget type of missile, the function calls down to the base class's tickMunitionLoader() to continue the loading process. If the last missile fired is a guided missile, and it has not passed its target, it returns without calling the base class tickMunitionLoader(). This has the effect of suspending load operations while an operator-guided missile is still active. Otherwise, if the missile has passed it's target disconnectMissileFromLauncher is called.
Reimplemented from DtWeaponController.
| virtual bool DtLauncherController::createMissileIdPort | ( | ) | [virtual] |
These are called in init to create the ports used to communicate with the actuator.
| virtual DtObjectIdOutputPort* DtLauncherController::missileIdPort | ( | ) | const [virtual] |
| virtual bool DtLauncherController::createTargetPointPort | ( | ) | [virtual] |
| virtual DtVectorOutputPort* DtLauncherController::targetPointPort | ( | ) | const [virtual] |
| virtual bool DtLauncherController::createTargetEntityIdPort | ( | ) | [virtual] |
| virtual DtObjectIdOutputPort* DtLauncherController::targetEntityIdPort | ( | ) | const [virtual] |
| virtual void DtLauncherController::fire | ( | ) | [virtual] |
Creates and initializes a new missile object.
It sets the DtObjectId of the new missile object in myMissileIdPort, sets the trigger value to true in myTriggerPort, and adds the missile's ID to the myActiveMissiles list. Finally, it looks up the resource corresponding to the missile type in the entity's local state repository, and decrements the count on that resource.
Reimplemented from DtWeaponController.
| virtual void DtLauncherController::missileDetonated | ( | DtDetonationInteraction * | detInter | ) | [virtual] |
For removing missile entities from local list after they are destroyed.
Takes a DtDetonationInteraction as an argument. It goes through its list of active missiles (myActiveMissiles), searching for an ID that matches the munition ID specified in the DtDetonationInteraction. If it is found, it calls removeMissileFromActiveList(), to remove and delete the missile DtObjectId in the myActiveMissiles list.
| static void DtLauncherController::detonationCallback | ( | DtDetonationInteraction * | detInter, |
| void * | usr | ||
| ) | [static] |
This callback function is registered with the exercise connection to handle incoming DtDetonationInteractions.
It calls missileDetonated() to process the interaction.
| virtual void DtLauncherController::disconnectMissileFromLauncher | ( | const DtEntityIdentifier & | missId | ) | [virtual] |
Takes a DtEntityIdentifier of a missile as an argument.
If the missile is found in the myActiveMissiles list, it looks up the missile object by DtEntityIdentifier in the DtVrfObjectManager. If found, it calls DtMissileStateRepository::setDisconnectedFromLauncher(), and removes and deletes the missile DtEntityIdentifier from the myActiveMissiles list. The second version of this function takes a missile object as an argument. It calls down to the first version of the function to perform the actual work.
| virtual void DtLauncherController::disconnectMissileFromLauncher | ( | DtVrfObject * | missile | ) | [virtual] |
| virtual DtVrfObject* DtLauncherController::mostRecentMissileFired | ( | ) | [virtual] |
Returns the most recent missile fired (and still connected) or NULL.
| virtual double DtLauncherController::abandonPassedMissileDistance | ( | ) | [virtual] |
| virtual void DtLauncherController::setAbandonPassedMissileDistance | ( | const double & | distance | ) | [virtual] |
| static DtSimComponent* DtLauncherController::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [static] |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
Reimplemented from DtWeaponController.
Reimplemented in DtVerticalLauncherController.
| virtual bool DtLauncherController::createPorts | ( | ) | [protected, virtual] |
Overridden to create the launcher's ports.
Reimplemented from DtWeaponController.
| virtual void DtLauncherController::removeMissileFromActiveList | ( | const DtEntityIdentifier & | removeId | ) | [protected, virtual] |
Removes the DtObjectId of a given missile from myActiveMissiles list.
It deletes the DtObjectId data in the list entry.
| const DtLauncherController& DtLauncherController::operator= | ( | const DtLauncherController & | orig | ) | [protected] |
assignment operator; not implemented
DtList DtLauncherController::myActiveMissiles [protected] |
Output Port Name: missile-id
Output Port Description: Object id of the missile.
Output Port Range:
Output Port Default Value:
Output Group Parent: weapon-control
Output Port Name: target-entity
Output Port Description: Object id of the target.
Output Port Range:
Output Port Default Value:
Output Group Parent: weapon-control
Output Port Name: target-point
Output Port Description: Local position of the target.
Output Port Range:
Output Port Default Value:
Output Group Parent: weapon-control
double DtLauncherController::myAbandonPassedMissileDistance [protected] |
If the missile passes its target within this distance, it will be abandoned and disconnected from the launcher.
Defaults to 100 meters.
bool DtLauncherController::myFirstTick [protected] |
Reimplemented from DtBaseWeaponController.