VR-Forces 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 
62  virtual ~DtFixedWingActuatorComponent() override;
63 
66  virtual bool init() override;
67 
70  virtual const char* type() const override;
71 
74  virtual void tick() override;
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 
223  virtual bool calculateOrientationAndPositionOnGround(
224  const DtVector& newLocalProjectedLocation, double newHeading,
225  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
227 
228  virtual void updateRepository(const DtVector& newLocalPosition,
229  const DtVector& newRelativeVelocity,
230  const DtVector& newRelativeAcceleration,
231  const DtDcm& newLocalOrientation, const DtVector& newBodyRotationRates,
232  bool isOnGround, const DtAppearance& newAppearance);
233 
247  virtual void updateAirspeedToRepository(const DtVector& newLocalPosition, const double altitude);
248 
249  virtual void updateDisplay() const;
250 
253  virtual double maxThrustAcceleration() const;
254  virtual double maxClimbRate() const;
255  virtual double maxYawVelocity() const;
256  virtual double maxPitchVelocity() const;
257  virtual double maxRollVelocity() const;
258  virtual double maxAltitude() const;
259 
261  virtual bool createPortGroups() override;
262 
264  virtual bool createPorts() override;
265 
271  virtual bool createPSR();
272 
274  virtual bool createFuelConsumptionModel();
275 
276  virtual void sendDetonation(const DtVector& geocentricPosition);
277 
279  virtual void updateOrderedSpeed();
280 
281 protected:
282 
285 
288 
292 
293 protected:
294 
298 
301 
306 
313 
320 
327 
334 
341 
343 
347 
350 
353 
357 
360 
364 
369  double myLastSpeed;
370 
373 
374  CACHED_NEXT_FRAME_STATE_PROPERTY(OrderedTrueAirSpeed);
375  CACHED_NEXT_FRAME_STATE_PROPERTY(OrderedIndicatedAirSpeed);
376  CACHED_NEXT_FRAME_STATE_PROPERTY(OrderedMachNumber);
377  CACHED_NEXT_FRAME_STATE_PROPERTY(OrderedSpeedState);
378  CACHED_NEXT_FRAME_STATE_PROPERTY(IndicatedAirspeed);
379  CACHED_NEXT_FRAME_STATE_PROPERTY(TrueAirspeed);
381 };
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:363
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:369
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:349
DtInputPortGroup * myFixedWingControlPortGroup
Input Port Group Name: fixed-wing-control Input Port Group Description: Provides input to the fixed-w...
Definition: fixedWingActuatorComponent.h:305
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 DtEntityType 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:346
#define CACHED_NEXT_FRAME_STATE_PROPERTY(property)
The following macros can be used within sim components to cache and access cached state properties...
Definition: simComponent.h:57
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:41
DtConstrainedAnalogInputPort * myThrottlePort
Input Port Name: throttle Input Port Description: Input Port Range: 0. to 1. Input Port Default Valu...
Definition: fixedWingActuatorComponent.h:312
bool myPreviouslyHadData
Definition: fixedWingActuatorComponent.h:358
This repository holds all information that is common to all the forms of local fixed wing entities wi...
Definition: fixedWingEntityStateRepository.h:41
virtual bool init() override
Overridden to cache a pointer to the entity&#39;s radio in this class.
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:297
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:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
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:372
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:340
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:356
bool myPutTaxiingPlaneOnGround
Used to make sure a taxiing, destroyed aircraft is only set down on the terrain once.
Definition: fixedWingActuatorComponent.h:352
DtFixedWingActuatorDescriptor, a descriptor for the DtFixedWingActuatorComponent component.
Definition: fixedWingActuatorDescriptor.h:24
bool myKeepParentPosition
Definition: fixedWingActuatorComponent.h:359
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:31
DtFixedWingActuatorDescriptor * myFixedWingActuatorDescriptor
Definition: fixedWingActuatorComponent.h:296
DtConstrainedAnalogInputPort * myBrakePort
Input Port Name: brake Input Port Description: Input Port Range: 0. to 1. Input Port Default Value: ...
Definition: fixedWingActuatorComponent.h:333
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:326
A locally simulated VRF object.
Definition: localObject.h:98
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:319
DtFixedWingEntityStateRepository * myFixedWingEntityState
Definition: fixedWingActuatorComponent.h:295

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)