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

DtTurretActuatorComponent provides a simple model of a rotating turret that knows how to drive the articulating parts objects of the local state repository. More...

Inheritance diagram for DtTurretActuatorComponent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtTurretActuatorComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtTurretActuatorComponent ()
 destructor
virtual bool postAddComponentsInit ()
 Calls lookupAndCacheProcessSR() and initProcessSR()
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void tick ()
 Calculate new kinematic state.
virtual void setTurretArtPart (DtArtPartType turretArtPart)
virtual DtArtPartType turretArtPart () const
virtual void setMaxSlewRate (DtReal maxSlewRate)
virtual DtReal maxSlewRate () const
virtual void initProcessSR ()
 Sets the art part type and slew rate in myProcessState from the DtSimArtPartDescriptor.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual bool createPorts ()
 Creates the slew port.
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.


 DtTurretActuatorComponent ()
 default constructor; not implemented
 DtTurretActuatorComponent (const DtTurretActuatorComponent &orig)
 copy constructor; not implemented
const DtTurretActuatorComponentoperator= (const DtTurretActuatorComponent &orig)
 assignment operator; not implemented

Protected Attributes

const DtTurretComponentDescriptormyTurretComponentDescriptor
DtVrfTurretedBalGunPSRmyProcessState
 Pointer to a process state repository used to store state data associated with this component.
bool myRotation360
 Cache for the condition for 360 rotation, which is hasFixedAzimuth = false and leftLimit = rightLimit (all info from turretComponentDescriptor)
DtReal myLeftSlewLimit
 Local copies of the parameters in the turret descriptor, conditioned to be between 0 and 2pi.
DtReal myRightSlewLimit
Ports and Port Groups
DtConstrainedAnalogInputPortmySlewPort
 Input Port Name: slew
Input Port Description: -1.0 indicates maximum left slew, 1.0 indicates maximum right slew
Input Port Range: -1.

Detailed Description

DtTurretActuatorComponent provides a simple model of a rotating turret that knows how to drive the articulating parts objects of the local state repository.

End User Description: The turret actuator updates the articulated part specified in its component descriptor, based on slew data it receives. It expects an input (via a mySlewPort) of a slew amount between -1. and +1.

Developer Description: The tick() function first checks to see if dT is 0.0. If it is, it just returns. Otherwise, it looks up the DtArticulatedPartStateRepository object kept by the entity to maintain state for the turret using DtAttachmentManager::findPartByType with the turret art part type from the process state repository as the argument. The current angle of the turret (with respect to whatever is it attached to) is retrieved from the DtArticulatedPartStateRepository which represents the turret by going through the kinematic state to get the "psi" component of the parent orientation. The slewRate to use is calculated using: the value on the slew port * myMaxSlewRate The new turret angle is calculated as: the current angle + (slew rate * dT) The angle is then constrained to be between 0.0 and 2 * PI using the VR-Link utility function DtModPerLo(). The new angle is then stored in the kinematic state of the rotating body.

Uses Descriptor Type: DtTurretComponentDescriptor


Constructor & Destructor Documentation

DtTurretActuatorComponent::DtTurretActuatorComponent ( 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 DtString DtTurretActuatorComponent::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.

Returns:
DtTurretActuatorType

Reimplemented from DtSimComponent.

virtual void DtTurretActuatorComponent::tick ( ) [virtual]

Calculate new kinematic state.

Reimplemented from DtSimComponent.

virtual void DtTurretActuatorComponent::setTurretArtPart ( DtArtPartType  turretArtPart) [virtual]
virtual DtArtPartType DtTurretActuatorComponent::turretArtPart ( ) const [virtual]
virtual void DtTurretActuatorComponent::setMaxSlewRate ( DtReal  maxSlewRate) [virtual]
virtual DtReal DtTurretActuatorComponent::maxSlewRate ( ) const [virtual]
virtual void DtTurretActuatorComponent::initProcessSR ( ) [virtual]

Sets the art part type and slew rate in myProcessState from the DtSimArtPartDescriptor.

static DtSimComponent* DtTurretActuatorComponent::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
) [static]

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

Returns:
New instance of this class.
virtual bool DtTurretActuatorComponent::createPorts ( ) [protected, virtual]

Creates the slew port.

Reimplemented from DtSimComponent.

virtual void DtTurretActuatorComponent::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 DtTurretActuatorComponent& DtTurretActuatorComponent::operator= ( const DtTurretActuatorComponent orig) [protected]

assignment operator; not implemented


Member Data Documentation

Input Port Name: slew
Input Port Description: -1.0 indicates maximum left slew, 1.0 indicates maximum right slew
Input Port Range: -1.

to 1.
Input Port Default Value:
Input 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).

Cache for the condition for 360 rotation, which is hasFixedAzimuth = false and leftLimit = rightLimit (all info from turretComponentDescriptor)

Local copies of the parameters in the turret descriptor, conditioned to be between 0 and 2pi.


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)