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

DtFixedWingLandingController is a controller that models landing for fixed-wing entities. More...

Inheritance diagram for DtFixedWingLandingController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtFixedWingLandingController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtFixedWingLandingController ()
 destructor
virtual bool init ()
 Initializes any state that is needed.
virtual bool postAddComponentsInit ()
 Called after all components have been created, initialized and added to the component manager.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool tickWhileDestroyed () const
 Overridden so that controller can delete any control point it created when the entity is destroyed.

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 void registerTaskMsgCallbacks ()
 Override for interest of landing tasks.
virtual void tick ()
 Ticks and performs current state.
virtual void clearCurrentTaskMessage ()
 Resets state flag to DtIdle.
virtual void clearTask ()
 Override to clear out any subtasks we might have.
virtual void removeControlPoint ()
 Removes any control points created by this task.
virtual bool createPSR ()
 Tasks.
DtFixedWingFlightPSRlookupFixedWingFlightPSR ()
 Looks up the fixed wing flight PSR in the PSR manager, and returns it.
virtual bool createPorts ()
 Creates the landing gear control port.
virtual void processTaskComplete (DtSimMessage *msg)
virtual void processLandingStripChanged (DtVrfObject *)
virtual void processLandingTask (DtSimMessage *msg)
 Starts the processing of the landing task.
virtual void processDeleteVrfObjectCallback (DtVrfObject *obj)
virtual bool generateApproachRoute ()
 Creates the approach point to start the landing process (the point from which the fixed wing will move to the landing vector).
virtual bool generateLandingRoute ()
 Creates a route for the final landing phase.
virtual void setState (DtVrfFixedWingLandingPSR::DtLandingControllerState)
 Sets state in PSR and returns state from PSR.
virtual
DtVrfFixedWingLandingPSR::DtLandingControllerState 
state () const
virtual void initRunwayCoordTransform (const DtVector &runwayStartLocal, const DtVector &runwayEndLocal, DtCoordTransform &resultTransform) const
virtual double calculateDecelerationConstant () const
 Calculates the acceleration (average) needed to get from point A to point B, given a starting speed of the current ordered speed and ending speed of landing speed.
virtual double calculateApproachSpeed () const
 Calculates the speed needed to have at start of approach route.
virtual void setupExistingConditions ()
 Sets up any initial conditions on the first tick.
virtual void setApproachSpeed ()
 Sends a setSpeed message to the entity with the appropriate approach speed.
virtual void flyingAlongApproachRoute ()
 Called while the entity is flying along the approach route.
virtual void moveAlongLandingStrip ()
 Called when the pre-approach task is complete and the plane will now be tasked to move along the landing strip.
virtual void movingAlongLandingStrip ()
 Currently no-ops.
virtual bool moveAlongLandingRouteRemainder ()
 If the landing route has more than two vertices, issue a move-along task (with start-at-closest-vertex set to true) to move the plane along the remainder of the route.
virtual bool checkPositionOnFinalLeg ()
 Checks if the entity is positioned for the final approach leg.
virtual void flyingTowardsApproachRoute ()
 Called until while the entity is maneuvering toward the approach route.
virtual bool createApproachRoutePoints ()
 Sets the point for the approach route and assigns them to the current controlPoint.
virtual void setLandingAppearanceState ()
 Sets the state when the plane is the appropriate distance from the end of the approach route.
virtual double decelerationDistance () const
 Returns the distance required to slow from the current speed to the approach speed.

Static Protected Member Functions

static void taskCompleteReportCallback (DtSimMessage *msg, void *usr)
 Monitor taskReportComplete callback to see when our flyTo task is complete during so we can fly to the landing strip.
static void landingStripChanged (DtVrfObject *obj, void *userData)
 Called when points on the landing strip have changed.
static void landingTaskCallback (DtSimMessage *msg, void *usr)
static void deleteVrfObjectCallback (DtVrfObject *msg, void *usr)
 If an object is deleted and it is the object we are trying to land on, then stop the current land task.

Protected Attributes

DtVrfObjectmyControlPoint
 If this entity islanding, the path the entity is moving on to approach the landing strip.
DtVrfFixedWingLandingPSRmyProcessState
 Container for state data associated with this component.
DtFixedWingLandingDescriptormyFixedWingLandingDescriptor
DtFixedWingEntityStateRepositorymyFixedWingEntityState
DtFixedWingFlightPSRmyFixedWingFlightPSR
bool myFirstTick
bool myWaiting
bool myLandingStripChanged
Ports and Port Groups
DtBooleanOutputPortmyLandingGearControlPort
 Output Port Name: landing-gear-control
Output Port Description: Desired position of the landing gear.

Private Member Functions

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

Detailed Description

DtFixedWingLandingController is a controller that models landing for fixed-wing entities.

End User Description: It create the routes and tasks necessary to move a fixed wing aircraft into position to land on a landing strip specified in a landing task.

Uses Descriptor Type: DtFixedWingLandingDescriptor

DtFixedWingLandingController model description


Constructor & Destructor Documentation

