VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Protected Attributes
DtTurretSlewController Class Reference

DtTurretSlewController is a controller that has those capabilities common to all controllers that manipulate turret actuators. More...

Inheritance diagram for DtTurretSlewController:
Inheritance graph
[legend]

List of all members.

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 DtIntegerOutputPortlosPort ()
 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 DtTurretSlewControlleroperator= (const DtTurretSlewController &orig)
 assignment operator; not implemented

Protected Attributes

DtVrfTurretedBalGunPSRmyProcessState
 Pointer to a process state repository used to store state data associated with this component.
Ports and Port Groups
DtConstrainedAnalogOutputPortmySlewPort
 Output Port Name: slew
Output Port Description: Slew rate.
DtIntegerOutputPortmyLosPort
 Output Port Name: line-of-sight
Output Port Description: Indicates if a LOS calculation was performed in this controller, and what the result was.

Detailed Description

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


Constructor & Destructor Documentation

DtTurretSlewController::DtTurretSlewController ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

destructor

default constructor; not implemented

copy constructor; not implemented


Member Function Documentation

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.

Returns:
One of the type strings defined in compTypes.h

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.

These are called by createPorts to create the ports used to communicate with the actuator.

The slew port is constrained to -1.

  • 1. Positive values should slew counterclockwise, negative values clockwise (looking down the axis. Since our body coordinate systen is z-down, a positive value would rotate clockwise if looking down on the object, for example a turret on a tank).

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

myProcessState.

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


Member Data Documentation

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:

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).


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)