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

DtRotaryWingActuatorComponent is a kinematics-based model of a rotary wing aircraft that converts collective, cyclic, and pedal into acceleration, velocity, position, rotational velocity, and orientation. More...

Inheritance diagram for DtRotaryWingActuatorComponent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtRotaryWingActuatorComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtRotaryWingActuatorComponent ()
 destructor Removes process state from process state manager before deleting it.
virtual bool init ()
 to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void tick ()
 Calculate new kinematic state.
virtual void useFuel (double fuelUsed)
 Fuel manipulation functions.
virtual double fuelLeft () const
virtual double calculateFuel () const
 Calculate the fuel used in the last time step.
virtual void fallFromSky ()
 This member function is called when an entity has been destroyed and is still in the air.

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 createPortGroups ()
 Creates the local port groups.
virtual bool createPorts ()
 Creates the input ports and adds them to the component.
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.
virtual void clampFrameRate ()
 Clamp the frame rate if the rate is too slow.
virtual void setLanded (const DtVector &localIntersectionPoint)
 Sets the parameters for a landed entity.
virtual bool checkFlyingWithoutFuel ()
 Check to see if the entity is flying without fuel, and call fallFromSky if so.
virtual void calculateYawAcceleration ()
 Find yaw acceleration and new rate.
virtual void calculateYawRate ()
virtual void calculatePitchAcceleration ()
 Find pitch acceleration and new rate.
virtual void calculatePitchRate ()
virtual void calculateRollAcceleration ()
 Find roll acceleration and new rate.
virtual void calculateRollRate ()
virtual void calculateOrientation ()
 Uses current local orientation, rotationRates in SR, and dT.
virtual void calculateNormalizedBodyVelocity ()
 Put current velocity into body coordinates (AFTER rotating body).
virtual void calculateBodyGravity ()
 Put acceleration due to gravity in body coordinates.
virtual void calculateLiftAcceleration ()
 Calculate scalar accel in direction of lift (perpendicular to wings).
virtual void calculateDragAcceleration ()
 Calculate scalar drag accel opposite direction of current velocity.
virtual void calculateResultantAcceleration ()
 Sum the accelerations produced by forces acting on the body, and put the result into world coordinates.
virtual void integrate ()
 Find the new velocity and position.
virtual void updateRepository ()
 Sets the state to locally calculated values.
virtual void updateDisplay () const
 Can be used to print control values in the console window.
virtual void checkLandedOrCrashed ()
 Check if the entity landed on the ground or crashed.
virtual bool isCrashedIntoGround (const DtVector &localPosition, DtVector &localIntersectionPoint) const
 Determines if the entity has crashed into the ground.
virtual void sendDetonation (const DtVector &geocentricLocation) const
 Sends a detonation interaction at the specified location, in geocentric coordinates.
virtual bool isSubsurface () const
 Determine whether or not the configured entity is a subsurface entity or not.
virtual bool componentInitialized () const
 Determine if the component has been properly initialized.
virtual bool engineOperational () const

Protected Attributes

DtRotaryWingEntityStateRepositorymyRotaryWingEntityState
DtRotaryWingActuatorDescriptormyRotaryWingActuatorDescriptor
DtReal myMaxDragAcceleration
DtVector myBodyRotationalAcceleration
DtVector myBodyRotationRates
DtTaitBryan myOrientation
DtDcm myBodyToLocalMatrix
DtDcm myLocalToBodyMatrix
DtReal mySpeedRatioSquared
DtVector myBodyVelocity
DtVector myNormalizedBodyVelocity
DtVector myBodyDrag
DtVector myBodyGravity
DtVector myBodyLift
DtVector myBodyAcceleration
DtVector myRelativeAcceleration
DtVector myRelativeVelocity
DtReal mySpeed
DtVector myLocalPosition
DtVector myLocalOrientation
DtReal myAltitude
DtVector myPreviousGroundClampedPosition
bool myPrintedOutOfFuelMessage
DtRotaryWingFlightPSRmyProcessState
 Container for state data associated with this component.
Ports and Port Groups
DtInputPortGroupmyRotaryWingControlPortGroup
 Input Port Group Name: rotary-wing-control
Input Port Group Description:
DtConstrainedAnalogInputPortmyThrottlePort
 Input Port Name: throttle
Input Port Description:
Input Port Range: 0.
DtConstrainedDualAxisAnalogInputPortmyCyclicPort
 Input Port Name: cyclic
Input Port Description:
Input Port Range: X: -1.
DtConstrainedAnalogInputPortmyPedalPort
 Input Port Name: pedal
