VR-Forces 5.0.2 Developer's Guide
 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 
14 #include "vrfutil/rwAirSpeedType.h"
17 #include <matrix/LibMatrix.h>
18 #include <vlpi/disEnums.h>
19 
20 class DtString;
28 
30 class DtInputPortGroup;
33 class DtBooleanInputPort;
35 
47 {
48 public:
49 
53  DtLocalObject* owner,
54  DtSimulationServices* simManager,
55  DtComponentDescriptor* desc = 0,
56  DtReaderWriterRegistry* parentRegistry = 0);
57 
58 
63 
66  virtual bool init();
67 
70  virtual const char* type() const;
71 
74  virtual void tick();
75 
79  static DtSimComponent * creator(const DtString& name,
80  DtLocalObject* owner,
81  DtSimulationServices* simManager,
82  DtComponentDescriptor* desc = 0,
83  DtReaderWriterRegistry* parentRegistry = 0);
84 
85 public:
89  virtual void calculateBodyVelocity(const DtVector& oldRelativeVelocity,
90  const DtDcm& newLocalOrientation, DtVector& newBodyVelocity);
91 
95  virtual void calculateAirborneAcceleration(const DtVector oldLocalPosition,
96  double oldSpeed, const DtDcm& newLocalOrientation,
97  const DtVector& newBodyVelocity, double throttle,
98  DtVector& newRelativeAcceleration);
99 
100 protected:
101 
103  virtual void doFlying();
104 
106  virtual void doTaxiing();
107 
110  virtual bool isTouchingDown(const DtVector& newLocalPosition,
111  const DtVector& newRelativeVelocity);
112 
115  virtual bool isTakingOff(bool isOnGround, double speed);
116 
117  virtual bool updateGroundInteractionPoints(
118  DtGroundInteractionPt *left,
119  DtGroundInteractionPt *right,
120  DtGroundInteractionPt *nose,
121  DtGroundInteractionPt *center,
122  const DtDcm& localOrientation,
123  const DtVector& localPosition,
124  double halfHeightOfTerrainIntersectChord);
125 
130  virtual double calculateYawRate(double pedal);
131 
133  virtual double calculatePitchRate(double stickYValue);
134 
136  virtual double calculateRollRate(double stickXValue);
137 
138  virtual void calculateBodyRotationRates(double pedal, double stickXValue,
139  double stickYValue, DtVector& newBodyRotationRates);
140 
143  virtual void calculateOrientation(const DtDcm&
144  oldLocalOrientation, const DtVector& newBodyRotationRates,
145  DtDcm& newLocalOrientation);
146 
148  virtual void calculateBodyGravity(const DtVector oldLocalPosition,
149  const DtDcm& newLocalOrientation, DtVector& newBodyGravityAcceleration);
150 
153  virtual void calculateThrustAcceleration(double throttle,
154  DtVector& newBodyThrustAccleration);
155 
160  virtual void calculateDragAcceleration(double oldSpeed,
161  const DtVector& newBodyVelocity, bool flapsDeployed,
162  DtVector& newBodyDragAccleration);
163 
168  virtual void fallFromSky(const DtString& reason = DtString::nullString());
169 
170  virtual bool collidesWithGround(const DtVector& oldLocalPosition,
171  const DtVector& newLocalPosition, DtVector& localCenterGoundPosition);
172 
174  void integrate(const DtVector& oldLocalPosition,
175  const DtVector& oldRelativeVelocity,
176  const DtVector& newRelativeAcceleration, DtVector& newLocalPosition,
177  DtVector& newRelativeVelocity,
178  double maxSpeed = 0);
179 
181 
184  virtual void useFuel(double fuelUsed);
185  virtual double fuelLeft() const;
186 
188  virtual double fullMass() const;
189 
191  virtual double currentMass() const;
192 
197  virtual double calculateHeading(double oldHeading,
198  double steering, double dT, double speed, double turningRadius);
200  virtual void calculateScalarVelocityAndAcceleration(
201  double oldPitch, double &scalarVelocity, double &scalarAcceleration);
202  virtual double calculateMaxGroundSpeed();
203  virtual double calculateMaxGroundAcceleration();
207  virtual double calculateAcceleration(double pitch, double maxSpeed,
208  double maxAccel, double newSpeed);
209  virtual double calculateAccelerationFromThrottle();
210 
212  virtual double calculateAccelerationFromSlope(double slope);
213 
214  virtual double calculateAccelerationFromResistance(double maxSpeed,
215  double maxAccel);
216  virtual double calculateAccelerationFromBrake(double otherAccels);
217 
218  virtual DtVector calculateProjectedLocation(
219  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
220  const DtVector& oldBodyVelocity, double newHeading);
221 
222  virtual void calculateOrientationAndPositionOnGround(
223  const DtVector& newLocalProjectedLocation, double newHeading,
224  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
226 
227  virtual void updateRepository(const DtVector& newLocalPosition,
228  const DtVector& newRelativeVelocity,
229  const DtVector& newRelativeAcceleration,
230  const DtDcm& newLocalOrientation, const DtVector& newBodyRotationRates,
231  bool isOnGround, const DtAppearance& newAppearance);
232 
246  virtual void updateAirspeedToRepository(const DtVector& newLocalPosition, const double altitude);
247 
248  virtual void updateDisplay() const;
249 
252  virtual double maxThrustAcceleration() const;
253  virtual double maxClimbRate() const;
254  virtual double maxYawVelocity() const;
255  virtual double maxPitchVelocity() const;
256  virtual double maxRollVelocity() const;
257  virtual double maxAltitude() const;
258 
260  virtual bool createPortGroups();
261 
263  virtual bool createPorts();
264 
270  virtual bool createPSR();
271 
273  virtual bool createFuelConsumptionModel();
274 
275  virtual void sendDetonation(const DtVector& geocentricPosition);
276 
278  virtual void updateOrderedSpeed();
279 
280 protected:
281 
284 
287 
291 
292 protected:
293 
297 
300 
305 
312 
319 
326 
333 
340 
342 
346 
349 
352 
356 
359 
363 
368  double myLastSpeed;
369 
372 };
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
DtAirspeedCalculator * myAirSpeedCalculator
Air Speed Calculator for updating state properties Created in init()
Definition: fixedWingActuatorComponent.h:362
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:368
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:30
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
bool mySentFallingMessage
Used to make sure fall message is only sent once.
Definition: fixedWingActuatorComponent.h:348
DtInputPortGroup * myFixedWingControlPortGroup
Input Port Group Name: fixed-wing-control Input Port Group Description: Provides input to the fixed-w...
Definition: fixedWingActuatorComponent.h:304
End User Description: DtActuator is the base class for all actuator model components. Developer Description: The DtActuator base class caches a pointer to the entity&#39;s radio for convenience. Derived classes may have articulated parts that are configured from the DtActuatorComponentDescriptor&#39;s DtSimArtPartDescriptorList. For each articulated part in the list a DtArticulatedPartStateRepository will be created to store the data for the part such as it&#39;s location, rotation and so forth. These are created in the entity&#39;s DtVrfObjectStateRepository createParts() function. This call creates all the attached parts for all the actuators. These articulated state repositories are managed by the DtAttachmentManager. They are cached by their partType which is the DIS Enumeration describing the part from the disEnums.h file and was specified in the actuator&#39;s DtActuatorComponentDescriptor as descriped above. The partType is used as the category of the DtObjectType used to look up articulated parts in the DtAttachementManager. When an actuator needs access to a particular articulated part it looks it up by the part&#39;s object type.
Definition: actuatorComponent.h:47
DtFixedWingFlightPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: fixedWingActuatorComponent.h:345
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:40
DtConstrainedAnalogInputPort * myThrottlePort
Input Port Name: throttle Input Port Description: Input Port Range: 0. to 1. Input Port Default Valu...
Definition: fixedWingActuatorComponent.h:311
bool myPreviouslyHadData
Definition: fixedWingActuatorComponent.h:357
This repository holds all information that is common to all the forms of local fixed wing entities wi...
Definition: fixedWingEntityStateRepository.h:41
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtAircraftFuelConsumptionModel * myFuelConsumptionModel
Definition: fixedWingActuatorComponent.h:296
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
class DtAirspeedCalculator:
Definition: airSpeedCalculator.h:23
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Class Invariant: The DtGroundInteractionPt class must always have a valid DtAttachedTerrain or DtSimM...
Definition: groundInteractionPt.h:28
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: fixedWingActuatorComponent.h:371
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
DtBooleanInputPort * myFlapsDeployedPort
Input Port Name: flaps Input Port Description: Input Port Range: Input Port Default Value: false In...
Definition: fixedWingActuatorComponent.h:339
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
Port group used to set what values should be set into the VRF state repository. All values are in loc...
Definition: fixedWingActuatorComponent.h:355
bool myPutTaxiingPlaneOnGround
Used to make sure a taxiing, destroyed aircraft is only set down on the terrain once.
Definition: fixedWingActuatorComponent.h:351
DtFixedWingActuatorDescriptor, a descriptor for the DtFixedWingActuatorComponent component.
Definition: fixedWingActuatorDescriptor.h:29
bool myKeepParentPosition
Definition: fixedWingActuatorComponent.h:358
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:31
DtFixedWingActuatorDescriptor * myFixedWingActuatorDescriptor
Definition: fixedWingActuatorComponent.h:295
DtConstrainedAnalogInputPort * myBrakePort
Input Port Name: brake Input Port Description: Input Port Range: 0. to 1. Input Port Default Value: ...
Definition: fixedWingActuatorComponent.h:332
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtFixedWingActuatorComponent provides a simple, kinematics-based model for air motion based on thrott...
Definition: fixedWingActuatorComponent.h:46
DtConstrainedAnalogInputPort * myPedalPort
Input Port Name: pedal Input Port Description: Input Port Range: -1. to 1. Input Port Default Value:...
Definition: fixedWingActuatorComponent.h:325
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
DtConstrainedDualAxisAnalogInputPort * myStickPort
Input Port Name: stick Input Port Description: Input Port Range: X:-1. to 1., Y:-1. to 1. Input Port Default Value: Input Group Parent: fixed-wing-control.
Definition: fixedWingActuatorComponent.h:318
DtFixedWingEntityStateRepository * myFixedWingEntityState
Definition: fixedWingActuatorComponent.h:294

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)