![]() |
VR-Forces 4.0.4 Class Documentation
|
DtTurretSlewController is a controller that has those capabilities common to all controllers that manipulate turret actuators. More...

Public Member Functions | |
| DtTurretSlewController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtTurretSlewController () |
| destructor | |
| virtual bool | init () |
| Calls setRadio() | |
| virtual DtString | type () const =0 |
| Returns a string identifies the class type of component. | |
| virtual void | tick () |
| Deriving controllers should call this FIRST in their tick to ensure that parameter values have been looked up from the actuator (unless you don't need those values.) | |
| virtual double | approximateSlew (double angle) |
| We use this to approximate the correct slew amount for a given dA. | |
| virtual void | setMaxSlewRate (DtReal maxSlewRate) |
| virtual DtReal | maxSlewRate () const |
| virtual void | setTurretToControl (DtArtPartType turretToControl) |
| virtual DtArtPartType | turretToControl () const |
| virtual double | turretBodyRotation () const |
| Returns the current rotation of the turret (specified by turretToControl()) in the reference from of the entity body. | |
| virtual bool | createSlewPort () |
| These are called by createPorts to create the ports used to communicate with the actuator. | |
| virtual bool | createLosPort () |
| virtual DtConstrainedAnalogOutputPort * | slewPort () |
| The slew port is constrained to -1. | |
| virtual DtIntegerOutputPort * | losPort () |
| Provides data as to whether this turret controller has done a LOS calculation to the target, and if so it provides the result. | |
Protected Member Functions | |
| virtual bool | createPorts () |
| Called by init to create the ports. | |
| virtual void | lookupAndCacheProcessSR () |
This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in
myProcessState. | |
| DtTurretSlewController () | |
| default constructor; not implemented | |
| DtTurretSlewController (const DtTurretSlewController &orig) | |
| copy constructor; not implemented | |
| const DtTurretSlewController & | operator= (const DtTurretSlewController &orig) |
| assignment operator; not implemented | |
Protected Attributes | |
| DtVrfTurretedBalGunPSR * | myProcessState |
| Pointer to a process state repository used to store state data associated with this component. | |
Ports and Port Groups | |
| DtConstrainedAnalogOutputPort * | mySlewPort |
| Output Port Name: slew Output Port Description: Slew rate. | |
| DtIntegerOutputPort * | myLosPort |
| Output Port Name: line-of-sight Output Port Description: Indicates if a LOS calculation was performed in this controller, and what the result was. | |
DtTurretSlewController is a controller that has those capabilities common to all controllers that manipulate turret actuators.
End User Description: Specific turret controllers (scan and target acquisition, e. g.), extend this controller, and turret actuators expect to be controlled by a class derived from this one. Max-slew-rate and the turret part type to control are parameters. Generated values (-1. to 1.) cause the turret to slew by some (actuator-defined proportion of max-slew-rate). This controller cheats and assumes that function is linear. Another could choose to add a feedback loop and increase/decrease output based on the actual slew rate occurring.
Developer Description: Creates the ports needed to control a turret actuator and manages the various parameters and state needed.
Uses Descriptor Type: DtComponentDescriptor
| DtTurretSlewController::DtTurretSlewController | ( | 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 DtTurretSlewController::~DtTurretSlewController | ( | ) | [virtual] |
destructor
| DtTurretSlewController::DtTurretSlewController | ( | ) | [protected] |
default constructor; not implemented
| DtTurretSlewController::DtTurretSlewController | ( | const DtTurretSlewController & | orig | ) | [protected] |
copy constructor; not implemented
| virtual bool DtTurretSlewController::init | ( | ) | [virtual] |
Calls setRadio()
Reimplemented from DtControllerComponent.
Reimplemented in DtTurretAcquireController, and DtTurretScanController.
| virtual DtString DtTurretSlewController::type | ( | ) | const [pure 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 DtControllerComponent.
Implemented in DtTurretAcquireController, DtTurretScanController, and DtGroundJoyTurretController.
| virtual void DtTurretSlewController::tick | ( | ) | [virtual] |
Deriving controllers should call this FIRST in their tick to ensure that parameter values have been looked up from the actuator (unless you don't need those values.)
Reimplemented from DtSimComponent.
Reimplemented in DtTurretAcquireController, DtTurretScanController, and DtGroundJoyTurretController.
| virtual double DtTurretSlewController::approximateSlew | ( | double | angle | ) | [virtual] |
We use this to approximate the correct slew amount for a given dA.
Returns the slew angle desired, divided by the product of maxSlewRate() and dT. If the value returned is outside the range -1.0 to 1.0 it is constrained by the slew port itself.
| virtual void DtTurretSlewController::setMaxSlewRate | ( | DtReal | maxSlewRate | ) | [virtual] |
| virtual DtReal DtTurretSlewController::maxSlewRate | ( | ) | const [virtual] |
| virtual void DtTurretSlewController::setTurretToControl | ( | DtArtPartType | turretToControl | ) | [virtual] |
| virtual DtArtPartType DtTurretSlewController::turretToControl | ( | ) | const [virtual] |
| virtual double DtTurretSlewController::turretBodyRotation | ( | ) | const [virtual] |
Returns the current rotation of the turret (specified by turretToControl()) in the reference from of the entity body.
| virtual bool DtTurretSlewController::createSlewPort | ( | ) | [virtual] |
These are called by createPorts to create the ports used to communicate with the actuator.
| virtual bool DtTurretSlewController::createLosPort | ( | ) | [virtual] |
| virtual DtConstrainedAnalogOutputPort* DtTurretSlewController::slewPort | ( | ) | [virtual] |
The slew port is constrained to -1.
| virtual DtIntegerOutputPort* DtTurretSlewController::losPort | ( | ) | [virtual] |
Provides data as to whether this turret controller has done a LOS calculation to the target, and if so it provides the result.
This is done to avoid calculating line of sight more than once in a single tick for the same target.
| virtual bool DtTurretSlewController::createPorts | ( | ) | [protected, virtual] |
Called by init to create the ports.
Reimplemented from DtSimComponent.
Reimplemented in DtTurretAcquireController.
| virtual void DtTurretSlewController::lookupAndCacheProcessSR | ( | ) | [protected, virtual] |
This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in
The name (if it exists) is given in the component descriptor (DtComponentDescriptor::processStateRepositoryName). If the name does not exist, it uses the appropriate default name defined in procSRTypes.h. Another component is responsible for creating and destroying the process state repository.
| const DtTurretSlewController& DtTurretSlewController::operator= | ( | const DtTurretSlewController & | orig | ) | [protected] |
assignment operator; not implemented
Output Port Name: slew
Output Port Description: Slew rate.
1.0 indicates maximum left slew, 1.0 indicates maximum right slew
Output Port Range: -1.0 to 1.0
Output Port Default Value:
Output Group Parent:
DtIntegerOutputPort* DtTurretSlewController::myLosPort [protected] |
Output Port Name: line-of-sight
Output Port Description: Indicates if a LOS calculation was performed in this controller, and what the result was.
Output Port Range: 0 = Unkown, 1 = Blocked, 2 = Clear
Output Port Default Value:
Output Group Parent:
Pointer to a process state repository used to store state data associated with this component.
This process state repository is shared with other components. Another component is responsible for creating and destroying the process state repository. This state is saved and restored as part of a scenario (or checkpoint).