VR-Forces 4.10 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 
47 
48 #include "vrfutil/rwAirSpeedType.h"
49 
51 {
52 public:
53 
57  DtVrfObject* owner,
58  DtSimManager* simManager,
59  DtComponentDescriptor* desc = 0,
60  DtReaderWriterRegistry* parentRegistry = 0);
61 
62 
67 
70  virtual bool init();
71 
74  virtual const char* type() const;
75 
78  virtual void tick();
79 
83  static DtSimComponent * creator(const DtString& name,
84  DtVrfObject* owner,
85  DtSimManager* simManager,
86  DtComponentDescriptor* desc = 0,
87  DtReaderWriterRegistry* parentRegistry = 0);
88 
89 public:
93  virtual void calculateBodyVelocity(const DtVector& oldRelativeVelocity,
94  const DtDcm& newLocalOrientation, DtVector& newBodyVelocity);
95 
99  virtual void calculateAirborneAcceleration(const DtVector oldLocalPosition,
100  double oldSpeed, const DtDcm& newLocalOrientation,
101  const DtVector& newBodyVelocity, double throttle,
102  DtVector& newRelativeAcceleration);
103 
104 protected:
105 
107  virtual void doFlying();
108 
110  virtual void doTaxiing();
111 
114  virtual bool isTouchingDown(const DtVector& newLocalPosition,
115  const DtVector& newRelativeVelocity);
116 
119  virtual bool isTakingOff(bool isOnGround, double speed);
120 
121  virtual bool updateGroundInteractionPoints(
122  DtGroundInteractionPt *left,
123  DtGroundInteractionPt *right,
124  DtGroundInteractionPt *nose,
125  DtGroundInteractionPt *center,
126  const DtDcm& localOrientation,
127  const DtVector& localPosition,
128  double halfHeightOfTerrainIntersectChord);
129 
134  virtual double calculateYawRate(double pedal);
135 
137  virtual double calculatePitchRate(double stickYValue);
138 
140  virtual double calculateRollRate(double stickXValue);
141 
142  virtual void calculateBodyRotationRates(double pedal, double stickXValue,
143  double stickYValue, DtVector& newBodyRotationRates);
144 
147  virtual void calculateOrientation(const DtDcm&
148  oldLocalOrientation, const DtVector& newBodyRotationRates,
149  DtDcm& newLocalOrientation);
150 
152  virtual void calculateBodyGravity(const DtVector oldLocalPosition,
153  const DtDcm& newLocalOrientation, DtVector& newBodyGravityAcceleration);
154 
157  virtual void calculateThrustAcceleration(double throttle,
158  DtVector& newBodyThrustAccleration);
159 
164  virtual void calculateDragAcceleration(double oldSpeed,
165  const DtVector& newBodyVelocity, bool flapsDeployed,
166  DtVector& newBodyDragAccleration);
167 
172  virtual void fallFromSky(const DtString& reason = DtString::nullString());
173 
174  virtual bool collidesWithGround(const DtVector& oldLocalPosition,
175  const DtVector& newLocalPosition, DtVector& localCenterGoundPosition);
176 
178  void integrate(const DtVector& oldLocalPosition,
179  const DtVector& oldRelativeVelocity,
180  const DtVector& newRelativeAcceleration, DtVector& newLocalPosition,
181  DtVector& newRelativeVelocity,
182  double maxSpeed = 0);
183 
185 
188  virtual void useFuel(double fuelUsed);
189  virtual double fuelLeft() const;
190 
192  virtual double fullMass() const;
193 
195  virtual double currentMass() const;
196 
201  virtual double calculateHeading(double oldHeading,
202  double steering, double dT, double speed, double turningRadius);
204  virtual void calculateScalarVelocityAndAcceleration(
205  double oldPitch, double &scalarVelocity, double &scalarAcceleration);
206  virtual double calculateMaxGroundSpeed();
207  virtual double calculateMaxGroundAcceleration();
211  virtual double calculateAcceleration(double pitch, double maxSpeed,
212  double maxAccel, double newSpeed);
213  virtual double calculateAccelerationFromThrottle();
214 
216  virtual double calculateAccelerationFromSlope(double slope);
217 
218  virtual double calculateAccelerationFromResistance(double maxSpeed,
219  double maxAccel);
220  virtual double calculateAccelerationFromBrake(double otherAccels);
221 
222  virtual DtVector calculateProjectedLocation(
223  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
224  const DtVector& oldBodyVelocity, double newHeading);
225 
226  virtual void calculateOrientationAndPositionOnGround(
227  const DtVector& newLocalProjectedLocation, double newHeading,
228  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
230 
231  virtual void updateRepository(const DtVector& newLocalPosition,
232  const DtVector& newRelativeVelocity,
233  const DtVector& newRelativeAcceleration,
234  const DtDcm& newLocalOrientation, const DtVector& newBodyRotationRates,
235  bool isOnGround, const DtAppearance& newAppearance);
236 
250  virtual void updateAirspeedToRepository(const DtVector& newLocalPosition, const double altitude);
251 
252  virtual void updateDisplay() const;
253 
256  virtual double maxThrustAcceleration() const;
257  virtual double maxClimbRate() const;
258  virtual double maxYawVelocity() const;
259  virtual double maxPitchVelocity() const;
260  virtual double maxRollVelocity() const;
261  virtual double maxAltitude() const;
262 
264  virtual bool createPortGroups();
265 
267  virtual bool createPorts();
268 
274  virtual bool createPSR();
275 
277  virtual bool createFuelConsumptionModel();
278 
279  virtual void sendDetonation(const DtVector& geocentricPosition);
280 
282  virtual void forceSpatialUpdate();
283 
285  virtual void updateOrderedSpeed();
286 
287 #if DtHLA
288  virtual void initializeSpatialAttributeList();
290 #endif
291 
292 protected:
293 
296 
299 
303 
304 protected:
305 
309 
312 
317 
324 
331 
338 
345 
352 
354 
358 
361 
364 
368 
371 
375 
380  double myLastSpeed;
381 
382 #if DtHLA
383  RTI::AttributeHandleSet* mySpatialAttributes;
387 #endif
388 };
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
DtAirspeedCalculator * myAirSpeedCalculator
Air Speed Calculator for updating state properties Created in init()
Definition: fixedWingActuatorComponent.h:374
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
double myLastSpeed
myLastSpeed is used in tick() to catch velocity changes while paused, due to setCurrentSpeed() or set...
Definition: fixedWingActuatorComponent.h:380
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:360
DtInputPortGroup * myFixedWingControlPortGroup
Input Port Group Name: fixed-wing-control Input Port Group Description: Provides input to the fixed-w...
Definition: fixedWingActuatorComponent.h:316
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:357
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:323
bool myPreviouslyHadData
Definition: fixedWingActuatorComponent.h:369
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.
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtAircraftFuelConsumptionModel * myFuelConsumptionModel
Definition: fixedWingActuatorComponent.h:308
virtual bool createPorts()
Called by init.
class DtAirspeedCalculator:
Definition: airSpeedCalculator.h:23
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:351
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
Port group used to set what values should be set into the VRF state repository.
Definition: fixedWingActuatorComponent.h:367
bool myPutTaxiingPlaneOnGround
Used to make sure a taxiing, destroyed aircraft is only set down on the terrain once.
Definition: fixedWingActuatorComponent.h:363
DtFixedWingActuatorDescriptor, a descriptor for the DtFixedWingActuatorComponent component.
Definition: fixedWingActuatorDescriptor.h:29
bool myKeepParentPosition
Definition: fixedWingActuatorComponent.h:370
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:28
DtFixedWingActuatorDescriptor * myFixedWingActuatorDescriptor
Definition: fixedWingActuatorComponent.h:307
DtConstrainedAnalogInputPort * myBrakePort
Input Port Name: brake Input Port Description: Input Port Range: 0.
Definition: fixedWingActuatorComponent.h:344
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:50
DtConstrainedAnalogInputPort * myPedalPort
Input Port Name: pedal Input Port Description: Input Port Range: -1.
Definition: fixedWingActuatorComponent.h:337
DtConstrainedDualAxisAnalogInputPort * myStickPort
Input Port Name: stick Input Port Description: Input Port Range: X:-1.
Definition: fixedWingActuatorComponent.h:330
DtFixedWingEntityStateRepository * myFixedWingEntityState
Definition: fixedWingActuatorComponent.h:306

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)