Input Port Description:
Input Port Range: -1.
DtConstrainedAnalogInputPortmyCollectivePort
 Input Port Name: collective
Input Port Description:
Input Port Range: 0.

Private Member Functions

 DtRotaryWingActuatorComponent ()
 default constructor; not implemented
 DtRotaryWingActuatorComponent (const DtRotaryWingActuatorComponent &orig)
 copy constructor; not implemented
DtRotaryWingActuatorComponentoperator= (const DtRotaryWingActuatorComponent &orig)
 assignment operator; not implemented

Detailed Description

DtRotaryWingActuatorComponent is a kinematics-based model of a rotary wing aircraft that converts collective, cyclic, and pedal into acceleration, velocity, position, rotational velocity, and orientation.

End User Description: In addition, the actuator implements ground detection.

Uses Descriptor Type: DtRotaryWingActuatorDescriptor


Constructor & Destructor Documentation

DtRotaryWingActuatorComponent::DtRotaryWingActuatorComponent ( 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 Removes process state from process state manager before deleting it.

default constructor; not implemented

copy constructor; not implemented


Member Function Documentation

to get access to the entity's localStateRepository, which this component will update, and then connect to the controller's ports.

Reimplemented from DtActuatorComponent.

virtual DtString DtRotaryWingActuatorComponent::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:
DtRotaryWingActuatorType

Reimplemented from DtSimComponent.

virtual void DtRotaryWingActuatorComponent::tick ( ) [virtual]

Calculate new kinematic state.

Reimplemented from DtSimComponent.

virtual void DtRotaryWingActuatorComponent::useFuel ( double  fuelUsed) [virtual]

Fuel manipulation functions.

Assumes the fuel resource has resource name "fuel" If not found, fuel consumption not will not be modeled.

virtual double DtRotaryWingActuatorComponent::fuelLeft ( ) const [virtual]
virtual double DtRotaryWingActuatorComponent::calculateFuel ( ) const [virtual]

Calculate the fuel used in the last time step.

virtual void DtRotaryWingActuatorComponent::fallFromSky ( ) [virtual]

This member function is called when an entity has been destroyed and is still in the air.

The only acceleration applied is gravity. All rotation rates are set to 0.0. When the entity intersects the ground, a detonation interaction is generated at the point of impact. A munition type of <2, 0, 0, 0, 0, 0, 0> is used.

static DtSimComponent* DtRotaryWingActuatorComponent::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 DtRotaryWingActuatorComponent::createPortGroups ( ) [protected, virtual]

Creates the local port groups.

Reimplemented from DtSimComponent.

virtual bool DtRotaryWingActuatorComponent::createPorts ( ) [protected, virtual]

Creates the input ports and adds them to the component.

Reimplemented from DtSimComponent.

virtual bool DtRotaryWingActuatorComponent::createPSR ( ) [protected, virtual]

Creates myProcessState data member, and adds it to our process state repository manager.

Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.

virtual void DtRotaryWingActuatorComponent::clampFrameRate ( ) [protected, virtual]

Clamp the frame rate if the rate is too slow.

virtual void DtRotaryWingActuatorComponent::setLanded ( const DtVector localIntersectionPoint) [protected, virtual]

Sets the parameters for a landed entity.

Check to see if the entity is flying without fuel, and call fallFromSky if so.

virtual void DtRotaryWingActuatorComponent::calculateYawAcceleration ( ) [protected, virtual]

Find yaw acceleration and new rate.

virtual void DtRotaryWingActuatorComponent::calculateYawRate ( ) [protected, virtual]
virtual void DtRotaryWingActuatorComponent::calculatePitchAcceleration ( ) [protected, virtual]

Find pitch acceleration and new rate.

virtual void DtRotaryWingActuatorComponent::calculatePitchRate ( ) [protected, virtual]
virtual void DtRotaryWingActuatorComponent::calculateRollAcceleration ( ) [protected, virtual]

Find roll acceleration and new rate.

virtual void DtRotaryWingActuatorComponent::calculateRollRate ( ) [protected, virtual]
virtual void DtRotaryWingActuatorComponent::calculateOrientation ( ) [protected, virtual]

Uses current local orientation, rotationRates in SR, and dT.

Results placed in object pointed to by orientation argument.

Put current velocity into body coordinates (AFTER rotating body).

virtual void DtRotaryWingActuatorComponent::calculateBodyGravity ( ) [protected, virtual]

Put acceleration due to gravity in body coordinates.

virtual void DtRotaryWingActuatorComponent::calculateLiftAcceleration ( ) [protected, virtual]

Calculate scalar accel in direction of lift (perpendicular to wings).

virtual void DtRotaryWingActuatorComponent::calculateDragAcceleration ( ) [protected, virtual]

Calculate scalar drag accel opposite direction of current velocity.

Sum the accelerations produced by forces acting on the body, and put the result into world coordinates.

virtual void DtRotaryWingActuatorComponent::integrate ( ) [protected, virtual]

Find the new velocity and position.

virtual void DtRotaryWingActuatorComponent::updateRepository ( ) [protected, virtual]

Sets the state to locally calculated values.

virtual void DtRotaryWingActuatorComponent::updateDisplay ( ) const [protected, virtual]

Can be used to print control values in the console window.

virtual void DtRotaryWingActuatorComponent::checkLandedOrCrashed ( ) [protected, virtual]

Check if the entity landed on the ground or crashed.

If landed, ground clamp the actuator. If crashed, set isDestroyed and isSmoking. Checks to see if the entity is below ground. If it is, the entity is set to destroyed, flaming, and smoking. Its velocity and acceleration vectors are set to <0.0, 0.0, 0.0>, and its Z-coordinate is set to the height of the terrain at that <X, Y> coordinate. If it is not below ground, checkLandedOrCrashed() checks to see if the following criteria are met for being in a landed state: Velocity along the (database) Z axis is greater than -3.0 meters/second, but less than 2.0 * dT meters/second Height above terrain is less than 2.0 meters Overall entity speed is less than 4.0 meters/second. If one or more of these criteria is false, checkLandedOrCrashed() sets the SR Landed flag to false and returns. Otherwise, the variables myLandPosition and myLandHeading are set to the entity’s current position and heading, and DtRotaryWingEntity::land() is called. The velocity, acceleration, and rotational velocity vectors are all set to <0.0, 0.0, 0.0>.

virtual bool DtRotaryWingActuatorComponent::isCrashedIntoGround ( const DtVector localPosition,
DtVector localIntersectionPoint 
) const [protected, virtual]

Determines if the entity has crashed into the ground.

Returns:
A boolean indicating whether or not the entity has crashed into the ground.
Parameters:
localPositionThe position to test, in database coordinates.
physWorldThe physicalWorld to test against.
localIntersectionPointThis parameter is filled with the results of the intersection test with the terrain database.
Note:
The localIntersectionPoint is always calculated, even if the entity has not crashed into the ground.
virtual void DtRotaryWingActuatorComponent::sendDetonation ( const DtVector geocentricLocation) const [protected, virtual]

Sends a detonation interaction at the specified location, in geocentric coordinates.

virtual bool DtRotaryWingActuatorComponent::isSubsurface ( ) const [protected, virtual]

Determine whether or not the configured entity is a subsurface entity or not.

Returns:
True if the configured entity is a subsurface and false if it isn't.
Note:
This is not intended for general use, as it will most likely be removed when proper subsurface components are developed.
virtual bool DtRotaryWingActuatorComponent::componentInitialized ( ) const [protected, virtual]

Determine if the component has been properly initialized.

The component must have a valid sim manager, entity state, actuator descriptor, and process state rep to be initialized properly. Additionally, it must have a valid terrain database, a valid coordinate system in the terrain database, and a valid exercise clock in order to be used. If any of these are missing, then the function returns false.

Returns:
True if the component is initialized and ready to be ticked.
virtual bool DtRotaryWingActuatorComponent::engineOperational ( ) const [protected, virtual]
Returns:
True as long as the entity is not destroyed and the entity is not "mobility killed", based on its appearance.
DtRotaryWingActuatorComponent& DtRotaryWingActuatorComponent::operator= ( const DtRotaryWingActuatorComponent orig) [private]

assignment operator; not implemented


Member Data Documentation

Input Port Group Name: rotary-wing-control
Input Port Group Description:

Input Port Name: throttle
Input Port Description:
Input Port Range: 0.

to 1.
Input Port Default Value:
Input Group Parent: rotary-wing-control

Input Port Name: cyclic
Input Port Description:
Input Port Range: X: -1.

to 1. Y: -1. to 1.
Input Port Default Value:
Input Group Parent: rotary-wing-control

Input Port Name: pedal
Input Port Description:
Input Port Range: -1.

to 1.
Input Port Default Value:
Input Group Parent: rotary-wing-control

Input Port Name: collective
Input Port Description:
Input Port Range: 0.

to 1.
Input Port Default Value:
Input Group Parent: rotary-wing-control

Container for state data associated with this component.

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)