DtFixedWingLandingController::DtFixedWingLandingController ( 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

Initializes any state that is needed.

Reimplemented from DtControllerComponent.

Called after all components have been created, initialized and added to the component manager.

Override this function if you need to do any further initialization after all other components have been created.

Reimplemented from DtSimComponent.

virtual DtString DtFixedWingLandingController::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:
DtFixedWingLandingControllerType

Implements DtTaskControllerComponent.

Overridden so that controller can delete any control point it created when the entity is destroyed.

Reimplemented from DtSimComponent.

static DtSimComponent* DtFixedWingLandingController::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 void DtFixedWingLandingController::registerTaskMsgCallbacks ( ) [protected, virtual]

Override for interest of landing tasks.

Reimplemented from DtTaskControllerComponent.

virtual void DtFixedWingLandingController::tick ( ) [protected, virtual]

Ticks and performs current state.

Reimplemented from DtSimComponent.

virtual void DtFixedWingLandingController::clearCurrentTaskMessage ( ) [protected, virtual]

Resets state flag to DtIdle.

Reimplemented from DtSingleTaskControllerComponent.

virtual void DtFixedWingLandingController::clearTask ( ) [protected, virtual]

Override to clear out any subtasks we might have.

Reimplemented from DtSingleTaskControllerComponent.

virtual void DtFixedWingLandingController::removeControlPoint ( ) [protected, virtual]

Removes any control points created by this task.

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

Tasks.

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.

Looks up the fixed wing flight PSR in the PSR manager, and returns it.

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

Creates the landing gear control port.

Reimplemented from DtSimComponent.

static void DtFixedWingLandingController::taskCompleteReportCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]

Monitor taskReportComplete callback to see when our flyTo task is complete during so we can fly to the landing strip.

virtual void DtFixedWingLandingController::processTaskComplete ( DtSimMessage msg) [protected, virtual]
static void DtFixedWingLandingController::landingStripChanged ( DtVrfObject obj,
void *  userData 
) [static, protected]

Called when points on the landing strip have changed.

Will signal to redo the last point on the landing route

virtual void DtFixedWingLandingController::processLandingStripChanged ( DtVrfObject ) [protected, virtual]
virtual void DtFixedWingLandingController::processLandingTask ( DtSimMessage msg) [protected, virtual]

Starts the processing of the landing task.

This will create the route used to approach the landing strip and then issue a move along for that route. Once that move along is complete, the move along to the landing strip will then be issued

static void DtFixedWingLandingController::landingTaskCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
static void DtFixedWingLandingController::deleteVrfObjectCallback ( DtVrfObject msg,
void *  usr 
) [static, protected]

If an object is deleted and it is the object we are trying to land on, then stop the current land task.

virtual void DtFixedWingLandingController::processDeleteVrfObjectCallback ( DtVrfObject obj) [protected, virtual]

Creates the approach point to start the landing process (the point from which the fixed wing will move to the landing vector).

Once the route is generated, the plane will be given the task to move along that route and the state will be changed to DtLandingStateWaitingToSetApproachSpeed. Once the plane has started on the route, it's ordered speed will be changed to be that of the initial approach speed

virtual bool DtFixedWingLandingController::generateLandingRoute ( ) [protected, virtual]

Creates a route for the final landing phase.

It will be just above the approach end of the specified runway, and then descend onto the runway surface.

Sets state in PSR and returns state from PSR.

virtual void DtFixedWingLandingController::initRunwayCoordTransform ( const DtVector runwayStartLocal,
const DtVector runwayEndLocal,
DtCoordTransform &  resultTransform 
) const [protected, virtual]
virtual double DtFixedWingLandingController::calculateDecelerationConstant ( ) const [protected, virtual]

Calculates the acceleration (average) needed to get from point A to point B, given a starting speed of the current ordered speed and ending speed of landing speed.

virtual double DtFixedWingLandingController::calculateApproachSpeed ( ) const [protected, virtual]

Calculates the speed needed to have at start of approach route.

virtual void DtFixedWingLandingController::setupExistingConditions ( ) [protected, virtual]

Sets up any initial conditions on the first tick.

virtual void DtFixedWingLandingController::setApproachSpeed ( ) [protected, virtual]

Sends a setSpeed message to the entity with the appropriate approach speed.

Sets the approachSpeedSet() value to true in the PSR.

virtual void DtFixedWingLandingController::flyingAlongApproachRoute ( ) [protected, virtual]

Called while the entity is flying along the approach route.

Currently checks to see if the last point needs to be changed due to distance tolerance

virtual void DtFixedWingLandingController::moveAlongLandingStrip ( ) [protected, virtual]

Called when the pre-approach task is complete and the plane will now be tasked to move along the landing strip.

The state will then be set to DtLandingStateMovingAlongLandingStrip

virtual void DtFixedWingLandingController::movingAlongLandingStrip ( ) [protected, virtual]

Currently no-ops.

If the landing route has more than two vertices, issue a move-along task (with start-at-closest-vertex set to true) to move the plane along the remainder of the route.

Sets the state to DtLandingStateMovingAlongLandingRouteRemainder in this case.

Returns:
True if issues the move task, or false if there are no more vertices.

Checks if the entity is positioned for the final approach leg.

Returns:
True if the plane is within the prescribed angle of the straight in leg to the runway.
virtual void DtFixedWingLandingController::flyingTowardsApproachRoute ( ) [protected, virtual]

Called until while the entity is maneuvering toward the approach route.

This state is finished when the entity is moving along the approach route and is checkPositionOnFinalLeg() returns true.

Sets the point for the approach route and assigns them to the current controlPoint.

virtual void DtFixedWingLandingController::setLandingAppearanceState ( ) [protected, virtual]

Sets the state when the plane is the appropriate distance from the end of the approach route.

Called each time from waitingToSetApproachSpeed() and flyingAlongApproachRoute() until light state is on. Will set landing lights on

virtual double DtFixedWingLandingController::decelerationDistance ( ) const [protected, virtual]

Returns the distance required to slow from the current speed to the approach speed.

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

assignment operator; not implemented


Member Data Documentation

If this entity islanding, the path the entity is moving on to approach the landing strip.

Container for state data associated with this component.

This state is saved and restored as part of a scenario (or checkpoint).

Output Port Name: landing-gear-control
Output Port Description: Desired position of the landing gear.

True for down, False for retracted.
Output Port Range: True/False


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)