VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fixedWingPilotController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1999-2000 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
15 #include <matrix/LibMatrix.h>
16 #include "vrfutil/rwAirSpeedType.h"
17 
18 class DtString;
19 class DtSimManager;
24 class DtTaskMessage;
27 
30 const double DtTurningSpeedTol = 0.0556;
31 
37 const double DtLandingTolerance = 2.5;
38 
47 {
48 
49 public:
50 
54  DtVrfObject* owner,
55  DtSimManager* simManager,
56  DtComponentDescriptor* desc = 0,
57  DtReaderWriterRegistry* parentRegistry = 0);
58 
60  virtual ~DtFixedWingPilotController();
61 
63  virtual bool init();
64 
68  virtual void tick();
69 
72  virtual const char* type() const;
73 
76  virtual void clearTask();
77 
92  virtual void taxiTo(const DtVector& destination, double speed);
93 
100  virtual void taxi(double speed, double turnRate);
101 
105  virtual double calculateSteering(double turnAngle) const;
106 
109  virtual double approximateThrottle(double speed);
110 
113  virtual double calculateCurrentBrakingDistance() const;
115 
116 
129  virtual void flyTo(const DtVector& destination, double speed, double maxTerrainAvoidanceLookaheadDist = -1);
130 
136  virtual void flyToDirect(const DtVector& destination, double speed, double maxTerrainAvoidanceLookaheadDist = -1);
137 
146  virtual void fly(double speed, double turnRate, double climbRate, double maxTerrainAvoidanceLookaheadDist = -1);
147 
156  virtual void flyFixedPitch(double speed, double turnRate, double desiredPitch, double maxTerrainAvoidanceLookaheadDist = -1);
157 
161  virtual double terrainAvoidancePitch(double speed, double desiredPitch, double maxTerrainAvoidanceLookaheadDist);
162 
165  virtual bool clearPathTo(const DtVector& localPosition);
166 
192  virtual void circle(const DtVector& center, double radius, double speed,
193  double altitude, bool clockwise = true);
194 
197  virtual double calcControlForRoll(double rollRate);
198 
212  virtual double calcControlForThrottle(double speed, bool& deployFlaps);
213 
225  virtual double decelerationLimitedClimbRate(double altitudeError,
226  double desiredSpeed, double finalClimbRate = 0.0);
227 
231  virtual void calcControlForTurnAndClimb(double turnRate, double climbRate,
232  double& stickX, double& pedal);
233 
238  virtual void calcControlForTurnAndPitch(double turnRate, double desiredPitch,
239  double& stickX, double& pedal, double rollRate = 0.0);
240 
247  virtual double calculateClimbRate(double altitude, double climbTime) const;
248 
254  // turn rate = (heading change / max-turnrate-cutoff-angle) *
255  // max-pitch-rate
262  virtual double calculateTurnRate(double turnAngle, double additionalTurnRate = 0) const;
263 
266  // roll angle = ATAN((speed * turn rate * 0.5) / 9.8)
267  virtual double calculateRollAngle(double turnRate, double speed)
268  const;
269 
272  virtual double calculateRollRate(double rollAngle, double turnRate);
273 
275 
289  virtual void calculateNormalizedBodyVelocity();
290 
296  virtual void calculateLocalAngularVelocity();
297 
303  // mySpeedRatioSquared
304  virtual void calculateSpeedRatioSquared();
305 
313  virtual void initializeControllerForTick();
314 
317  virtual bool createFixedWingControlPortGroup();
318  virtual bool createThrottlePort();
319  virtual bool createStickPort();
320  virtual bool createPedalPort();
321  virtual bool createBrakePort();
322 
324  virtual bool createFlapsDeployedPort();
325 
327  virtual DtConstrainedAnalogOutputPort* throttlePort();
328  virtual DtConstrainedDualAxisAnalogOutputPort* stickPort();
329  virtual DtConstrainedAnalogOutputPort* pedalPort();
330  virtual DtConstrainedAnalogOutputPort* brakePort();
331  virtual DtBooleanOutputPort* flapsDeployedPort();
332 
334  virtual void setMaxThrustAcceleration(double maxThrustAcceleration);
335 
337  virtual void setTakeOffDir(const DtVector& takeOffDir);
338  virtual const DtVector& takeOffDir() const;
339 
342  virtual DtReal maxTurningGsForTask() const;
343  virtual DtReal maxTurnRateCutoffAngle() const;
344  virtual DtReal maxTaxiingTurnSpeed() const;
345  virtual DtReal taxiingNearDistance() const;
346  virtual DtReal taxiingAtDistance() const;
347  virtual DtReal taxiingApproachSpeed() const;
348  virtual DtReal maxPitchAngle() const;
349  virtual DtReal timeToTargetAltitude() const;
351 
355  virtual double maxTurningGs() const;
356 
359  virtual bool terrainAvoidanceEnabled();
364  virtual double terrainAvoidanceLookaheadTime();
365 
369  static DtSimComponent * creator(const DtString& name,
370  DtVrfObject* owner,
371  DtSimManager* simManager,
372  DtComponentDescriptor* desc = 0,
373  DtReaderWriterRegistry* parentRegistry = 0);
374 
375 protected:
376 
378  virtual bool createPorts();
379 
381  virtual bool createPortGroups();
382 
390  virtual void lookupAndCacheProcessSR();
391 
396  virtual bool postAddComponentsInit();
397 
400  virtual bool decideToGiveUpTask() const;
401 
406  virtual void updateCurrentState();
407 
409  virtual void processEstimatedTotCalculation();
410 
416  virtual double calculateCollisionLookAhead(const double climbRate,
417  const double speed,
418  const double desiredAltitude);
419 
421  virtual void updateTaskVisualizations();
422 
424  virtual double convertSpeedtoGroundSpeed(double speed, double currentAlt, DtAirSpeedType speedType);
425 
426 protected:
427 
430 
433  orig);
434 
438 
439 protected:
440 
442 
445 
449 
456 
463 
470 
477 
484 
486 
493 
497 
510 
512  const double DtEstimatedTotCalcInterval = 5.0;
513 
522 
523 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:146
double myCurrentHeading
Definition: fixedWingPilotController.h:505
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Instances of DtConstrainedDualAxisAnalogOutputPort are output ports through which data producers can ...
Definition: constrainedDualAxisAnalogIOPort.h:61
DtFixedWingFlightPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: fixedWingPilotController.h:492
DtVector myCurrentLocalVelocity
Definition: fixedWingPilotController.h:502
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
double myCurrentTopoRoll
Definition: fixedWingPilotController.h:507
DtConstrainedAnalogOutputPort * myThrottlePort
Output Port Name: throttle Output Port Description: Output Port Range: 0.
Definition: fixedWingPilotController.h:455
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
DtConstrainedAnalogOutputPort * myBrakePort
Output Port Name: brake Output Port Description: Output Port Range: 0.
Definition: fixedWingPilotController.h:476
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
DtOutputPortGroup is a data port group of a data provider.
Definition: outputPortGroup.h:30
DtFixedWingPilotController is a controller that models the capabilities of a fixed-wing pilot...
Definition: fixedWingPilotController.h:46
virtual bool init()
Calls setRadio()
DtConstrainedAnalogOutputPort is a version of DtAnalogOutputPort which will constrain any outgoing va...
Definition: constrainedAnalogIOPort.h:54
DtAirspeedCalculator * myAirSpeedCalculator
Air Speed Calculator for updating state properties Created in init()
Definition: fixedWingPilotController.h:496
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
double myEstimatedTotLastCalcTime
used for tot calculation intervals
Definition: fixedWingPilotController.h:519
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:487
DtDcm myCurrentOrientationMatrix
Definition: fixedWingPilotController.h:504
class DtFixedWingFlightPSR:
Definition: fixedWingFlightPSR.h:38
DtVector myEstimatedTotTextPos
tot text position
Definition: fixedWingPilotController.h:521
This repository holds all information that is common to all the forms of local fixed wing entities wi...
Definition: fixedWingEntityStateRepository.h:38
virtual void tick()
This gives the thread of control to the component.
DtConstrainedAnalogOutputPort * myPedalPort
Output Port Name: pedal Output Port Description: Output Port Range: -1.
Definition: fixedWingPilotController.h:469
const double DtLandingTolerance
This is the tolerance for determining if a control point is close enough to the terrain (and maybe la...
Definition: fixedWingPilotController.h:37
const double DtTurningSpeedTol
Allow a turn of no more than 2 degrees when moving too fast, which equals ~ 0.0556 radians...
Definition: fixedWingPilotController.h:30
DtOutputPortGroup * myFixedWingControlPortGroup
Output Port Group Name: fixed-wing-control Output Port Group Description:
Definition: fixedWingPilotController.h:448
virtual bool createPorts()
Called by init.
virtual bool decideToGiveUpTask() const
This function is used to determine if the controller should give up trying to execute the current tas...
double myCurrentSpeed
Definition: fixedWingPilotController.h:503
DtConstrainedDualAxisAnalogOutputPort * myStickPort
Output Port Name: stick Output Port Description: Output Port Range: X: -1.
Definition: fixedWingPilotController.h:462
DtAirSpeedType
Air Speed Type PDU enums.
Definition: rwAirSpeedType.h:24
class DtAirspeedCalculator:
Definition: airSpeedCalculator.h:23
virtual bool createPortGroups()
Called by init.
double myCurrentTopoPitch
Definition: fixedWingPilotController.h:506
DtDcm myLocalToTopoDcm
Definition: fixedWingPilotController.h:508
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtVector myCurrentLocalPosition
State variables updated for the current time.
Definition: fixedWingPilotController.h:501
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
double myEstimatedTotValue
the tot value
Definition: fixedWingPilotController.h:517
DtBooleanOutputPort * myFlapsDeployedPort
Output Port Name: flaps Output Port Description: Output Port Range: Output Port Default Value: true...
Definition: fixedWingPilotController.h:483
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19
DtFixedWingEntityStateRepository * myFixedWingEntityState
Definition: fixedWingPilotController.h:441
bool myEstimatedTotCalcEnabled
enabled flag for the tot calculations
Definition: fixedWingPilotController.h:515

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)