WSF
P6DofVehicle.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef P6DOFVEHICLE_H
13#define P6DOFVEHICLE_H
14
15#include "p6dof_export.h"
16
17#include <cstdint>
18#include <list>
19#include <vector>
20
25#include "P6DofIntegrator.hpp"
28#include "P6DofObject.hpp"
29#include "P6DofSizeFactor.hpp"
30#include "P6DofUtils.hpp"
31#include "P6DofVehicleData.hpp"
32#include "UtCallback.hpp"
33#include "UtDCM.hpp"
34#include "UtEntity.hpp"
35#include "UtInput.hpp"
36#include "UtQuaternion.hpp"
37#include "UtTable.hpp"
38#include "UtVec3dX.hpp"
41class P6DofFuelTank;
42#include "P6DofLandingGear.hpp"
43class P6DofObject;
44#include "P6DofPilotManager.hpp"
46class P6DofScenario;
47#include "P6DofSequencer.hpp"
51
52class P6DOF_EXPORT P6DofVehicle : public P6DofObject
53{
54public:
55 explicit P6DofVehicle(P6DofScenario* aScenario);
56
57 ~P6DofVehicle() override = default;
58
59 P6DofVehicle& operator=(const P6DofVehicle& other) = delete;
60
61 P6DofVehicle* Clone() const;
62
63 void SetParentVehicle(P6DofVehicle* aParentVehicle) override;
64
65 // ====================================================================================================================
66
67 // Initialization functions
68
69 bool Initialize(double aSimTime_sec, const P6DofVehicleType* aObjectType, const std::string& aPrefixName);
70
71 bool InitializeConditions(double aSimTime_sec);
72
73 // Note: P6DofVehicleType uses ProcessInput(), but P6DofVehicle does not
74
75 // This "washes-in" (smooths) initial conditions, helping to eliminate "jumps"
76 // as the vehicle reaches a stable state.
77 void SetWashInInitConditions(bool aUseWashInInitConditions) { mUseWashInInitConditions = aUseWashInInitConditions; }
78
79 // ====================================================================================================================
80
81 // Update functions
82
83 void Update(double aSimTime_sec);
84 void Update(int64_t aSimTime_nanosec);
85 void UpdateObject(int64_t aSimTime_nanosec);
86
87 // ====================================================================================================================
88
89 // Misc object functions
90
91 // This returns true if the object has crashed
92 bool Crashed() const { return mCrashed; }
93
94 // This enables/disables the size factor. Size factor effects aerodynamics as
95 // a size multiplier for reference area.
96 void SetSizeFactorEnabled(bool aSetting) { mSizeFactor.SetSizeFactorEnabled(aSetting); }
97
98 // ====================================================================================================================
99
100 // Mass properties functions
101
102 // This returns the mass properties.
104
105 // This calculates the current mass properties, including those from subobjects and other contributors such as fuel.
106 void CalculateCurrentMassProperties();
107
108 double GetEmptyWeight_lbs() const { return mMassProperties.GetBaseMass_lbs(); }
109 double GetCurrentWeight_lbs() const { return mMassProperties.GetMass_lbs(); }
110
111 // This is used to modify the weight of a vehicle without adding fuel or subobjects for testing and should only be
112 // called in testing. Additional weight is added at the existing vehicle CG.
113 void SetCurrentWeight_lbs(double aWeight_lbs);
114
115 // This is used to modify the CG of a vehicle without adding fuel or subobjects for testing and should only be called
116 // through the test object. CG is shifted in X, Y, and/or Z with no modification to scalar mass or moments of inertia.
117 void ShiftCurrentCg_ft(UtVec3dX aDeltaCg_ft);
118
119 // ====================================================================================================================
120
121 // Kinematics state functions
122
123 // This returns the kinematics state.
125
126 // ====================================================================================================================
127
128 // Integrator functions
129
130 // This returns the integrator.
132
133 // ====================================================================================================================
134
135 // Naming functions
136
137 // This gets the base name
138 std::string GetBaseName() const { return mBaseName; }
139
140 // This gets the derived from object name
141 std::string GetDerivedFromObjectName() const { return mDerivedFromObjectName; }
142
143 // This is called to (possibly) add a prefix to the name of the object instance
144 void SetNamePrefix(const std::string& aPrefixName);
145
146 // This sets the basename
147 void SetBaseName(const std::string& aName) { mBaseName = aName; }
148
149 // ====================================================================================================================
150
151 // Timing functions
152
153 // This returns the last update time (in seconds) of the object
155
156 // This returns the total lifetime (in seconds) of the object, including time when the object was free or captive
157 // to a parent
159
160 // This returns the time of flight (in seconds) of the object, when it was free from being captive to a parent
162
163 // This returns the total lifetime (in integer nanoseconds) of the object, including time when the object was free
164 // or captive to a parent
165 int64_t GetLifeTime_nanosec() const { return mLifeTime_nanosec; }
166
167 // This returns the time of flight (in integer nanoseconds) of the object, when it was free from being captive to
168 // a parent
170
171 // ====================================================================================================================
172
173 // Position/location
174
175 // This provides the lat/lon where the object was created
176 void GetStartingLatLon(double& aStartingLat, double& aStartingLon) const;
177
178 // This returns the current latitude in degrees
179 double GetLat() const;
180
181 // This returns the current longitude in degrees
182 double GetLon() const;
183
184 // This provides the current lat/lon (in degrees) and altitude (in meters)
185 void GetLocationLLA(double& aLat, double& aLon, double& aAlt_m);
186
187 // This returns the current altitude (in meters)
188 double GetAlt_m() const;
189
190 // This returns the current altitude (in feet above sea level)
191 double GetAltitudeMSL_ft() const;
192
193 // This returns the maximum altitude (in kilometers) reached by the object
194 double GetApogee_km() const;
195
196 // This returns the current great-circle range (in kilometers) from the starting location to the current location
197 double GetRangeSinceStart_km() const;
198
199 // This returns a vector for the current location in WCS
200 UtVec3dX GetLocationWCS() const;
201
202 // This provides x,y,z values for the current location in WCS
203 void GetLocationWCS(double& aWcsPosX_m, double& aWcsPosY_m, double& aWcsPosZ_m) const;
204
205 // This provides x,y,z values for the current location in spherical-earth coordinates
206 void GetLocationSpherical(double& aSphericalPosX_m, double& aSphericalPosY_m, double& aSphericalPosZ_m) const;
207
208 // This sets the location to the lat, lon, altitude specified
209 void SetLocationLLA(double aLat, double aLon, double aAlt_m);
210
211 // This sets the location to the x, y, z specified in WCS
212 void SetLocationWCS(double aWcsPosX_m, double aWcsPosY_m, double aWcsPosZ_m);
213
214 // This is used to move to the preposition location (starting location) at the specified altitude in meters.
215 // This is often used in testing.
216 void SetPrepositionAlt_m(double aAltitude_m);
217
218 // The returns true is a spherical-earth model is being used instead of a WGS84 oblate-earth model (WCS).
219 bool UsingSphericalEarth() const;
220
221 // ====================================================================================================================
222
223 // Velocity functions
224
225 // This returns the indicated/calibrated airspeed in knots, based on the current altitude
226 double GetKCAS() const;
227 double GetKIAS() const;
228
229 // This returns the true airspeed in knots
230 double GetKTAS() const;
231
232 // This returns the Mach, based on the current speed and altitude
233 double GetMach() const;
234
235 // This returns the vertical speed in ft/minutes
236 double GetVertSpeed_fpm() const;
237
238 // This returns the true speed (inertial, not airspeed) in ft/sec
239 double GetSpeed_fps() const;
240
241 // This provides the vx, vy, vz WCS velocity components in meters/sec
242 void GetVelocityWCS(double& aWcsVelX_mps, double& aWcsVelY_mps, double& aWcsVelZ_mps) const;
243
244 // This returns a vector of the WCS velocity in meters/sec
245 UtVec3dX GetVelocityWCS() const;
246
247 // This returns a vector of the NED velocity in meters/sec
248 UtVec3dX GetVelocityNED_mps() const;
249
250 // This sets the velocity using the vx, vy, vz WCS velocity components in meters/sec
251 void SetVelocityWCS(double aWcsVelX_mps, double aWcsVelY_mps, double aWcsVelZ_mps);
252
253 // This sets the velocity using the vx, vy, vz spherical-earth velocity components in meters/sec
254 void SetVelocitySpherical(double aSphericalX_mps, double aSphericalY_mps, double aSphericalZ_mps);
255
256 // This sets the velocity using the NED velocity components in meters/sec
257 void SetVelocityNED(double aVelNorth_mps, double aVelEast_mps, double aVelDown_mps);
258
259 // ====================================================================================================================
260
261 // Acceleration functions
262
263 // This returns the x-component of acceleration (in gees) in body coordinates
264 double GetNx_g() const;
265
266 // This returns the y-component of acceleration (in gees) in body coordinates
267 double GetNy_g() const;
268
269 // This returns the z-component of acceleration (in gees) in body coordinates
270 double GetNz_g() const;
271
272 // This returns a vector of the acceleration (in meters/sec^2) in NED coordinates
273 UtVec3dX GetAccelNED_mps2() const;
274
275 // ====================================================================================================================
276
277 // Attitude functions
278
279 // This returns the current heading in radians
280 double GetHeading_rad() const;
281
282 // This returns the current heading in degrees
283 double GetHeading_deg() const;
284
285 // This returns the current pitch in degrees
286 double GetPitch_rad() const;
287
288 // This returns the current pitch in degrees
289 double GetPitch_deg() const;
290
291 // This returns the current roll in degrees
292 double GetRoll_rad() const;
293
294 // This returns the current roll in degrees
295 double GetRoll_deg() const;
296
297 // This returns the current yaw rate in degrees/sec
298 double GetYawRate_dps() const;
299
300 // This returns the current pitch rate in degrees/sec
301 double GetPitchRate_dps() const;
302
303 // This returns the current roll rate in degrees/sec
304 double GetRollRate_dps() const;
305
306 // This returns the current alpha (angle of attack) in radians
307 double GetAlpha_rad() const;
308
309 // This returns the current alpha (angle of attack) in degrees
310 double GetAlpha_deg() const;
311
312 // This returns the current beta (angle of sideslip) in radians
313 double GetBeta_rad() const;
314
315 // This returns the current beta (angle of sideslip) in degrees
316 double GetBeta_deg() const;
317
318 // This returns the current angle of attack rate (alpha-dot) in radians/sec
319 double GetAlphaDot_rps() const;
320
321 // This returns the current angle of attack rate (alpha-dot) in degrees/sec
322 double GetAlphaDot_dps() const;
323
324 // This returns the current angle of sideslip rate (beta-dot) in radians/sec
325 double GetBetaDot_rps() const;
326
327 // This returns the current angle of sideslip rate (beta-dot) in degrees/sec
328 double GetBetaDot_dps() const;
329
330 // This returns the current center of gravity in meters
331 UtVec3dX GetCg() const;
332
333 // This returns the current gamma (flight path angle) in radians
334 double GetFlightPathAngle_rad() const;
335
336 // This provides the current WCS yaw, pitch, and roll in radians
337 void GetOrientationWCS(double& aWcsYaw_rad, double& aWcsPitch_rad, double& aWcsRoll_rad) const;
338
339 // This provides the current NED heading, pitch, and roll in radians
340 void GetAttitudeNED(double& aHeading, double& aPitch, double& aRoll);
341
342 // This sets the WCS yaw, pitch, and roll in radians
343 void SetOrientationWCS(double aWcsYaw_rad, double aWcsPitch_rad, double aWcsRoll_rad);
344
345 // This set the NED heading, pitch, and roll in radians
346 void SetAttitudeNED(double aHeading_rad, double aPitch_rad, double aRoll_rad);
347
348 // This provides the current body rates about each axis in radians/sec
349 void GetBodyRates_rps(double& xAxis_rps, double& yAxis_rps, double& zAxis_rps) const;
350
351 // Zeros body rates, used for autopilot tuning
352 void ZeroBodyRates();
353
354 // This provides the current body angular acceleration about each axis in radians/sec^2
355 void GetBodyAngularAccel_rps2(double& xAxis_rps2, double& yAxis_rps2, double& zAxis_rps2) const;
356
357 // This returns true if the positive-side stall warning is occurring
358 bool StallWarningAlert() const;
359
360 // ====================================================================================================================
361
362 // "Last" functions
363
364 // This sets the mLastSimTime_nanosec to the specified sim time in seconds. If the aIncludeSubobjects flag is true,
365 // all subobjects will also have their last time values set.
366 void SetLastSimTime(double aSimTime_sec, bool aIncludeSubobjects = false);
367
368 // ====================================================================================================================
369
370 // Graphical Support interface functions
371
372 // This group of functions provide support for special P6DOF graphical interfaces.
373
374 // This returns the "graphical" object type.
375 unsigned short GetObjectGraphicalType() const;
376
377 // This sets mCurrentObjectGraphicalType based on the aAltType argument:
378 // aAltType = 0 --> Sets type to mObjectGraphicalType (default type)
379 // aAltType = 1 --> Sets type to mObjectGraphicalAltType1 (alt type 1)
380 // aAltType = 2 --> Sets type to mObjectGraphicalAltType1 (alt type 2)
381 // aAltType = 3 --> Sets type to mObjectGraphicalAltType1 (alt type 3)
382 void SetObjectGraphicalType(int aAltType);
383
384 // TODO - Refactor this to avoid using "targets" in P6DOF
385 // This allows up to ten tracks to be "injected".
386 void SetPrimaryTargetData(const P6DOF::CurrentTargetData& aCurrentTarget,
387 int aNumTracks,
388 const P6DOF::TrackData aTrackData[10]);
389
390 // ====================================================================================================
391
392 // Damage and Destruction
393
394 // This function is called by WsfP6DOF_Mover when the mover is destroyed in flight. The aPitchInputModifier and
395 // aRollInputModifier arguments vary between +/-1 and control the pitch and roll control when destroyed. The
396 // aIsOnFire, aEngineIsSmoking, and aIsTrailingSmoke arguments control the appearance when destroyed.
397 void SetDestroyed(double aPitchInputModifier,
398 double aRollInputModifier,
399 bool aIsOnFire,
400 bool aEngineIsSmoking,
401 bool aIsTrailingSmoke);
402
403 bool GetIsDestroyed();
404
405 // ====================================================================================================================
406
407 // Appearance functions
408
409 // This group of functions provide support for appearance attributes, which are often used by visualization tools and
410 // networked simulation, such as DIS. These functions are included in the P6DofVehicle class, since the vehicle is
411 // best able to determine these appearances.
412
414
415 // External appearance control. These functions allow the appearance to be set from an external source.
416 bool AnEngineIsOperating() const;
417 bool AnEngineIsSmoking() const;
418 bool AnEngineHasAfterburnerOn() const;
419 bool ContrailTrailingEffectPresent() const;
420 bool RocketSmokeTrailingEffectPresent() const;
421 bool DamageSmokeTrailingEffectPresent() const;
422 bool FlamesArePresent() const;
423
424 void MakeEnginesSmoke();
425 void ActivateDamageSmokeTrailingEffect(bool aEffectActive);
426 void ActivateFlamesEffect(bool aFlamesPresent);
427
428 // This returns true if the specified altitude is within the contrailing band. If it is not within the band or
429 // contrailing conditions do not exist, it returns false.
430 bool WithinContrailAltitudeBand(double aAltitude_ft) const;
431
432 // ====================================================================================================================
433
434 // Aerodynamics functions
435
436 // This function is used to calculate the lift, drag, side force, and moments using the current state. The reference
437 // point is typically (0,0,0), but may be a non-origin reference due to subobjects. This function will include aero
438 // contributions by subobjects, if appropriate.
439 void CalculateAeroBodyFM(UtVec3dX& aLiftBodyVector_lbs,
440 UtVec3dX& aDragBodyVector_lbs,
441 UtVec3dX& aSideForceBodyVector_lbs,
442 UtVec3dX& aMoment_ftlbs,
443 UtVec3dX& aReferencePt_ft);
444
445 // This uses CalculatePitchGLoadAtSpecifiedAlpha internally to calculate the angle of attack (alpha) at the specified
446 // g-load using the current conditions. If it cannot attain the specified g-load, it will return the *best* alpha.
447 void CalculateAlphaAtSpecifiedGLoad_deg(double aGLoad, double& aAlpha_deg);
448
449 // This calculates the normalized stick back position to produce a net zero moment using the current conditions. If
450 // it cannot produce a zero moment, it will do the best it can (full stick control).
451 void CalculateStickBackForZeroMoment(double aAlpha_deg, double& aStickBack);
452
453 // This calculates the normalized stick back position to produce a net zero moment using the specified Mach. If it
454 // cannot produce a zero moment, it will do the best it can (full stick control).
455 void CalculateStickBackForZeroMoment(double aAlpha_deg, double aMach, double& aStickBack);
456
457 // This calculates the angle of sideslip (beta) at the specified g-load using the current conditions. If it cannot
458 // attain the specified g-load, it will return the *best* beta.
459 void CalculateBetaAtSpecifiedGLoad_deg(double aGLoad, double& aBeta_deg);
460
461 // This calculates the lift coefficient (CL), drag coefficient (Cd), and pitching moment coefficient (Cm),
462 // multiplied by the appropriate reference area, produced by all aero movable objects. It uses the specified
463 // stick back position.
464 void CalculateControlsAeroCoefficientVectors(double aMach,
465 double aAlpha_rad,
466 double aStickBack,
467 double& aCLArea,
468 double& aCdArea,
469 double& aCmArea);
470
471 // This calculates the lift coefficient (CL), multiplied by the appropriate reference area, produced by all aero
472 // movable objects. It uses the specified stick back position.
473 double CalculateControlsCLArea(double aMach, double aAlpha_rad, double aStickBack);
474
475 // This calculates the drag coefficient (Cd), multiplied by the appropriate reference area, produced by all aero
476 // movable objects. It uses the specified stick back position.
477 double CalculateControlsCdArea(double aMach, double aAlpha_rad, double aStickBack);
478
479 // This calculate the CmArea, including reference area effects, for the core aero and movable (controls) aero.
480 void CalculateCmAreaForCoreAndControls(double aMach,
481 double aAlpha_rad,
482 double aStickBack,
483 bool aPowerOn,
484 double& aThrustProduced_lbs,
485 double& aCoreCm,
486 double& aControlsCm);
487
488 // This calculate the CLArea, including reference area effects, for the core aero and movable (controls) aero.
489 void CalculateCLAreaForCoreAndControls(double aMach, double aAlpha_rad, double aStickBack, double& aCoreCL, double& aControlsCL);
490
491 // This calculate the CdArea, including reference area effects, for the core aero and movable (controls) aero.
492 void CalculateCdAreaForCoreAndControls(double aMach, double aAlpha_rad, double aStickBack, double& aCoreCd, double& aControlsCd);
493
494 // This calculates the total Cm and CL for the vehicle, including both core aero and movable (controls) aero,
495 // returning the Cm and CL via reference.
496 void CalculateTotalCmAndCL(double aMach, double aAlpha_rad, double aStickBack, double& aTotalCm, double& aTotalCL);
497
498 // This sets the active aero object using the pointer
499 void SetActiveAeroObject(P6DofAeroCoreObject* aObject);
500
501 // This sets the active aero object using the name
502 void SetActiveAeroObject(const std::string& aName);
503
504 // This returns a pointer to the active aero object
506
507 // This returns the name of the active aero object
508 std::string GetActiveAeroObjectName() const { return mActiveAeroModeName; }
509
510 // This returns the wing area (sq-ft) for the current aero mode
511 double GetWingArea_sqft() const;
512
513 // This returns the ref area (sq-ft) for the current aero mode
514 double GetRefArea_sqft() const;
515
516 // This returns the lift in lbs
517 double GetLift_lbs() const;
518
519 // This returns the drag in lbs
520 double GetDrag_lbs() const;
521
522 // This returns the side force in lbs
523 double GetSideForce_lbs() const;
524
525 // This returns the thrust magnitude in lbs
526 double GetThrustMagnitude_lbs() const;
527
528 // Returns the yaw moment in ft*lbs
529 double GetYawMoment_ftlbs() const;
530
531 // Returns the pitch moment in ft*lbs
532 double GetPitchMoment_ftlbs() const;
533
534 // Returns the roll moment in ft*lbs
535 double GetRollMoment_ftlbs() const;
536
537 // This returns dynamic pressure in lbs/sq-ft
538 double GetDynamicPressure_psf() const;
539
540 // This returns pressure pressure in lbs/sq-ft
541 double GetStaticPressure_psf() const;
542
543 // This uses the current state to calculate the maximum g-load maneuverability based on the current mass, altitude,
544 // speed/mach and CLmax
545 double MaxPotentialManeuverGLoad() const;
546
547 // ====================================================================================================================
548
549 // Parent-object functions
550
551 bool IsCaptive() const { return mIsCaptive; }
552 void AdjustForParentInducedEffects();
553 void ImpartSeparationEffects();
554 void GetPositionRelativeToParent(UtVec3dX& aPosRelToParent_m, UtVec3dX& aAngRelToParentYPR_rad);
555
556 void SetCaptiveState(bool aIsCaptive) { mIsCaptive = aIsCaptive; }
557
558 void SetAngRelToParentYPR_rad(const UtVec3dX& aAngRelToParentYPR_rad)
559 {
560 mAngRelToParentYPR_rad = aAngRelToParentYPR_rad;
561 }
562 void SetYawRelToParent_rad(double aYawAngle_rad);
563 void SetPitchRelToParent_rad(double aYawAngle_rad);
564 void SetRollRelToParent_rad(double aYawAngle_rad);
565
566 // ====================================================================================================================
567
568 // Subobject functions
569
570 // This adds the designated object as a subobject
571 void AddSubObject(std::unique_ptr<P6DofVehicle> aSubObject);
572
573 // This returns a pointer to the subobject with the specified name. It will search the direct subobjects and if no
574 // match is found it will search children of subobjects.
575 P6DofVehicle* GetSubobjectByName(const std::string& aSubobjectName) const;
576
577 // This returns a reference to the list of subobjects
578 const std::list<ut::CloneablePtr<P6DofVehicle>>& GetSubobjectList() const;
579
580 size_t GetNumSubobjects() const { return mSubObjectList.size(); }
581
582 bool JettisonSubobject(const std::string& aSubobjectName, int64_t aSimTime_nanosec);
583 bool JettisonSubobject(P6DofVehicle* aSubObject, int64_t aSimTime_nanosec);
584
585 // This will remove/jettison the specified subobject, transferring ownership to the caller if successful. Note that
586 // this does not create a platform or any other action. It merely removes the subobject from the parent and removes
587 // the captive flag.
588 std::unique_ptr<P6DofVehicle> DirectJettisonOfSubobject(P6DofVehicle* aSubobject, double aSimTime_sec);
589
590 // ====================================================================================================================
591
592 // PropulsionSystem functions
593
594 // This calculates F&M for the full propulsion system (all engines) plus the thrust from any subobjects
595 void CalculatePropulsionFM(int64_t aSimTime_nanosec,
596 double aDeltaT_sec,
597 P6DofKinematicState& aState,
598 UtVec3dX& aInertialPropulsionVector_lbs,
599 UtVec3dX& aPropulsionMoment_ftlbs);
600
601 // This updates the fuel/propellant consumption for propulsion system, but does not update burn for any subobjects,
602 // which is handled by those objects
603 void UpdateFuelBurn(int64_t aSimTime_nanosec, double aDeltaT_sec, P6DofKinematicState& aState);
604
605 // This returns the propulsion system or null if no propulsion system exists
607
608 // This returns true if afterburners are present
609 bool HasAfterburner() const;
610
611 // Returns the current fuel remaining (in percent)
612 double GetRemainingFuelPercent() const;
613
614 // This provides the maximum potential thrust available, if full throttle, including afterburner (if available),
615 // is applied
616 double GetMaximumPotentialThrust_lbs() const;
617
618 // This provides the minimum potential thrust available
619 double GetMinimumPotentialThrust_lbs() const;
620
621 // This provides the current thrust magnitude produced by engines on the vehicle. It includes thrust from any
622 // first-level/immediate subobjects
623 double GetCurrentThrust_lbs();
624
625 // This provides the current forward thrust produced by engines on the vehicle. It includes thrust from any
626 // first-level/immediate subobjects
627 double GetCurrentForwardThrust_lbs();
628
629 // This provides the current normalized military-power thrust produced by engines on the vehicle. It includes
630 // thrust from any first-level/immediate subobjects and may range from 0.0 to 1.0. Note -- This uses the first
631 // engine on the vehicle (which may differ from other engines).
632 double GetNormalizedMilitaryThrust() const;
633
634 // This provides the current normalized afterburner thrust produced by engines on the vehicle. It includes
635 // thrust from any first-level/immediate subobjects and may range from 0.0 to 1.0. Note -- This uses the first
636 // engine on the vehicle (which may differ from other engines).
637 double GetNormalizedAfterburnerThrust() const;
638
639 // This provides the current normalized total thrust produced by engines on the vehicle. It includes thrust
640 // from any first-level/immediate subobjects and may range from 0.0 to 2.0, where 0.0 is idle thrust, 1.0 is
641 // full military power, and 2.0 is full afterburner. Note -- This uses the first engine on the vehicle (which
642 // may differ from other engines).
643 double GetNormalizedTotalThrust() const;
644
645 // This returns the total fuel flow (lbs/hr) for all engines on the vehicle
646 double GetTotalVehicleFuelFlow_pph() const;
647
648 // This returns the total fuel flow (lbs/hr) for the main engines on the vehicle. It does not include any subobjects.
649 double GetTotalFuelFlow_pph() const;
650
651 // GetFuelTankByName returns the fuel source with the specified name
652 P6DofFuelTank* GetFuelTankByName(const std::string& aName) const;
653
654 // GetFuelTankByName returns the fuel source with the specified name
655 P6DofFuelTank* GetFuelTankByName(const std::string& aName, const P6DofVehicle* aCallingObject, int aCallingLevel = 0) const;
656
657 // This returns the maximum total capacity of fuel in tanks for the object and all of its subobjects. Note that
658 // this is capacity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets.
659 double GetTotalFuelTankCapacity_lbs() const;
660
661 // This returns the current total amount of fuel in tanks for the object and all of its subobjects. Note that this
662 // is quantity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets. This returns
663 // the total amount of fuel in tanks for the object and all of its subobjects.
664 double GetCurrentTotalFuelTankQuantity_lbs() const;
665
666 // This returns the maximum total capacity of fuel in tanks for the object, but not including any of its subobjects.
667 // Note that this is capacity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets.
668 double GetInternalFuelTankCapacity_lbs() const;
669
670 // This returns the current total amount of fuel in tanks for the object, but not including any of its subobjects.
671 // Note that this is quantity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets.
672 double GetCurrentInternalFuelTankQuantity_lbs() const;
673
674 // This returns the maximum total capacity of fuel in external tanks for the object. It does this by summing the fuel
675 // in the first level subobjects. Note that this is capacity of fuel in fuel tanks, and does not include integral
676 // fuel in solid-propellant rockets.
677 double GetExternalFuelTankCapacity_lbs() const;
678
679 // This returns the current total amount of fuel in external tanks for the object. It does this by summing the fuel
680 // in the first level subobjects. Note that this is quantity of fuel in fuel tanks, and does not include integral
681 // fuel in solid-propellant rockets.
682 double GetCurrentExternalFuelTankQuantity_lbs() const;
683
684 // This adds fuel to the object in a simplistic manner. It does not use the "fill rate" limit of tanks -- hence all
685 // of the fuel is put into the tank(s) at once. Later, we can add a "proper" fuel fill that is more realistic and
686 // deals with a fill rate that will require a finite amount of time to transfer. This function will fill internal
687 // tanks first and then any external/drop tanks and subobjects will be filled next. However, for simplicity, it
688 // will make all non-internal tanks filled to the same percent full level, even if they already contained more
689 // fuel -- in other words, it will redistribute non-internal fuel to keep the percent full consistent.
690 void AddFuelQuantity_lbs(double aFuelToAdd_lbs);
691
692 // This will set the fuel in a specified tank to the specified level, as long as the tank capacity can contain
693 // it -- otherwise, the tank will be filled and the excess fuel will be "wasted". This function performs the
694 // transfer instantly, regardless of the transfer rates supported by the tank and fuel system. It also ignores any
695 // fuel that already may be in the tank.
696 void SetFuelInTank_lbs(const std::string& aTankName, double aFuel_lbs);
697
698 // This will instantly empty all internal tanks for the object
699 void EmptyAllInternalTanks();
700
701 // This will instantly empty all external tanks for the object
702 void EmptyAllExternalTanks();
703
704 // Returns the number of external fuel tanks (subobjects that can contain fuel) being carried.
705 // Note -- This only checks the first level of subobjects.
706 int GetNumberOfExternalTanks() const;
707
708 // GetThrustProducerObjectByName returns the P6DofThrustProducerObject with the specified name
709 P6DofThrustProducerObject* GetThrustProducerObjectByName(const std::string& aName) const;
710
711 // GetThrustProducerObjectByName returns the P6DofThrustProducerObject with the specified name
712 P6DofThrustProducerObject* GetThrustProducerObjectByName(const std::string& aName,
713 const P6DofVehicle* aCallingObject,
714 int aCallingLevel = 0) const;
715
716 // Ignite all of the engines in the propulsion object
717 void IgniteObject(int64_t aIgniteTimeInFrame_nanosec);
718
719 // This terminates thrust from the propulsion object but not any subobjects aTerminateTime_sec is the time
720 // termination occurs
721 void ShutdownObject(int64_t aTerminateTime_nanosec = 0);
722
723 // This terminates thrust from the propulsion object and all subobjects aTerminateTime_sec is the time
724 // termination occurs
725 void TerminateThrust(int64_t aTerminateTime_nanosec = 0);
726
727 // This returns true is at least one thrust producer is producing thrust
728 bool IsProducingThrust() const;
729
730 // EnableThrustVectoring enables/disable thrust vectoring
731 void EnableThrustVectoring(bool aEnableThrustVectoring);
732
733 // This adds a new fuel transfer to the propulsion system. The fuel transfer name must be unique. It returns true
734 // if the transfer is created.
735 bool AddFuelTransfer(std::string aFuelTransferName, std::string aSourceTankName, std::string aTargetTankName);
736
737 // This removes the fuel transfer with the specified name. It returns true if the removal is successful.
738 bool RemoveFuelTransfer(std::string aFuelTransferName);
739
740 // This specifies the fuel feed (input tank name) for the specified engine. It returns true if the assignment is
741 // successful.
742 bool SetFuelFeed(std::string aEngineName, std::string aFuelTankName);
743
744 // This specifies the fuel feed (input tank name) for all engines.
745 // It returns true if the assignment is successful.
746 bool SetFuelFeed(std::string aFuelTankName);
747
748 // ====================================================================================================================
749
750 // PilotObject and FlightControls functions
751
752 // This returns the pilot manager object. Null is returned when no pilot manager is present.
754
755 // This returns the pilot controller object. Null is returned when no pilot controller is present.
756 P6DofPilotObject* GetPilotObject() const;
757
758 // This makes the manual pilot active (if present)
760
761 // This makes the manual pilot active (if present)
763
764 // This makes the manual pilot active (if present)
766
767 // This makes the manual pilot active (if present)
769
770 // This returns the flight controls object. Null is returned when
771 // no flight controls are present.
773
774 // This returns true if the object includes flaps control surfaces
775 bool HasFlaps() const;
776
777 size_t GetInputHandle(const std::string& aInputName) const;
778 bool GetBooleanInput(size_t aHandle) const;
779 bool GetLastBooleanInput(size_t aHandle) const;
780
781 // This is used to restore angles specified in the list to the control surfaces specified in the other list
782 void RestoreControlSurfaceAngles(std::vector<P6DofFlightControlSystem::ControlSurfaceElement*>& aControlsList,
783 std::vector<double>& aAngleList);
784
785 // This enables/disables controls. When controls are disabled, all control inputs are set to zero.
786 void EnableControls(bool aEnabled);
787
788 // This returns the controls enabled/disabled state.
789 bool ControlsEnabled() const;
790
791 // This returns true if an autopilot is present
792 bool AutopilotAvailable() const;
793
794 // If true, a simple yaw damper should be used. This is determined by the autopilot, so if no autopilot is present,
795 // no yaw damper will be available. This "simple" yaw damper merely prevents any rotation about the body z-axis,
796 // so it may not be desired, since it is simplified and not very realistic.
797 bool UseSimpleYawDamper() const;
798
799 // These functions return the control surface angle in degrees
800 double GetAngleAileronLeft() const;
801 double GetAngleAileronRight() const;
802 double GetAngleFlapLeft() const;
803 double GetAngleFlapRight() const;
804 double GetAngleSpoilerLeft() const;
805 double GetAngleSpoilerRight() const;
806 double GetAngleStabilizerLeft() const;
807 double GetAngleStabilizerRight() const;
808 double GetAngleElevator() const;
809 double GetAngleRudderLeft() const;
810 double GetAngleRudder() const;
811 double GetAngleRudderRight() const;
812 double GetAngleSpeedBrake() const;
813 double GetAngleLandingGear() const;
814 double GetAngleLandingGearNose() const;
815 double GetAngleLandingGearMainLeft() const;
816 double GetAngleLandingGearMainRight() const;
817
818 // These functions return the normalized control surface angle
819 double GetNormalizedAileronLeft() const;
820 double GetNormalizedAileronRight() const;
821 double GetNormalizedFlapLeft() const;
822 double GetNormalizedFlapRight() const;
823 double GetNormalizedSpoilerLeft() const;
824 double GetNormalizedSpoilerRight() const;
825 double GetNormalizedStabilizerLeft() const;
826 double GetNormalizedStabilizerRight() const;
827 double GetNormalizedElevator() const;
828 double GetNormalizedRudderLeft() const;
829 double GetNormalizedRudder() const;
830 double GetNormalizedRudderRight() const;
831 double GetNormalizedSpeedBrake() const;
832 double GetNormalizedLandingGear() const;
833 double GetNormalizedLandingGearNose() const;
834 double GetNormalizedLandingGearMainLeft() const;
835 double GetNormalizedLandingGearMainRight() const;
836
837 // These functions return true if the data for that control surface is valid
838 bool AileronLeftValid() const;
839 bool AileronRightValid() const;
840 bool FlapLeftValid() const;
841 bool FlapRightValid() const;
842 bool SpoilerLeftValid() const;
843 bool SpoilerRightValid() const;
844 bool StabilizerLeftValid() const;
845 bool StabilizerRightValid() const;
846 bool ElevatorValid() const;
847 bool RudderLeftValid() const;
848 bool RudderValid() const;
849 bool RudderRightValid() const;
850 bool SpeedBrakeValid() const;
851 bool LandingGearValid() const;
852 bool LandingGearNoseValid() const;
853 bool LandingGearMainLeftValid() const;
854 bool LandingGearMainRightValid() const;
855 bool ThrottleValid() const;
856
857 // These functions return the normalized control input (lever) value
858 double GetStickRightInput() const;
859 double GetStickBackInput() const;
860 double GetRudderRightInput() const;
861 double GetThrottleInput() const;
862 double GetSpeedBrakeInput() const;
863 double GetSpoilerInput() const;
864 double GetLandingGearInput() const;
865
866 // ====================================================================================================================
867
868 // Landing gear functions
869
870 void CalculateLandingGearFM(int64_t aSimTime_nanosec,
871 const UtVec3dX& aNonLandingGearTotalForceVecInertial_lbs,
872 UtVec3dX& aInertialTotalGearVector_lbs,
873 UtVec3dX& aTotalGearMoment_ftlbs);
874
875 // Use this to set landing gear position at start of simulation
876 void SetLandingGearPositionAtStart(double aPosition);
877
878 // This will force the gear to the specified position instantly. The typical name is "Landing_Gear_Extended", but it
879 // may use a different name.
880 void ForceLandingGearPositionInstantly(std::string aLandingGearControlSurfaceHandleName, double aPosition);
881
882 // This will force the gear up instantly. The typical name is "Landing_Gear_Extended", but it may use a different name.
883 void ForceLandingGearUpInstantly(const std::string& aLandingGearControlSurfaceHandleName);
884
885 // This will force the gear down instantly. The typical name is "Landing_Gear_Extended", but it may use a different name.
886 void ForceLandingGearDownInstantly(const std::string& aLandingGearControlSurfaceHandleName);
887
888 // Returns true if the object has landing gear
889 bool HasLandingGear() const { return (mLandingGearPtr != nullptr); }
890
891 // This returns the landing gear object. Null is returned when no landing gear are present.
893
894 // ====================================================================================================================
895
896 // Sequencer functions
897
898 P6DofSequencer* GetSequencerByName(const std::string& aName) const;
899
900 // This will attempt to activate a sequencer with the specified name. Returns true if the sequencer was activated. It
901 // will return false if the sequencer was already activated or cannot be activated.
902 bool ActivateSequencer(const std::string& aSequencerName);
903
904 // This will attempt to activate the specified sequencer on the specified subobject. If there is no first-level
905 // subobjects with the specified name, the command will be passed to subobject, which will recurse the command to its
906 // subobjects, and so on. Returns true if the sequencer was activated. It will return false if the sequencer was
907 // already activated or cannot be activated.
908 bool ActivateSequencer(const std::string& aSubobjectName, const std::string& aSequencerName);
909
910 // This determines when the next time-based events (either sequencer event or a guidance and control event) will
911 // occur, within a goal simulation time. It returns true if the event time is valid, else returns false, indicating
912 // that there are no currently queued sequencer or guidance/control events.
913 bool PendingEventTimes_nanosec(int64_t aSimTime_nanosec, std::set<int64_t>& aEventTime_nanosec);
914
915 // This determines when the next time-based sequencer events will occur, within a goal simulation time. It returns true
916 // if the event time is valid, else returns false, indicating that there are no currently queued sequencer or
917 // guidance/control events.
918 bool PendingSequencerEventTimes_nanosec(int64_t aSimTime_nanosec, std::set<int64_t>& aEventTime_nanosec);
919
920 // This determines when the next time-based guidance or control event will occur, within a goal simulation time. It
921 // returns true if the event time is valid, else returns false, indicating that there are no currently queued
922 // sequencer or guidance/control events.
923 bool PendingGuidanceControlEventTimes_nanosec(int64_t aSimTime_nanosec, std::set<int64_t>& aEventTime_nanosec);
924
925 // This returns the last Nx_g. It is used in sequencers to detect if g-loads are increasing or decreasing.
926 double GetLastNx_g() const;
927
928 // This returns the last Ny_g. It is used in sequencers to detect if g-loads are increasing or decreasing.
929 double GetLastNy_g() const;
930
931 // This returns the last Nz_g. It is used in sequencers to detect if g-loads are increasing or decreasing.
932 double GetLastNz_g() const;
933
934 // This returns the last dynamic pressure (Q). It is used in sequencers to detect if Q is increasing or decreasing.
935 double GetLastDynamicPressure_psf() const;
936
937 // This returns the last static pressure (P). It is used in sequencers to detect if P is increasing or decreasing.
938 double GetLastStaticPressure_psf() const;
939
940 // This returns the last altitude in feet. It is used in sequencers to detect if the altitude is increasing or
941 // decreasing.
942 double GetLastAltitudeMSL_ft() const;
943
944 // This returns the last captive state (true means the object is captive to its parent). It is used in sequencers to
945 // detect if the captive state has changed.
946 bool GetLastIsCaptive() const { return mLastIsCaptive; }
947
948 // ====================================================================================================================
949
950 // Testing functions
951
952 // This function is used to drive P6DOF in external programs, especially for performance calculations. It
953 // automatically resets internal P6DOF data as well as setting the altitude, speed, pitch angle, stick and throttle
954 // as specified. It also sets flags for freeze location, altitude, fuel burn, and no lag testing as well as
955 // performing a single Update() function, automatically a synthetic sim time argument. Note: the stick back value may
956 // be +/-1 while flaps are are 0-1. Throttle forward assumes that 1 is full (afterburner) and 0.5 is military power.
957 void TestingUpdate(double aAltitude_ft,
958 double aSpeed_fps,
959 double aPitchAngle_deg,
960 double aStickBack,
961 double aThrottleForward,
962 double aFlapsDown);
963
964 double GetNominalEstimateMaxMach() const { return mMaxMach; }
968
969 // This is used to prevent crashes when passing through the ground/sea surface or the artificial "floor" of sea
970 // level. It is usually set to true when testing.
972
973 // This returns true when crashes with the ground will be ignored
975
976 // This is used to prevent the vehicle from going below sea level at any time. The effectively limits the altitude
977 // to zero. It is sometimes set to true when testing.
979
980 // This returns true when the vehicle will be prevented from going below sea level at any time. The altitude will
981 // effectively be limited to zero.
983
984 // This sets kinematic state parameters to a zero condition for testing
985 void ZeroKinematicsDuringTesting();
986
987 void ComputeWashInConditions(double aSimTime_sec);
988
989 // ====================================================================================================================
990
991 UtCallbackListN<void(double)> CrashedIntoGround;
992 // First P6DofVehicle* is the Newly Jettisoned Object, and the second is the Parent object that released it
993 UtCallbackListN<void(std::unique_ptr<P6DofVehicle>&)> SubobjectJettisoned;
994
995protected:
996 P6DofVehicle(const P6DofVehicle& aSrc);
997
998 void CopyDataFromParent();
999
1000 void DeriveFromObjectType(const P6DofVehicleType* aObjectType, const std::string& aPrefixName);
1001
1002 // This is used by all Initialize functions to complete "details"
1003 bool InitializeDetails(double aSimTime_sec);
1004
1005 std::unique_ptr<P6DofVehicle> SeparateSubObject(P6DofVehicle* aSubObject);
1006 void SetSphericalEarthFlagOnSubobjects(bool aSetting);
1007
1009
1010 // This returns the pitching moment (ft-lbs) for the specified angle of attack (alpha) and stick back at the current
1011 // conditions. Note -- this assumes that "testing" controls are being used.
1012 double CalculatePitchMomentAlphaStickBack_ftlbs(double aAlpha_deg, double aDesiredStickBack);
1013
1014 void CalculateMovableAero(double aDynPress_lbsqft,
1015 double aMach,
1016 double aSpeed_fps,
1017 double aAlpha_rad,
1018 double aBeta_rad,
1019 const UtVec3dX& aAngularRates_rps,
1020 UtVec3dX& aAeroMoment,
1021 double& aLift,
1022 double& aDrag,
1023 double& aSide,
1024 double& aLiftFactor);
1025
1026 void CalculateThrustVectorAndMomentUpdatePropulsion(double aSimTime_sec,
1027 double aDeltaTime_sec,
1028 P6DofKinematicState& aState,
1029 P6DofForceAndMomentsObject& aForceAndMoment);
1030
1031 void UpdatePropulsionFuelBurn(double aSimTime_sec, double aDeltaTime_sec, P6DofKinematicState& aState);
1032
1033 void CalculateObjectPropulsion(double aSimTime_sec,
1034 double aDeltaT_sec,
1035 double aAlt_ft,
1036 double aDynPress_lbsqft,
1037 double aStatPress_lbssqft,
1038 double aSpeed_fps,
1039 double aMach,
1040 double aAlpha_rad,
1041 double aBeta_rad,
1042 P6DofForceAndMomentsObject& aForceAndMoment,
1043 double& aFuelBurnRate_pps,
1044 double& aFuelBurned_lbs);
1045
1046 void UpdateObjectPropulsion(double aSimTime_sec,
1047 double aDeltaT_sec,
1048 double aAlt_ft,
1049 double aDynPress_lbsqft,
1050 double aStatPress_lbssqft,
1051 double aSpeed_fps,
1052 double aMach,
1053 double aAlpha_rad,
1054 double aBeta_rad,
1055 P6DofForceAndMomentsObject& aForceAndMoment,
1056 double& aFuelBurnRate_pps,
1057 double& aFuelBurned_lbs);
1058
1059 void ObjectPropulsionCalculations(double aSimTime_sec,
1060 double aDeltaT_sec,
1061 double aAlt_ft,
1062 double aDynPress_lbsqft,
1063 double aStatPress_lbssqft,
1064 double aSpeed_fps,
1065 double aMach,
1066 double aAlpha_rad,
1067 double aBeta_rad,
1068 P6DofForceAndMomentsObject& aForceAndMoment,
1069 double& aFuelBurnRate_pps,
1070 double& aFuelBurned_lbs,
1071 bool aUpdateData);
1072
1073 void CalculateSizeFactor(double dT_sec);
1074
1075 void CalcTotalFuelFlowAndQuantity(double& aCurrentTotalFuelFlow_pph,
1076 double& aCurrentTotalFuel_lbs,
1077 double& aMaxTotalFuel_lbs);
1078
1079 void HandleGroundContact(int64_t aSimTime_nanosec);
1080
1081 void SetupStartingLatLon();
1082 void SetTheLastValues();
1083
1084 void PerformCrash(int64_t aSimTime_nanosec);
1086
1087 void CalculateWashIn(double aSimTime_sec);
1088
1089 // Returns the angle (deg) of the surface with the specified handle
1090 double GetAngleSurface(size_t aHandle) const;
1091
1092 // Returns the normalized angle of the surface with the specified handle
1093 double GetNormalizedSurfaceAngle(size_t aHandle) const;
1094
1095 // Find the various parts -- landing gear, control surfaces, engines, etc.
1096 void FindParts();
1097
1098 // Calculate the stall angle
1099 void CalcStallAngle();
1100
1101 // ====================================================================================================================
1102
1103 std::string mBaseName;
1105
1107
1112
1113 std::list<ut::CloneablePtr<P6DofVehicle>> mSubObjectList;
1114
1115 ut::CloneablePtr<P6DofAeroCoreObject> mAeroCoreObjPtr;
1116 std::list<ut::CloneablePtr<P6DofAeroMovableObject>> mAeroPartList;
1117
1120
1121 ut::CloneablePtr<P6DofPropulsionSystem> mPropulsionObjPtr;
1122
1123 std::vector<ut::CloneablePtr<P6DofSequencer>> mSequencerList;
1124
1127
1128 // ====================================================================================================================
1129
1134
1135 // Graphical support
1137
1139
1145
1148
1149 P6DofSizeFactor mSizeFactor; // The size factor allows effects (esp aerodynamic)
1150
1151 bool mFixedObject; // If set to true, the object will not move
1152
1153 // These parameters are used to generate internal tabular data. Although the object can operate outside of these
1154 // values, the tabular data will be clamped to the highest value. For this reason, accurate estimates of the
1155 // operating envelope should be used.
1156 double mMaxMach;
1160
1163
1164 // TODO - Refactor this to avoid using "targets" in P6DOF
1167
1174
1175 ut::CloneablePtr<P6DofFlightControlSystem> mFlightControlsPtr;
1176 ut::CloneablePtr<P6DofPilotManager> mPilotManagerPtr;
1177
1178 ut::CloneablePtr<P6DofLandingGear> mLandingGearPtr;
1179
1180 UtQuaternion mQuaternion;
1183
1185
1186 // These are used for tuning
1189
1190 // TODO - Refactor this to avoid using "targets" in P6DOF
1194
1198
1201
1212 size_t mHandleRudder = 0;
1219
1220 double mStallAngle = 0.0;
1221 double mStallDetectionDeltaAngle = 0.0; // This is a delta angle where stall is detected
1222};
1223
1224#endif
aObjectPtr GetLocationLLA(lla[0], lla[1], lla[2])
aObjectPtr Update(simTime)
aObjectPtr GetVelocityWCS(vel.GetData())
pointPtr SetLocationWCS(finalPos.GetData())
Definition P6DofAeroCoreObject.hpp:32
Definition P6DofFlightControlSystem.hpp:42
Definition P6DofForceAndMomentsObject.hpp:24
Definition P6DofFuelTank.hpp:33
Definition P6DofGraphicalSupport.hpp:24
Definition P6DofIntegrator.hpp:28
Definition P6DofKinematicState.hpp:31
Definition P6DofLandingGear.hpp:33
Definition P6DofMassProperties.hpp:26
Definition P6DofObject.hpp:24
P6DofObject(P6DofScenario *aScenario)
Definition P6DofObject.cpp:17
P6DofObject * Clone() const
Definition P6DofObject.cpp:24
virtual void SetParentVehicle(P6DofVehicle *aParentVehicle)
Definition P6DofObject.hpp:39
Definition P6DofPilotManager.hpp:38
Definition P6DofPilotObject.hpp:37
Definition P6DofPropulsionSystem.hpp:35
Definition P6DofScenario.hpp:25
Definition P6DofSequencer.hpp:28
Definition P6DofSizeFactor.hpp:24
Definition P6DofThrustProducerObject.hpp:34
Definition P6DofTypeManager.hpp:30
Definition P6DofVehicleType.hpp:41
Definition P6DofVehicle.hpp:53
std::string GetBaseName() const
Definition P6DofVehicle.hpp:138
P6DofPilotManager * GetPilotManager() const
Definition P6DofVehicle.hpp:753
size_t mHandleSpoilerLeft
Definition P6DofVehicle.hpp:1206
bool mIsDestroyed
Definition P6DofVehicle.hpp:1197
P6DofLandingGear * GetLandingGear() const
Definition P6DofVehicle.hpp:892
void FindParts()
Definition P6DofVehicle.cpp:5469
ut::CloneablePtr< P6DofPropulsionSystem > mPropulsionObjPtr
Definition P6DofVehicle.hpp:1121
size_t mHandleAileronLeft
Definition P6DofVehicle.hpp:1202
double GetLastUpdateTime_sec() const
Definition P6DofVehicle.hpp:154
size_t mHandleFlapLeft
Definition P6DofVehicle.hpp:1204
int mNumTracks
Definition P6DofVehicle.hpp:1193
int64_t mStepSize_nanosec
Definition P6DofVehicle.hpp:1126
double GetNominalEstimateMaxAlpha_deg() const
Definition P6DofVehicle.hpp:965
UtVec3dX mAngRelToParentYPR_rad
Definition P6DofVehicle.hpp:1109
void MakeSyntheticPilotActive()
bool mOnFire
Definition P6DofVehicle.hpp:1144
void UpdatePropulsionFuelBurn(double aSimTime_sec, double aDeltaTime_sec, P6DofKinematicState &aState)
Definition P6DofVehicle.cpp:3104
void CalculateWashIn(double aSimTime_sec)
Definition P6DofVehicle.cpp:642
std::string GetActiveAeroObjectName() const
Definition P6DofVehicle.hpp:508
double mMaxAlpha_deg
Definition P6DofVehicle.hpp:1157
UtVec3dX mTargetWCSLocation_m
Definition P6DofVehicle.hpp:1165
double GetNormalizedSurfaceAngle(size_t aHandle) const
Definition P6DofVehicle.cpp:5459
void SetTheLastValues()
Definition P6DofVehicle.cpp:3248
double GetLifeTime_sec() const
Definition P6DofVehicle.hpp:158
double GetNominalEstimateMaxBeta_deg() const
Definition P6DofVehicle.hpp:967
void SetWashInInitConditions(bool aUseWashInInitConditions)
Definition P6DofVehicle.hpp:77
double GetNominalEstimateMaxMach() const
Definition P6DofVehicle.hpp:964
bool mTargetWCSLocationValid
Definition P6DofVehicle.hpp:1166
int64_t mLifeTime_nanosec
Definition P6DofVehicle.hpp:1146
int64_t mLastSimTime_nanosec
Definition P6DofVehicle.hpp:1125
std::string mDerivedFromObjectName
Definition P6DofVehicle.hpp:1104
void SetTestingIgnoreAllCrashes(bool aValue)
Definition P6DofVehicle.hpp:971
bool mDamageSmokeTrailingEffect
Definition P6DofVehicle.hpp:1195
void SetSizeFactorEnabled(bool aSetting)
Definition P6DofVehicle.hpp:96
size_t mHandleSpeedBrake
Definition P6DofVehicle.hpp:1214
double GetTimeOfFlight_sec() const
Definition P6DofVehicle.hpp:161
bool mAfterburnerOn
Definition P6DofVehicle.hpp:1142
bool mIsCaptive
Definition P6DofVehicle.hpp:1106
void SetSphericalEarthFlagOnSubobjects(bool aSetting)
Definition P6DofVehicle.cpp:3024
bool mSmoking
Definition P6DofVehicle.hpp:1143
bool mLastIsCaptive
Definition P6DofVehicle.hpp:1138
size_t mHandleElevator
Definition P6DofVehicle.hpp:1210
void SetBaseName(const std::string &aName)
Definition P6DofVehicle.hpp:147
std::string GetDerivedFromObjectName() const
Definition P6DofVehicle.hpp:141
double mPrepositionLat
Definition P6DofVehicle.hpp:1187
size_t mHandleStabilizerRight
Definition P6DofVehicle.hpp:1209
bool mFixedObject
Definition P6DofVehicle.hpp:1151
P6DOF::TrackData mTrackData[10]
Definition P6DofVehicle.hpp:1192
ut::CloneablePtr< P6DofAeroCoreObject > mAeroCoreObjPtr
Definition P6DofVehicle.hpp:1115
void CopyDataFromParent()
Definition P6DofVehicle.cpp:2109
std::list< ut::CloneablePtr< P6DofAeroMovableObject > > mAeroPartList
Definition P6DofVehicle.hpp:1116
const P6DofIntegrator * mIntegratorPtr
Definition P6DofVehicle.hpp:1132
double mMaxBeta_deg
Definition P6DofVehicle.hpp:1159
std::list< ut::CloneablePtr< P6DofVehicle > > mSubObjectList
Definition P6DofVehicle.hpp:1113
double GetCurrentWeight_lbs() const
Definition P6DofVehicle.hpp:109
bool mTestingClampToSealLevelMinAlt
Definition P6DofVehicle.hpp:1200
std::unique_ptr< P6DofVehicle > SeparateSubObject(P6DofVehicle *aSubObject)
Definition P6DofVehicle.cpp:2546
void HandleGroundContact(int64_t aSimTime_nanosec)
Definition P6DofVehicle.cpp:1407
ut::CloneablePtr< P6DofPilotManager > mPilotManagerPtr
Definition P6DofVehicle.hpp:1176
void ClampToSealLevelMinAlt()
Definition P6DofVehicle.cpp:1397
bool mTestingIgnoreAllCrashes
Definition P6DofVehicle.hpp:1199
bool Initialize(double aSimTime_sec, const P6DofVehicleType *aObjectType, const std::string &aPrefixName)
Definition P6DofVehicle.cpp:467
bool mUseWashInInitConditions
Definition P6DofVehicle.hpp:1182
void CalculateMovableAero(double aDynPress_lbsqft, double aMach, double aSpeed_fps, double aAlpha_rad, double aBeta_rad, const UtVec3dX &aAngularRates_rps, UtVec3dX &aAeroMoment, double &aLift, double &aDrag, double &aSide, double &aLiftFactor)
Definition P6DofVehicle.cpp:810
void PerformCrash(int64_t aSimTime_nanosec)
Definition P6DofVehicle.cpp:1376
void UpdateAppearance()
Definition P6DofVehicle.hpp:413
int64_t mTestingSimTime_nanosec
Definition P6DofVehicle.hpp:1184
P6DofSizeFactor mSizeFactor
Definition P6DofVehicle.hpp:1149
std::string mIntegratorTypeName
Definition P6DofVehicle.hpp:1133
bool GetTestingIgnoreAllCrashes() const
Definition P6DofVehicle.hpp:974
int64_t mTimeOfFlight_nanosec
Definition P6DofVehicle.hpp:1147
double mInitialLat
Definition P6DofVehicle.hpp:1168
bool mCrashed
Definition P6DofVehicle.hpp:1140
bool GetTestingClampToSealLevelMinAlt() const
Definition P6DofVehicle.hpp:982
void CalculateSizeFactor(double dT_sec)
Definition P6DofVehicle.cpp:3011
size_t mHandleRudderRight
Definition P6DofVehicle.hpp:1213
void SetTestingClampToSealLevelMinAlt(bool aValue)
Definition P6DofVehicle.hpp:978
UtCallbackListN< void(double)> CrashedIntoGround
Definition P6DofVehicle.hpp:991
std::vector< ut::CloneablePtr< P6DofSequencer > > mSequencerList
Definition P6DofVehicle.hpp:1123
P6DofKinematicState mKinematicState
Definition P6DofVehicle.hpp:1131
double CalculatePitchMomentAlphaStickBack_ftlbs(double aAlpha_deg, double aDesiredStickBack)
Definition P6DofVehicle.cpp:4427
P6DofFlightControlSystem * GetFlightControls() const
Definition P6DofVehicle.hpp:772
double mInitialAlt_m
Definition P6DofVehicle.hpp:1170
P6DofKinematicState & GetKinematicState()
Definition P6DofVehicle.hpp:124
size_t mHandleRudderLeft
Definition P6DofVehicle.hpp:1211
bool Crashed() const
Definition P6DofVehicle.hpp:92
int64_t GetLifeTime_nanosec() const
Definition P6DofVehicle.hpp:165
double mPrepositionLon
Definition P6DofVehicle.hpp:1188
const P6DofIntegrator * GetIntegratorPtr() const
Definition P6DofVehicle.hpp:131
void MakeHardwareAutopilotActive()
P6DOF::CurrentTargetData mCurrentTarget
Definition P6DofVehicle.hpp:1191
void MakeManualPilotActive()
void MakeGuidanceAutopilotActive()
double GetEmptyWeight_lbs() const
Definition P6DofVehicle.hpp:108
size_t mHandleLandingGear
Definition P6DofVehicle.hpp:1215
ut::CloneablePtr< P6DofLandingGear > mLandingGearPtr
Definition P6DofVehicle.hpp:1178
bool mFlamesPresent
Definition P6DofVehicle.hpp:1196
void ObjectPropulsionCalculations(double aSimTime_sec, double aDeltaT_sec, double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad, P6DofForceAndMomentsObject &aForceAndMoment, double &aFuelBurnRate_pps, double &aFuelBurned_lbs, bool aUpdateData)
Definition P6DofVehicle.cpp:1544
size_t GetNumSubobjects() const
Definition P6DofVehicle.hpp:580
double mMaxMach
Definition P6DofVehicle.hpp:1156
P6DofPropulsionSystem * GetPropulsionSystem() const
Definition P6DofVehicle.hpp:606
size_t mHandleSpoilerRight
Definition P6DofVehicle.hpp:1207
void SetAngRelToParentYPR_rad(const UtVec3dX &aAngRelToParentYPR_rad)
Definition P6DofVehicle.hpp:558
void DeriveFromObjectType(const P6DofVehicleType *aObjectType, const std::string &aPrefixName)
Definition P6DofVehicle.cpp:328
double GetAngleSurface(size_t aHandle) const
Definition P6DofVehicle.cpp:5449
std::string mActiveAeroModeName
Definition P6DofVehicle.hpp:1118
P6DofAeroCoreObject * mActiveAeroObjPtr
Definition P6DofVehicle.hpp:1119
UtQuaternion mQuaternion
Definition P6DofVehicle.hpp:1180
UtCallbackListN< void(std::unique_ptr< P6DofVehicle > &)> SubobjectJettisoned
Definition P6DofVehicle.hpp:993
void SetParentVehicleForComponents()
Definition P6DofVehicle.cpp:281
void SetCaptiveState(bool aIsCaptive)
Definition P6DofVehicle.hpp:556
UtVec3dX mSeparationVel_fps
Definition P6DofVehicle.hpp:1110
int64_t GetTimeOfFlight_nanosec() const
Definition P6DofVehicle.hpp:169
P6DofAeroCoreObject * GetActiveAeroObject() const
Definition P6DofVehicle.hpp:505
double mMinAlpha_deg
Definition P6DofVehicle.hpp:1158
size_t mHandleRudder
Definition P6DofVehicle.hpp:1212
bool InitializeDetails(double aSimTime_sec)
Definition P6DofVehicle.cpp:475
size_t mHandleLandingGearMainRight
Definition P6DofVehicle.hpp:1218
ut::CloneablePtr< P6DofFlightControlSystem > mFlightControlsPtr
Definition P6DofVehicle.hpp:1175
bool HasLandingGear() const
Definition P6DofVehicle.hpp:889
double GetNominalEstimateMinAlpha_deg() const
Definition P6DofVehicle.hpp:966
void CalculateThrustVectorAndMomentUpdatePropulsion(double aSimTime_sec, double aDeltaTime_sec, P6DofKinematicState &aState, P6DofForceAndMomentsObject &aForceAndMoment)
Definition P6DofVehicle.cpp:3035
double mInitialLon
Definition P6DofVehicle.hpp:1169
std::string mBaseName
Definition P6DofVehicle.hpp:1103
void SetupStartingLatLon()
Definition P6DofVehicle.cpp:3209
size_t mHandleFlapRight
Definition P6DofVehicle.hpp:1205
bool InitializeConditions(double aSimTime_sec)
Definition P6DofVehicle.cpp:629
const P6DofMassProperties & GetMassProperties() const
Definition P6DofVehicle.hpp:103
void CalculateObjectPropulsion(double aSimTime_sec, double aDeltaT_sec, double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad, P6DofForceAndMomentsObject &aForceAndMoment, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)
Definition P6DofVehicle.cpp:1488
bool GetLastIsCaptive() const
Definition P6DofVehicle.hpp:946
UtVec3dX mCgForce_lbs
Definition P6DofVehicle.hpp:1161
~P6DofVehicle() override=default
double mStallDetectionDeltaAngle
Definition P6DofVehicle.hpp:1221
bool mThrustTerminationTimeValid
Definition P6DofVehicle.hpp:1173
P6DofVehicle(P6DofScenario *aScenario)
Definition P6DofVehicle.cpp:53
double mStallAngle
Definition P6DofVehicle.hpp:1220
P6DofGraphicalSupport mGraphicalSupport
Definition P6DofVehicle.hpp:1136
void UpdateObjectPropulsion(double aSimTime_sec, double aDeltaT_sec, double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad, P6DofForceAndMomentsObject &aForceAndMoment, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)
Definition P6DofVehicle.cpp:1516
UtVec3dX mSeparationOmega_rps
Definition P6DofVehicle.hpp:1111
UtVec3dX mPosRelToParent_m
Definition P6DofVehicle.hpp:1108
size_t mHandleStabilizerLeft
Definition P6DofVehicle.hpp:1208
bool mInitSetupMode
Definition P6DofVehicle.hpp:1181
void CalcTotalFuelFlowAndQuantity(double &aCurrentTotalFuelFlow_pph, double &aCurrentTotalFuel_lbs, double &aMaxTotalFuel_lbs)
Definition P6DofVehicle.cpp:1777
double mThrustTerminationTime_sec
Definition P6DofVehicle.hpp:1172
bool IsCaptive() const
Definition P6DofVehicle.hpp:551
void CalcStallAngle()
Definition P6DofVehicle.cpp:5697
size_t mHandleAileronRight
Definition P6DofVehicle.hpp:1203
UtVec3dX mCgMoment_ftlbs
Definition P6DofVehicle.hpp:1162
double mDownRangeDist_m
Definition P6DofVehicle.hpp:1171
bool mEngineOn
Definition P6DofVehicle.hpp:1141
size_t mHandleLandingGearMainLeft
Definition P6DofVehicle.hpp:1217
size_t mHandleLandingGearNose
Definition P6DofVehicle.hpp:1216
P6DofMassProperties mMassProperties
Definition P6DofVehicle.hpp:1130
P6DofVehicle & operator=(const P6DofVehicle &other)=delete
P6DOF_EXPORT int64_t TimeToTime(double aSimTime_sec)
Definition P6DofUtils.cpp:646
Definition P6DofVehicleData.hpp:430
Definition P6DofVehicleData.hpp:421
Copyrights Multiple, All Rights Reserved