VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fixedWingActuatorComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vlpi/disEnums.h>
15 #include <matrix/LibMatrix.h>
16 
17 #if DtHLA
18 #include <vl/rtiNamespace.h>
19 #endif
20 
21 class DtString;
22 class DtSimManager;
28 
30 class DtInputPortGroup;
33 class DtBooleanInputPort;
35 
48 {
49 
50 public:
51 
55  DtVrfObject* owner,
56  DtSimManager* simManager,
57  DtComponentDescriptor* desc = 0,
58  DtReaderWriterRegistry* parentRegistry = 0);
59 
60 
65 
68  virtual bool init();
69 
72  virtual const char* type() const;
73 
76  virtual void tick();
77 
81  static DtSimComponent * creator(const DtString& name,
82  DtVrfObject* owner,
83  DtSimManager* simManager,
84  DtComponentDescriptor* desc = 0,
85  DtReaderWriterRegistry* parentRegistry = 0);
86 
87 public:
91  virtual void calculateBodyVelocity(const DtVector& oldRelativeVelocity,
92  const DtDcm& newLocalOrientation, DtVector& newBodyVelocity);
93 
97  virtual void calculateAirborneAcceleration(const DtVector oldLocalPosition,
98  double oldSpeed, const DtDcm& newLocalOrientation,
99  const DtVector& newBodyVelocity, double throttle,
100  DtVector& newRelativeAcceleration);
101 
102 protected:
103 
105  virtual void doFlying();
106 
108  virtual void doTaxiing();
109 
112  virtual bool isTouchingDown(const DtVector& newLocalPosition,
113  const DtVector& newRelativeVelocity);
114 
117  virtual bool isTakingOff(bool isOnGround, double speed);
118 
119  virtual bool updateGroundInteractionPoints(
120  DtGroundInteractionPt *left,
121  DtGroundInteractionPt *right,
122  DtGroundInteractionPt *nose,
123  DtGroundInteractionPt *center,
124  const DtDcm& localOrientation,
125  const DtVector& localPosition,
126  double halfHeightOfTerrainIntersectChord);
127 
132  virtual double calculateYawRate(double pedal);
133 
135  virtual double calculatePitchRate(double stickYValue);
136 
138  virtual double calculateRollRate(double stickXValue);
139 
140  virtual void calculateBodyRotationRates(double pedal, double stickXValue,
141  double stickYValue, DtVector& newBodyRotationRates);
142 
145  virtual void calculateOrientation(const DtDcm&
146  oldLocalOrientation, const DtVector& newBodyRotationRates,
147  DtDcm& newLocalOrientation);
148 
150  virtual void calculateBodyGravity(const DtVector oldLocalPosition,
151  const DtDcm& newLocalOrientation, DtVector& newBodyGravityAcceleration);
152 
155  virtual void calculateThrustAcceleration(double throttle,
156  DtVector& newBodyThrustAccleration);
157 
162  virtual void calculateDragAcceleration(double oldSpeed,
163  const DtVector& newBodyVelocity, bool flapsDeployed,
164  DtVector& newBodyDragAccleration);
165 
170  virtual void fallFromSky(const DtString& reason = DtString::nullString());
171 
172  virtual bool collidesWithGround(const DtVector& oldLocalPosition,
173  const DtVector& newLocalPosition, DtVector& localCenterGoundPosition);
174 
176  void integrate(const DtVector& oldLocalPosition,
177  const DtVector& oldRelativeVelocity,
178  const DtVector& newRelativeAcceleration, DtVector& newLocalPosition,
179  DtVector& newRelativeVelocity,
180  double maxSpeed = 0);
181 
183 
186  virtual void useFuel(double fuelUsed);
187  virtual double fuelLeft() const;
188 
190  virtual double fullMass() const;
191 
193  virtual double currentMass() const;
194 
199  virtual double calculateHeading(double oldHeading,
200  double steering, double dT, double speed, double turningRadius);
202  virtual void calculateScalarVelocityAndAcceleration(
203  double oldPitch, double &scalarVelocity, double &scalarAcceleration);
204  virtual double calculateMaxGroundSpeed();
205  virtual double calculateMaxGroundAcceleration();
209  virtual double calculateAcceleration(double pitch, double maxSpeed,
210  double maxAccel, double newSpeed);
211  virtual double calculateAccelerationFromThrottle();
212 
214  virtual double calculateAccelerationFromSlope(double slope);
215 
216  virtual double calculateAccelerationFromResistance(double maxSpeed,
217  double maxAccel);
218  virtual double calculateAccelerationFromBrake(double otherAccels);
219 
220  virtual DtVector calculateProjectedLocation(
221  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
222  const DtVector& oldBodyVelocity, double newHeading);
223 
224  virtual void calculateOrientationAndPositionOnGround(
225  const DtVector& newLocalProjectedLocation, double newHeading,
226  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
228 
229  virtual void updateRepository(const DtVector& newLocalPosition,
230  const DtVector& newRelativeVelocity,
231  const DtVector& newRelativeAcceleration,
232  const DtDcm& newLocalOrientation, const DtVector& newBodyRotationRates,
233  bool isOnGround, const DtAppearance& newAppearance);
234 
248  virtual void updateAirspeedToRepository(const DtVector& newLocalPosition, const double altitude);
249 
250  virtual void updateDisplay() const;
251 
254  virtual double maxThrustAcceleration() const;
255  virtual double maxClimbRate() const;
256  virtual double maxYawVelocity() const;
257  virtual double maxPitchVelocity() const;
258  virtual double maxRollVelocity() const;
259  virtual double maxAltitude() const;
260 
262  virtual bool createPortGroups();
263 
265  virtual bool createPorts();
266 
272  virtual bool createPSR();
273 
275  virtual bool createFuelConsumptionModel();
276 
277  virtual void sendDetonation(const DtVector& geocentricPosition);
278 
280  virtual void forceSpatialUpdate();
281 
282 #if DtHLA
283  virtual void initializeSpatialAttributeList();
285 #endif
286 
287 protected:
288 
291 
294 
298 
299 protected:
300 
304 
307 
312 
319 
326 
333 
340 
347 
349 
353 
356 
359 
363 
366 
370 
371 #if DtHLA
372  RTI::AttributeHandleSet* mySpatialAttributes;
376 #endif
377 };
Contains class declarations for DtConstrainedDualAxisInputPort and DtConstrainedDualAxisOutputPort.
Definition: constrainedDualAxisAnalogIOPort.h:27
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
virtual bool init()
Overridden to cache a pointer to the entity&#39;s radio in this class.
Contains class declarations for DtConstrainedAnalogInputPort and DtConstrainedAnalogOutputPort.
Definition: constrainedAnalogIOPort.h:27
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
bool mySentFallingMessage
Used to make sure fall message is only sent once.
Definition: fixedWingActuatorComponent.h:355
DtInputPortGroup * myFixedWingControlPortGroup
Input Port Group Name: fixed-wing-control Input Port Group Description: Provides input to the fixed-w...
Definition: fixedWingActuatorComponent.h:311
End User Description: DtActuator is the base class for all actuator model components.
Definition: actuatorComponent.h:48
DtFixedWingFlightPSR * myProcessState
Container for state data associated with this component.
Definition: fixedWingActuatorComponent.h:352
Implements the Breguet range equation V(L/D) Range = ---—*ln(Wi/Wf) g*SFC V = Velocity L/D = Lift/Dra...
Definition: aircraftFuelConsumptionModel.h:28
class DtFixedWingFlightPSR:
Definition: fixedWingFlightPSR.h:38
DtConstrainedAnalogInputPort * myThrottlePort
Input Port Name: throttle Input Port Description: Input Port Range: 0.
Definition: fixedWingActuatorComponent.h:318
bool myPreviouslyHadData
Definition: fixedWingActuatorComponent.h:364
This repository holds all information that is common to all the forms of local fixed wing entities wi...
Definition: fixedWingEntityStateRepository.h:37
virtual void tick()
This gives the thread of control to the component.
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtAircraftFuelConsumptionModel * myFuelConsumptionModel
Definition: fixedWingActuatorComponent.h:303
DtAirspeedCalculator * pMyAirSpeedCalculator
Air Speed Calculator for updating state properties Created in init()
Definition: fixedWingActuatorComponent.h:369
virtual bool createPorts()
Called by init.
class DtAirspeedCalculator:
Definition: airSpeedCalculator.h:20
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
Class Invariant: The DtGroundInteractionPt class must always have a valid DtAttachedTerrain or DtSimM...
Definition: groundInteractionPt.h:28
DtInputPortGroup is a data port group of a data consumer.
Definition: inputPortGroup.h:32
DtBooleanInputPort * myFlapsDeployedPort
Input Port Name: flaps Input Port Description: Input Port Range: Input Port Default Value: false In...
Definition: fixedWingActuatorComponent.h:346
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
Port group used to set what values should be set into the VRF state repository.
Definition: fixedWingActuatorComponent.h:362
bool myPutTaxiingPlaneOnGround
Used to make sure a taxiing, destroyed aircraft is only set down on the terrain once.
Definition: fixedWingActuatorComponent.h:358
DtFixedWingActuatorDescriptor, a descriptor for the DtFixedWingActuatorComponent component.
Definition: fixedWingActuatorDescriptor.h:29
bool myKeepParentPosition
Definition: fixedWingActuatorComponent.h:365
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:28
DtFixedWingActuatorDescriptor * myFixedWingActuatorDescriptor
Definition: fixedWingActuatorComponent.h:302
DtConstrainedAnalogInputPort * myBrakePort
Input Port Name: brake Input Port Description: Input Port Range: 0.
Definition: fixedWingActuatorComponent.h:339
virtual const char * type() const =0
Returns a string identifies the class type of component.
DtFixedWingActuatorComponent provides a simple, kinematics-based model for air motion based on thrott...
Definition: fixedWingActuatorComponent.h:47
DtConstrainedAnalogInputPort * myPedalPort
Input Port Name: pedal Input Port Description: Input Port Range: -1.
Definition: fixedWingActuatorComponent.h:332
DtConstrainedDualAxisAnalogInputPort * myStickPort
Input Port Name: stick Input Port Description: Input Port Range: X:-1.
Definition: fixedWingActuatorComponent.h:325
DtFixedWingEntityStateRepository * myFixedWingEntityState
Definition: fixedWingActuatorComponent.h:301

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)