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

DtSimpleRotaryWingPilot is a controller that represents the autopilot aspects of a rotary-wing pilot. More...

Inheritance diagram for DtSimpleRotaryWingPilot:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtSimpleRotaryWingPilot (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtSimpleRotaryWingPilot ()
 destructor
virtual void setDesiredInertialPos (DtReal localX, DtReal localY, DtReal localZ)
 Various methods to set state below.
virtual void setDesiredInertialPos (const DtVector &localPosition)
virtual void setDesiredInertialVel (DtReal vx, DtReal vy, DtReal vz)
 Desired inertial velocity, in local (database) coordinates.
virtual void setDesiredInertialVel (const DtVector &vel)
virtual bool init ()
 Calls the parent’s init() to initialize the ports.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void tick ()
 Calculate new control values.

Static Public Member Functions

static void vectorBound (DtVector &vec, DtReal bound)
 Return the vector bound at the specified magnitude.
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
static DtReal xyDistSquared (DtVector a, DtVector b)
 Calculate the distance squared between the projections of the points onto the x-y plane.

Protected Member Functions

virtual void getTransformationMatrices ()
 Sets the myBodyToRef, myLocalToTopoDcm, and myTopoToLocalDcm.
virtual void checkLandNoFuel ()
 Lands the entity if the fuel is used up.
void calculateDesiredAndActualLinearVelocity (DtVector &desiredBodyVel, DtVector &topoDesiredInertialVel, DtVector &actualBodyVel)
 Calculates the desired linear velocity and actual velocity of the entity.
virtual void calculateDesiredLinearAcceleration (const DtVector &topoDesiredInertialVel, DtVector &desiredBodyAcc)
 Calculates the desired linear acceleration of the entity.
virtual void calculateDesiredAngularVelocity (const DtVector &desiredBodyAcc, const DtVector &desiredBodyVel, const DtVector &actualBodyVel, DtVector &desiredAngularVel)
 Calculates the desired angular velocity of the entity.
virtual void calculateDesiredAngularAcceleration (const DtVector &desiredAngularVel, DtVector &desiredAngularAcc)
 Calculates the desired angular acceleration from the desired angular velocity of the entity.
virtual double calculateWhiteNoiseScaleFactor ()
 Get a scale factor for the random component.
virtual void setCyclic (const DtVector &desiredAngularAcc, double noiseFactor)
 Sets the cyclic control output value using the specified desired angular acceleration.
virtual void setCollective (const DtVector &desiredBodyAcc, double noiseFactor)
 Sets the collective control output value.
virtual void setPedal (const DtVector &desiredAngularAcc, double noiseFactor)
 Sets the pedal control output value using the specified desired angular acceleration.
virtual void setThrottle ()
 Sets the throttle control output value.
virtual void boundAcceleration (DtVector &vec)
 Caps the magnitude of the acceleration to a value found by interpolating between the maximum acceleration (along the velocity vector) and the maximum deceleration (opposite the velocity vector).
virtual DtReal terrainAvoidanceVelocity () const
 Calculate an upward desired velocity to maintain a safe distance from the terrain.
virtual void calculateControlAlignmentAngle (DtReal &alignmentAngle, bool &selector) const
 Calculate alignment based on controllers.
virtual void calculateTargetAlignmentAngle (DtReal &alignmentAngle, bool &selector) const
 calculate alignment based on targets.
virtual bool createPorts ()
 Overridden to create rotary wing ports.

Protected Attributes

DtRotaryWingPilotDescriptormyPilotDescriptor
 A pointer to the descriptor for this controller.
DtDcm myBodyToRef
 The local orientation matrix.
DtDcm myLocalToTopoDcm
 The local to topographic coordinate transformation matrix.
DtDcm myTopoToLocalDcm
 The topographic to local coordinate transformation matrix.
Ports and Port Groups
DtVectorInputPortmyTargetLocationInputPort
 Input Port Name: target-location
Input Port Description: Accepts local database location of a target which the pilot should orient the aircraft to face, in the absence of other tasks.

Private Member Functions

 DtSimpleRotaryWingPilot ()
 default constructor not implemented
 DtSimpleRotaryWingPilot (const DtSimpleRotaryWingPilot &orig)
 copy constructor not implemented
DtSimpleRotaryWingPilotoperator= (const DtSimpleRotaryWingPilot &orig)
 assignment operator not implemented

Detailed Description

DtSimpleRotaryWingPilot is a controller that represents the autopilot aspects of a rotary-wing pilot.

End User Description: It sets the helicopter controls to achieve desired position, velocity, acceleration, and orientation. These values are provided over a set of input ports. The controller than uses these values to calculate the needed control inputs for the actuator, and sends these values on the output ports.

Uses Descriptor Type: DtRotaryWingPilotDescriptor


Constructor & Destructor Documentation

DtSimpleRotaryWingPilot::DtSimpleRotaryWingPilot ( 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 void DtSimpleRotaryWingPilot::setDesiredInertialPos ( DtReal  localX,
DtReal  localY,
DtReal  localZ 
) [virtual]

Various methods to set state below.

Desired inertial position, in local (database) coordinates

virtual void DtSimpleRotaryWingPilot::setDesiredInertialPos ( const DtVector localPosition) [virtual]
virtual void DtSimpleRotaryWingPilot::setDesiredInertialVel ( DtReal  vx,
DtReal  vy,
DtReal  vz 
) [virtual]

Desired inertial velocity, in local (database) coordinates.

virtual void DtSimpleRotaryWingPilot::setDesiredInertialVel ( const DtVector vel) [virtual]
virtual bool DtSimpleRotaryWingPilot::init ( ) [virtual]

Calls the parent’s init() to initialize the ports.

Returns true if initialization was successful.

Reimplemented from DtRotaryWingPilotController.

virtual DtString DtSimpleRotaryWingPilot::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:
DtRotaryWingPilotControllerType

Reimplemented from DtRotaryWingPilotController.

static void DtSimpleRotaryWingPilot::vectorBound ( DtVector vec,
DtReal  bound 
) [static]

Return the vector bound at the specified magnitude.

virtual void DtSimpleRotaryWingPilot::tick ( ) [virtual]

Calculate new control values.

Reimplemented from DtRotaryWingPilotController.

static DtSimComponent* DtSimpleRotaryWingPilot::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.

Reimplemented from DtRotaryWingPilotController.

DtSimpleRotaryWingPilot& DtSimpleRotaryWingPilot::operator= ( const DtSimpleRotaryWingPilot orig) [private]

assignment operator not implemented

virtual void DtSimpleRotaryWingPilot::getTransformationMatrices ( ) [protected, virtual]

Sets the myBodyToRef, myLocalToTopoDcm, and myTopoToLocalDcm.

virtual void DtSimpleRotaryWingPilot::checkLandNoFuel ( ) [protected, virtual]

Lands the entity if the fuel is used up.

void DtSimpleRotaryWingPilot::calculateDesiredAndActualLinearVelocity ( DtVector desiredBodyVel,
DtVector topoDesiredInertialVel,
DtVector actualBodyVel 
) [protected]

Calculates the desired linear velocity and actual velocity of the entity.

Also provides the desired velocity in topo coordinates for use by other methods. Uses local variables: myBodyToRef, myLocalToTopoDcm, myTopoToLocalDcm

virtual void DtSimpleRotaryWingPilot::calculateDesiredLinearAcceleration ( const DtVector topoDesiredInertialVel,
DtVector desiredBodyAcc 
) [protected, virtual]

Calculates the desired linear acceleration of the entity.

Uses local variables: myBodyToRef, myLocalToTopoDcm, myTopoToLocalDcm

virtual void DtSimpleRotaryWingPilot::calculateDesiredAngularVelocity ( const DtVector desiredBodyAcc,
const DtVector desiredBodyVel,
const DtVector actualBodyVel,
DtVector desiredAngularVel 
) [protected, virtual]

Calculates the desired angular velocity of the entity.

virtual void DtSimpleRotaryWingPilot::calculateDesiredAngularAcceleration ( const DtVector desiredAngularVel,
DtVector desiredAngularAcc 
) [protected, virtual]

Calculates the desired angular acceleration from the desired angular velocity of the entity.

virtual double DtSimpleRotaryWingPilot::calculateWhiteNoiseScaleFactor ( ) [protected, virtual]

Get a scale factor for the random component.

This is scaled by the inverse of the square root of the time step to approximate Gaussian White Noise.

virtual void DtSimpleRotaryWingPilot::setCyclic ( const DtVector desiredAngularAcc,
double  noiseFactor 
) [protected, virtual]

Sets the cyclic control output value using the specified desired angular acceleration.

virtual void DtSimpleRotaryWingPilot::setCollective ( const DtVector desiredBodyAcc,
double  noiseFactor 
) [protected, virtual]

Sets the collective control output value.

virtual void DtSimpleRotaryWingPilot::setPedal ( const DtVector desiredAngularAcc,
double  noiseFactor 
) [protected, virtual]

Sets the pedal control output value using the specified desired angular acceleration.

virtual void DtSimpleRotaryWingPilot::setThrottle ( ) [protected, virtual]

Sets the throttle control output value.

virtual void DtSimpleRotaryWingPilot::boundAcceleration ( DtVector vec) [protected, virtual]

Caps the magnitude of the acceleration to a value found by interpolating between the maximum acceleration (along the velocity vector) and the maximum deceleration (opposite the velocity vector).

virtual DtReal DtSimpleRotaryWingPilot::terrainAvoidanceVelocity ( ) const [protected, virtual]

Calculate an upward desired velocity to maintain a safe distance from the terrain.

virtual void DtSimpleRotaryWingPilot::calculateControlAlignmentAngle ( DtReal &  alignmentAngle,
bool selector 
) const [protected, virtual]

Calculate alignment based on controllers.

An angle and a specifier are returned. The angle value is the amount by which the helicopter should rotate about its z-axis to align with the desired heading. If the selector is True, the angle is valid. Uses local variables: myBodyToRef

virtual void DtSimpleRotaryWingPilot::calculateTargetAlignmentAngle ( DtReal &  alignmentAngle,
bool selector 
) const [protected, virtual]

calculate alignment based on targets.

An angle and a specifier are returned. The angle is value the helicopter should rotate by about its z-axis to align with the target. If the selector is True, the angle is valid. Uses local variables: myBodyToRef

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

Overridden to create rotary wing ports.

Reimplemented from DtRotaryWingPilotController.

static DtReal DtSimpleRotaryWingPilot::xyDistSquared ( DtVector  a,
DtVector  b 
) [static]

Calculate the distance squared between the projections of the points onto the x-y plane.


Member Data Documentation

Input Port Name: target-location
Input Port Description: Accepts local database location of a target which the pilot should orient the aircraft to face, in the absence of other tasks.


Input Port Range: Local database locations.

A pointer to the descriptor for this controller.

The local orientation matrix.

The local to topographic coordinate transformation matrix.

The topographic to local coordinate transformation matrix.


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)