WSF
WsfSixDOF_Mover.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 2020 Infoscitex, a DCS 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 WSFSIXDOFMOVER_HPP
13#define WSFSIXDOFMOVER_HPP
14
15#include "wsf_six_dof_export.h"
16
17#include <list>
18
19#include "UtCallback.hpp"
20#include "UtCallbackHolder.hpp"
21#include "UtDCM.hpp"
22#include "UtEntity.hpp"
23#include "UtInput.hpp"
24#include "UtQuaternion.hpp"
25#include "UtTable.hpp"
26#include "UtVec3dX.hpp"
27#include "WsfMover.hpp"
29#include "WsfRoute.hpp"
30class WsfVisualPart;
34#include "WsfSixDOF_Route.hpp"
38#include "WsfSixDOF_Utils.hpp"
40#include "WsfWaypoint.hpp"
41#include "maneuvers/WsfSixDOF_Maneuver.hpp"
42#include "maneuvers/WsfSixDOF_ManeuverSequence.hpp"
43
44namespace wsf
45{
46namespace six_dof
47{
48class AeroCoreObject;
51class Integrator;
52class MoverTestObject;
53class PilotManager;
54class PilotObject;
55
57class WSF_SIX_DOF_EXPORT Mover : public WsfMover
58{
59 friend class TypeManager; // This relationship allows us to build subobject lists of varying fidelity levels
60
61public:
63 explicit Mover(const WsfScenario& aScenario);
64
65 virtual ~Mover();
66
67 // TODO -- At the present time, only the AIR domain is specified, but SixDOF can support AIR and SPACE domains.
69
70 bool ProcessInput(UtInput& aInput) override;
71 bool ProcessVehicleInput(UtInput& aInput);
72
73 bool Initialize(double aSimTime) override;
74
76
78
79 void UpdateEventPipeData(double aSimTime);
80
81 // Sets the vehicle to the specified NED heading (in radians)
82 void SetHeading(double aHeading) override;
83
84 // Sets the vehicle to the specified NED pitch angle (in radians)
85 void SetPitch(double aPitch) override;
86
87 // Sets the vehicle to the specified NED roll angle (in radians)
88 void SetRoll(double aRoll) override;
89
90 // Sets the orientation of the vehicle to the specified values (in radians)
91 void SetOrientationNED(double aHeading, double aPitch, double aRoll) override;
92
93 // This provides a set of top-level state data for the SixDOF vehicle
94 void GetStateData(double& aSimTime_sec,
95 double& aLat,
96 double& aLon,
97 double& aAlt_m,
98 double& aLocalHeading_deg,
99 double& aLocalPitch_deg,
100 double& aLocalRoll_deg,
101 double& aAlpha_deg,
102 double& aBeta_deg,
103 double& aSpeed_kts,
104 double& aVertSpeed_fpm,
105 double& aYawRate_dps,
106 double& aPitchRate_dps,
107 double& aRollRate_dps) const;
108
109 // Return the index of the planned route
110 size_t GetPlannedRouteIndex() const;
111
112 // Return the index of the temporary route
113 size_t GetTempRouteIndex() const;
114
116
117 // Returns the current altitude in meters
118 double GetAlt_m() const { return GetAltitudeMSL_m(); }
119
120 // Returns vertical speed in m/sec
121 double GetVerticalSpeed() { return GetVertSpeed_fpm() * UtMath::cM_PER_FT / 60.0; }
122
123 // Returns flight path angle in degrees
125
126 // Returns the current g-load in the vehicle's z-axis. Positive g-load is in the negative z direction.
127 double GetGLoad() { return -GetNz_g(); }
128
129 // This returns the current heading in degrees
130 double GetHeading() const { return GetHeading_deg(); }
131
132 // This returns the current pitch in degrees
133 double GetPitch() const { return GetPitch_deg(); }
134
135 // This returns the current roll in degrees
136 double GetRoll() const { return GetRoll_deg(); }
137
138 // Returns yaw rate in rad/sec
139 double GetYawRate() { return GetYawRate_rps(); }
140
141 // Returns pitch rate in rad/sec
142 double GetPitchRate() { return GetPitchRate_rps(); }
143
144 // Returns roll rate in rad/sec
145 double GetRollRate() { return GetRollRate_rps(); }
146
147 // Returns the most recent lift in newtons
148 double GetLift_nt() const { return GetLift_lbs() * UtMath::cNT_PER_LB; }
149
150 // Returns the most recent drag in newtons
151 double GetDrag_nt() const { return GetDrag_lbs() * UtMath::cNT_PER_LB; }
152
153 // Returns the most recent side force in newtons
154 double GetSideForce_nt() const { return GetSideForce_lbs() * UtMath::cNT_PER_LB; }
155
156 // This returns the thrust magnitude in newtons
157 double GetThrustMagnitude_nt() const { return GetThrustMagnitude_lbs() * UtMath::cNT_PER_LB; }
158
159 // Returns the current speed in KIAS
160 double GetSpeed_KIAS() const { return GetKIAS(); }
161
162 // Returns the current speed in KCAS
163 double GetSpeed_KCAS() const { return GetKCAS(); }
164
165 // Returns the current speed in KTAS
166 double GetSpeed_KTAS() const { return GetKTAS(); }
167
168 // Returns the current speed in Mach
169 double GetSpeed_Mach() const { return GetMach(); }
170
171 // Returns the current mass in kg
172 double GetCurrentWeight_kg() const { return GetCurrentWeight_lbs() * UtMath::cKG_PER_LB; }
173
174 // Returns the empty mass in kg
175 double GetEmptyWeight_kg() const { return GetEmptyWeight_lbs() * UtMath::cKG_PER_LB; }
176
177 // Returns mass in lbs
178 double GetTotalWeight_lbs() const;
179
180 // Returns mass in kg
181 double GetTotalWeight_kg() const;
182
183 // Returns true if there is weight on any wheel. Returns false by default.
184 virtual bool GetWeightOnWheels() const { return false; }
185
186 // This returns true if at least one engine (thrust producer) is producing thrust
187 bool IsProducingThrust() const;
188
189 // This returns thrust magnitude in Newtons
190 double GetTotalThrust();
191
192 // This returns forward thrust in Newtons
193 double GetTotalForwardThrust();
194
195 // This returns true if any afterburner is on
196 bool GetAfterburnerOn() const;
197
198 // This returns thrust in Newtons for the specified engine
199 double GetEngineThrust(const std::string& aEngineName) const;
200
201 // This returns the fuel flow (kg/sec) for the specified engine
202 double GetEngineFuelFlowRate(const std::string& aEngineName) const;
203
204 // This returns true if the afterburner is active for the specified engine
205 bool GetEngineAfterburnerOn(const std::string& aEngineName) const;
206
207 // This returns the total fuel flow rate in kg/sec
208 double GetTotalFuelFlowRate() const;
209
210 // This adds a new fuel transfer to the propulsion system. The fuel transfer name must be unique.
211 // It returns true if the transfer is created.
212 bool AddFuelTransfer(std::string aFuelTransferName, std::string aSourceTankName, std::string aTargetTankName);
213
214 // This removes the fuel transfer with the specified name. It returns true if the removal is successful.
215 bool RemoveFuelTransfer(std::string aFuelTransferName);
216
217 // EnableThrustVectoring enables/disable thrust vectoring
218 void EnableThrustVectoring(bool aEnableThrustVectoring);
219
220
222
223 // This sets the autopilot to use pitch angle mode with the specified pitch angle (in degrees)
224 void SetAutopilotPitchAngle(double aPitchAngle_deg);
225
226 // This sets the autopilot to use flight path angle mode with the specified flight path angle (in degrees)
227 void SetAutopilotFlightPathAngle(double aFlightPathAngle_deg);
228
229 // This sets the autopilot to use vertical speed mode with the specified vertical speed (in ft/min)
230 void SetAutopilotVerticalSpeed(double aVerticalSpeed_fpm);
231
232 // This sets the autopilot to use altitude mode with the specified altitude (in feet)
233 void SetAutopilotAltitude(double aAltitude_ft);
234
235 // This sets the autopilot to use roll/bank angle mode with the specified roll/bank angle (in degrees)
236 void SetAutopilotRollAngle(double aRollAngle_deg);
237
238 // This sets the autopilot to use roll rate mode with the specified roll rate (in deg/sec)
239 void SetAutopilotRollRate(double aRollRate_dps);
240
241 // This sets the autopilot to use pitch g-load mode with the specified g-load
242 void SetPitchGLoad(double aGLoad);
243
244 // This sets the autopilot to use pitch rate mode with the specified pitch rate (in deg/sec)
245 void SetAutopilotPitchRate(double aPitchRate_dps);
246
247 // This sets the autopilot to use delta pitch mode with the specified delta pitch (in degrees)
248 void SetAutopilotDeltaPitch(double DeltaPitchAngle_deg);
249
250 // This sets the autopilot to use delta roll mode with the specified delta roll (in degrees)
251 void SetAutopilotDeltaRoll(double DeltaRollAngle_deg);
252
253 // This sets the autopilot to maintain the specified speed (in KTAS, knots true air speed)
254 void SetAutopilotSpeedKTAS(double aSpeed_KTAS);
255
256 // This sets the autopilot to maintain the specified speed (in KCAS, knots calibrated air speed)
257 void SetAutopilotSpeedKCAS(double aSpeed_KCAS);
258
259 // This sets the autopilot to maintain the specified speed (in Mach)
260 void SetAutopilotSpeedMach(double aSpeed_Mach);
261
262 // This sets the autopilot to hold the specified throttle position
263 void SetAutopilotThrottle(double aThrottle);
264
265 // This sets the autopilot to use waypoint mode in the lateral channel
266 void SetAutopilotLateralWaypointMode();
267
268 // This sets the autopilot to use waypoint mode in the vertical channel
269 void SetAutopilotVerticalWaypointMode();
270
271 // This sets the autopilot to use waypoint mode in the speed channel
272 void SetAutopilotSpeedWaypointMode();
273
274 // This sets the autopilot to use waypoint mode
275 void SetAutopilotWaypointMode();
276
277 // This sets the autopilot to hold all controls in a centered/neutralized position
278 void SetAutopilotNoControl();
279
280 // This allows the use of direct throttle input rather than through the autopilot
281 void EnableDirectThrottleInput();
282
283 // This restores normal throttle input control to the autopilot
284 void ReleaseDirectThrottleInput();
285
286 // This allows direct throttle input, setting the throttle to idle
287 void MoveThrottleToIdle();
288
289 // This allows direct throttle input, setting the throttle to full (military) power
290 void MoveThrottleToFull();
291
292 // This allows direct throttle input, setting the throttle to full afterburner
293 void MoveThrottleToAfterburner();
294
295 // This allows the use of direct speed brake input rather than through the autopilot
296 void EnableDirectSpeedBrakeInput();
297
298 // This restores normal speed brake input control to the autopilot
299 void ReleaseDirectSpeedBrakeInput();
300
301 // This allows direct speed brake input, setting the speed brake to fully open/extended
302 void OpenSpeedBrake();
303
304 // This allows direct speed brake input, setting the speed brake to fully close/retracted
305 void CloseSpeedBrake();
306
307 // Set the flaps position in normalized values ranging from 0 when flaps are retracted
308 // to 1 when flaps are full deployed.
309 virtual void SetFlapsPosition(double aPosition) = 0;
310
311 // Set the spoilers position in normalized values ranging from 0 when spoilers are retracted
312 // to 1 when spoilers are full deployed.
313 virtual void SetSpoilersPosition(double aPosition) = 0;
314
316
317 // This returns the calculated maximum pitching acceleration in gees
319
321
322 // This should be called to take direct control of the SixDOF object before using SetDirectStickAndRudderInput,
323 // SetDirectThrottleInput, and SetDirectControlInputs.
324 void TakeDirectControlInput();
325
326 // This should be called to release direct control of the SixDOF object, which will disable the use of
327 // SetDirectStickAndRudderInput, SetDirectThrottleInput, and SetDirectControlInputs.
328 void ReleaseDirectControlInput();
329
330 // The aStickX value assumes that 1 is full right stick, 0 is centered, and -1 is full left stick.
331 // The aStickY value assumes that 1 is full back stick, 0 is centered, and -1 is full forward stick.
332 // The aRudder value assumes that 1 is full right rudder, 0 is centered, and -1 is full left rudder.
333 // The aThrottleLeverPosition value assumes that 0 is idle, 1 is full power without augmentation/afterburner
334 // (military power), and 2 is full power with full augmentation/afterburner (full afterburner).
335 // This function requires that TakeManualControl be called prior to use.
336 void SetDirectControlInputs(double aStickX, double aStickY, double aRudder, double aThrottleLeverPosition);
337
338 // Activates direct control of the SixDOF roll command only
339 void EnableDirectStickRightInput();
340
341 // Activates direct control of the SixDOF pitch command only
342 void EnableDirectStickBackInput();
343
344 // Activates direct control of the SixDOF yaw command only
345 void EnableDirectRudderRightInput();
346
347 // Restores control of the roll command to the autopilot
348 void ReleaseDirectStickRightInput();
349
350 // Restores control of the pitch command to the autopilot
351 void ReleaseDirectStickBackInput();
352
353 // Restores control of the yaw command to the autopilot
354 void ReleaseDirectRudderRightInput();
355
356 // The aStickX value assumes that 1 is full right stick, 0 is centered, and -1 is full left stick.
357 void SetDirectStickRightInput(double aStickX);
358
359 // The aStickY value assumes that 1 is full back stick, 0 is centered, and -1 is full forward stick.
360 void SetDirectStickBackInput(double aStickY);
361
362 // The aRudder value assumes that 1 is full right rudder, 0 is centered, and -1 is full left rudder.
363 void SetDirectRudderRightInput(double aRudderValue);
364
365 // The aThrottleLeverPosition value assumes that 0 is idle, 1 is full power without augmentation/afterburner
366 // (military power), and 2 is full power with full augmentation/afterburner (full afterburner).
367 void SetDirectThrottleInput(double aThrottleLeverPosition);
368
369 // This returns true if the positive-side stall warning is occurring
370 bool StallWarningAlert() const;
371
373
374 bool GoToLocation(double aSimTime, double aLatitude, double aLongitude, double aAltitude) override;
375
376 bool TurnToHeading(double aSimTime,
377 double aHeading_rad,
378 double aRadialAccel_mps2,
379 WsfPath::TurnDirection aTurnDirection) override;
380
381 bool GoToSpeed(double aSimTime, double aSpeed_mps, double aLinearAccel_mps2, bool aKeepRoute) override;
382
383 bool GoToAltitude(double aSimTime,
384 double aAltitude_m, // meters
385 double aClimbDiveRate_mps,
386 bool aKeepRoute) override;
387
388 bool TurnToRelativeHeading(double aSimTime,
389 double aHeadingChange_rad,
390 double aRadialAccel_mps2,
391 WsfPath::TurnDirection aTurnDirection) override;
392
393 bool ReturnToRoute(double aSimTime) override;
394
395 // FollowRoute_1: FollowRoute(WsfRoute aRoute);
396 // FollowRoute_2: FollowRoute(WsfRoute aRoute, string aRouteAction);
397 // FollowRoute_3: FollowRoute(string aRouteName);
398 // FollowRoute_4: FollowRoute(string aRouteName, string aRouteAction);
399 // FollowRoute_5: FollowRoute(WsfRoute aRoute, int aIndex);
400 // FollowRoute_6: FollowRoute(string aRouteName, int aIndex);
401
402 // Implementing UpdateRoute() will enable FollowRoute_1 & FollowRoute_3
403 bool UpdateRoute(double aSimTime, const WsfRoute& aRoute) override;
404
405 // Implementing GoToClosestPoint() & GoToLabel() will enable FollowRoute_2 & FollowRoute_4
406 // virtual bool GoToClosestPoint(double aSimTime);
407 // virtual bool GoToLabel(double aSimTime,
408 // const WsfStringId& aLabelId);
409
410 // Implementing GoToWaypoint() will enable FollowRoute_5 & FollowRoute_6
411 bool GoToWaypoint(double, // aSimTime,
412 unsigned int aDestination) override;
413
414 // Update the planned route with a new route
415 bool SetDefaultRoute(const WsfRoute& aRoute);
416
417 // Update the temporary route with a new route
418 bool SetTempRoute(const WsfRoute& aRoute);
419
420 // Replace the temporary route with a new route, and move the platform to the first waypoint
421 bool SetRoute(double aSimTime, const WsfRoute& aRoute) override;
422
423 const WsfRoute* GetRoute() const override { return mWsfRoutePtr.get(); }
424
425 const WsfRoute* GetDefaultRoute() const override { return mDefaultWsfRoutePtr.get(); }
426
427 int RoutePointIndex() const override;
428
429 bool FlyRates(const UtVec3d& aAngularRates, // radians/sec
430 const UtVec3d& aLongitudinalAccel) override; // meters/sec^2
431
432 bool FlyHeadingSpeedAltitude(double aHeading, // deg
433 double aSpeed, // meters/sec
434 double aAltitude, // meters
435 double aMaxGees, // Gs
436 double aMaxClimb) override; // meters/sec
437
438 bool TurnInPlaneWithSpeed(const UtVec3d& aPlane, // world coordinates (not body coordinates)
439 double aGees, // Gs
440 double aSpeed) override; // meters/sec
441
442 bool TurnInPlaneWithThrottle(const UtVec3d& aPlane, // world coordinates (not body coordinates)
443 double aGees, // Gs
444 double aThrottle) override; //[0-3]
445
446 bool FlyVectorWithSpeed(const UtVec3d& aVelocityVector, // world coordinates (not body coordinates) (magnitude does
447 // not matter, just direction)
448 double aMaxGees, // Gs
449 double aSpeed) override; // meters/sec
450
451 bool FlyVectorWithThrottle(const UtVec3d& aVelocityVector, // world coordinates (not body coordinates) (magnitude
452 // does not matter, just direction)
453 double aMaxGees, // Gs
454 double aThrottle) override; //[0-3]
455
456 void CommandSlice(double aTargetHeading_deg, double aTargetAltitude_m, double aTargetMach = 0.0);
457
458 void CommandLevelTurn(double aTargetHeading_deg, double aTargetMach, double aTargetGees = 0.0);
459
461
462 // This allows enabling/disabling the autopilot
463 void EnableAutopilot(bool aState);
464
465 // This makes the manual pilot active (if present)
466 void ActivateSimpleManualPilot();
467
468 // This makes the manual pilot active (if present)
469 void ActivateAugmentedManualPilot();
470
471 // This makes the manual pilot active (if present)
472 void ActivateSyntheticPilot();
473
475
476 // This reverts all autopilot current limit settings to the default limits
477 void RevertLimitsToDefaults();
478
479 // This returns the minimum pitch g-load for the autopilot
480 double GetPitchGLoadMin();
481
482 // This returns the maximum pitch g-load for the autopilot
483 double GetPitchGLoadMax();
484
485 // This returns the minimum angle of attack (alpha) in degrees
486 double GetAlphaMin();
487
488 // This returns the maximum angle of attack (alpha) in degrees
489 double GetAlphaMax();
490
491 // This returns the minimum pitch rate in deg/sec
492 double GetPitchRateMin();
493
494 // This returns the maximum pitch rate in deg/sec
495 double GetPitchRateMax();
496
497 // This returns the minimum vertical speed in ft/min
498 double GetVerticalSpeedMin();
499
500 // This returns the maximum vertical speed in ft/min
501 double GetVerticalSpeedMax();
502
503 // This returns the maximum yaw g-load
504 double GetYawGLoadMax();
505
506 // This returns the maximum angle of sideslip (beta) in degrees
507 double GetBetaMax();
508
509 // This returns the maximum yaw rate in deg/sec
510 double GetYawRateMax();
511
512 // This returns the maximum roll rate in deg/sec
513 double GetRollRateMax();
514
515 // This returns the maximum bank angle in degrees
516 double GetBankAngleMax();
517
518 // This returns the minimum forward acceleration in gees
519 double GetForwardAccelMin();
520
521 // This returns the maximum forward acceleration in gees
522 double GetForwardAccelMax();
523
524 // This sets the minimum pitch g-load for the autopilot
525 void SetPitchGLoadMin(double aGees);
526
527 // This sets the maximum pitch g-load for the autopilot
528 void SetPitchGLoadMax(double aGees);
529
530 // This sets the minimum angle of attack (alpha) in degrees
531 void SetAlphaMin(double aAlpha);
532
533 // This sets the maximum angle of attack (alpha) in degrees
534 void SetAlphaMax(double aAlpha);
535
536 // This sets the minimum pitch rate in deg/sec
537 void SetPitchRateMin(double aPitchRate);
538
539 // This sets the maximum pitch rate in deg/sec
540 void SetPitchRateMax(double aPitchRate);
541
542 // This sets the minimum vertical speed in ft/min
543 void SetVerticalSpeedMin(double aVertSpeed);
544
545 // This sets the maximum vertical speed in ft/min
546 void SetVerticalSpeedMax(double aVertSpeed);
547
548 // This sets the maximum yaw g-load
549 void SetYawGLoadMax(double aYawGLoad);
550
551 // This sets the maximum angle of sideslip (beta) in degrees
552 void SetBetaMax(double aBeta);
553
554 // This sets the maximum yaw rate in deg/sec
555 void SetYawRateMax(double aYawRate);
556
557 // This sets the maximum roll rate in deg/sec
558 void SetRollRateMax(double aRollRate);
559
560 // This sets the maximum bank angle in degrees
561 void SetBankAngleMax(double aBankAngle);
562
563 // This sets the minimum forward acceleration in gees
564 void SetForwardAccelMin(double aForwardAccel);
565
566 // This sets the maximum forward acceleration in gees
567 void SetForwardAccelMax(double aForwardAccel);
568
569 // This sets the turn roll-in multiplier for the autopilot when following routes
570 void SetTurnRollInMultiplier(double aValue);
571
572 // Sets the route allowable error in radians
573 void SetRouteAllowableAngleError(double aValue_rad);
574
575 // This returns the current turn roll-in multiplier for the autopilot when following routes
576 double GetCurrentTurnRollInMultiplier();
577
578 // This returns the default turn roll-in multiplier for the autopilot when following routes
579 double GetDefaultTurnRollInMultiplier();
580
581 // Gets the current route allowable error in radians
582 double GetCurrentRouteAllowableAngleError();
583
584 // Gets the default route allowable error in radians
585 double GetDefaultRouteAllowableAngleError();
586
587 // This returns the CLmax value for the specified Mach
588 virtual double GetCLMaxAtMach(double aMach) const;
589
590 // This returns the alpha (in degrees) at CLmax for the specified Mach
591 virtual double GetAlphaAtCLMaxAtMach_deg(double aMach) const;
592
593 // This returns the alpha (in degrees) at the specified pitching load for the specified Mach
594 virtual void CalculateAlphaAtSpecifiedGLoad_deg(double aMach, double& aAlpha_deg) const = 0;
595
596 // This returns the beta (in degrees) at the specified yawing load for the specified Mach
597 virtual void CalculateBetaAtSpecifiedGLoad_deg(double aMach, double& aBeta_deg) const = 0;
598
599 // Returns the design weight for max-g maneuvering in lbs
601
603
604 // This returns the current maneuver that is being executed, or nullptr if there is none.
605 wsf::six_dof::Maneuver* GetCurrentManeuver() const;
606
607 // This returns the sequence that is currently being executed, or nullptr if there is none.
608 wsf::six_dof::ManeuverSequence* GetManeuverSequence() const;
609
610 // This executes the given maneuver. This will replace any current sequence with the single manuever provided.
611 void ExecuteManeuver(double aSimTime, std::unique_ptr<wsf::six_dof::Maneuver>&& aManeuverPtr);
612
613 // This executes the given sequence of maneuvers. This will replace any current sequence with the given sequence.
614 void ExecuteManeuverSequence(double aSimTime, std::unique_ptr<wsf::six_dof::ManeuverSequence>&& aSequencePtr);
615
616 // This will cancel the currently executing maneuver sequence.
617 void CancelManeuvers();
618
620
621 void GetInitialState(double aLocWCS[3], double aVelWCS[3], double aOrientationNED[3]) const;
622 void SetInitialLatLon(double aLat, double aLon);
623 void SetInitialAlt(double aAlt_m);
624 void SetInitialNEDHeading(double aHeading_rad);
625 void SetInitialNEDPitch(double aPitch_rad);
626 void SetInitialNEDRoll(double aRoll_rad);
627 void SetInitialNEDVelocity(double aVelNorth_mps, double aVelEast_mps, double aVelDown_mps);
628
630
631 void Update(double aSimTime) override;
632 void UpdateAppearance(double aSimTime);
633
634 void UpdatePlatformFromVehicle(Mover* aVehicle, WsfPlatform* aPlatform);
635
636 // bool Initialize(double aSimTime) override;
637
638 // This returns the type of the active pilot object as a string
639 std::string GetActivePilot() const;
640
641 // This returns the autopilot's lateral mode as an enum
642 Lateral::Mode GetAutopilotLateralModeEnum() const;
643
644 // This returns the autopilot's lateral mode as a string
645 std::string GetAutopilotLateralMode() const;
646 std::string LateralModeToString(Lateral::Mode aMode) const;
647
648 // This returns the value of the autopilot's lateral mode
649 float GetAutopilotLateralModeValue() const;
650
651 // This returns the autopilot's vertical mode as an enum
652 Vertical::Mode GetAutopilotVerticalModeEnum() const;
653
654 // This returns the autopilot's vertical mode as a string
655 std::string GetAutopilotVerticalMode() const;
656 std::string VerticalModeToString(Vertical::Mode aMode) const;
657
658 // This returns the value of the autopilot's vertical mode
659 float GetAutopilotVerticalModeValue() const;
660
661 // This returns the autopilot's speed mode as an enum
662 Speed::Mode GetAutopilotSpeedModeEnum() const;
663
664 // This returns the autopilot's speed mode as a string
665 std::string GetAutopilotSpeedMode() const;
666 std::string SpeedModeToString(Speed::Mode aMode) const;
667
668 // This returns the value of the autopilot's speed mode
669 float GetAutopilotSpeedModeValue() const;
670
671 // These functions return the normalized control surface angle, defaulting to 0.0
672 virtual double GetNormalizedAileronLeft() const { return 0.0; }
673 virtual double GetNormalizedAileronRight() const { return 0.0; }
674 virtual double GetNormalizedFlapLeft() const { return 0.0; }
675 virtual double GetNormalizedFlapRight() const { return 0.0; }
676 virtual double GetNormalizedSpoilerLeft() const { return 0.0; }
677 virtual double GetNormalizedSpoilerRight() const { return 0.0; }
678 virtual double GetNormalizedStabilizerLeft() const { return 0.0; }
679 virtual double GetNormalizedStabilizerRight() const { return 0.0; }
680 virtual double GetNormalizedElevator() const { return 0.0; }
681 virtual double GetNormalizedRudderLeft() const { return 0.0; }
682 virtual double GetNormalizedRudder() const { return 0.0; }
683 virtual double GetNormalizedRudderRight() const { return 0.0; }
684 virtual double GetNormalizedSpeedBrake() const { return 0.0; }
685 virtual double GetNormalizedLandingGear() const { return 0.0; }
686 virtual double GetNormalizedLandingGearNose() const { return 0.0; }
687 virtual double GetNormalizedLandingGearMainLeft() const { return 0.0; }
688 virtual double GetNormalizedLandingGearMainRight() const { return 0.0; }
689
690 // These functions return true if the data for that control surface is valid, defaulting false
691 virtual bool AileronLeftValid() const { return false; }
692 virtual bool AileronRightValid() const { return false; }
693 virtual bool FlapLeftValid() const { return false; }
694 virtual bool FlapRightValid() const { return false; }
695 virtual bool SpoilerLeftValid() const { return false; }
696 virtual bool SpoilerRightValid() const { return false; }
697 virtual bool StabilizerLeftValid() const { return false; }
698 virtual bool StabilizerRightValid() const { return false; }
699 virtual bool ElevatorValid() const { return false; }
700 virtual bool RudderLeftValid() const { return false; }
701 virtual bool RudderValid() const { return false; }
702 virtual bool RudderRightValid() const { return false; }
703 virtual bool SpeedBrakeValid() const { return false; }
704 virtual bool LandingGearValid() const { return false; }
705 virtual bool LandingGearNoseValid() const { return false; }
706 virtual bool LandingGearMainLeftValid() const { return false; }
707 virtual bool LandingGearMainRightValid() const { return false; }
708 virtual bool ThrottleValid() const = 0;
709
710 // Returns the current stick back control input position
711 double GetStickBackPosition() const;
712
713 // Returns the current stick right control input position
714 double GetStickRightPosition() const;
715
716 // This returns the current rudder right control input position
717 double GetRudderRightPosition() const;
718
719 // This returns the current military (non-afterburner) throttle control input position
720 double GetThrottleMilitaryPosition() const;
721
722 // This returns the current afterburner throttle control input position
723 double GetThrottleAfterburnerPosition() const;
724
725 // This returns the current thrust reverser control input position
727
728 // This returns the current speed brake control input position
729 double GetSpeedBrakeControlPosition() const;
730
731 // Returns the position (deg) of the speed brakes (common position)
732 virtual double GetSpeedBrakePosition() const = 0;
733
734 // Returns the position of the lending gear lever
735 double GetLandingGearLeverPosition() const;
736
737 // Returns the position of the flaps lever
738 double GetFlapsLeverPosition() const;
739
740 // Returns the position of the flaps
741 virtual double GetFlapsPosition() const = 0;
742
743 // Returns the position of the spoilers lever
744 double GetSpoilersLeverPosition() const;
745
746 // Returns the position (deg) of the spoilers (common position)
747 virtual double GetSpoilersPosition() const = 0;
748
749 // Add fuel (in kg) to vehicle
750 void AddFuel(double aFuelMass_kg);
751
752 // Returns total fuel capacity (internal and external) in kg
753 double GetTotalFuelCapacity() const;
754
755 // Returns total internal fuel capacity in kg
756 double GetInternalFuelCapacity() const;
757
758 // Returns total external fuel capacity in kg
759 double GetExternalFuelCapacity() const;
760
761 // Returns total fuel remaining (internal and external) in kg
762 double GetTotalFuelRemaining() const;
763
764 // Returns internal fuel remaining in kg
765 double GetInternalFuelRemaining() const;
766
767 // Returns external fuel remaining in kg
768 double GetExternalFuelRemaining() const;
769
770 // Returns fuel tank capacity in kg
771 double GetFuelTankCapacity(const std::string& aTankName) const;
772
773 // This returns the current amount of fuel in the specified tank in kg
774 double GetFuelInTank(const std::string& aTankName) const;
775
776 // This will set the fuel in a specified tank to the specified level (kg), as long as the tank capacity can contain
777 // it -- otherwise, the tank will be filled and the excess fuel will be "wasted".
778 void SetFuelInTank(const std::string& aTankName, double aFuel_kg);
779
780 // This returns the total fuel flow (kg/sec) for all engines on the vehicle
781 double GetTotalFuelFlow() const;
782
783 // This is used to verify that a subobject's fuel load can be included as external fuel
784 bool IsExternalFuelTank();
785
786 // This will instantly empty all internal and external fuel tanks
788
789 // This will instantly empty all internal fuel tanks
791
792 // This will instantly empty all external fuel tanks
794
795 // This starts up the engines. It is a simple, instant-on startup.
796 void StartupEngines(double aSimTime_sec);
797
798 // This shuts down up the engines. It is a simple, instant shutdown.
799 void ShutdownEngines(double aSimTime_sec);
800
801 // This sets the Joker fuel state (kg)
802 void SetJokerFuelState(double aJokerFuel_kg) { mJokerFuel_lbs = aJokerFuel_kg * UtMath::cLB_PER_KG; }
803
804 // This sets the Bingo fuel state (kg)
805 void SetBingoFuelState(double aBingoFuel_kg) { mBingoFuel_lbs = aBingoFuel_kg * UtMath::cLB_PER_KG; }
806
807 // This returns the Joker fuel state (kg)
808 double GetJokerFuelState() { return mJokerFuel_lbs * UtMath::cKG_PER_LB; }
809
810 // This returns the Bingo fuel state (kg)
811 double GetBingoFuelState() { return mBingoFuel_lbs * UtMath::cKG_PER_LB; }
812
813 // This returns true if Joker fuel state has been reached
814 bool JokerFuelReached();
815
816 // This returns true if Bingo fuel state has been reached
817 bool BingoFuelReached();
818
820 void CheckForFrequencyUnits(double& value, UtInput& aInput)
821 {
822 std::string units;
823 aInput.ReadValue(value);
824 aInput.ReadValue(units);
825 UtStringUtil::ToLower(units);
826 UtInput::ValueType valueType = UtInput::GetValueTypeOf(units);
827 // If the user input a frequency instead of seconds, convert it for them
828 if (valueType == UtInput::ValueType::cFREQUENCY)
829 {
830 // If our value us not 0, convert it to seconds.
831 if (value != 0.0)
832 {
833 value = (1.0 / value);
834 }
835 }
836 }
837
838 // ====================================================================================================
839
840 // These functions support guidance (GuidanceComputer)
841
843 void SetGuidance(WsfMoverGuidance* aGuidancePtr) { mGuidancePtr = aGuidancePtr; }
844
847
848 // WsfGuidedMover and WsfGuidanceComputer use SetYandZForces(double aYForce,double aZForce), but SixDOF Mover
849 // uses SetYandZGLoads(double aYGLoad, double aZGLoad) instead. This is because the SixDOF autopilot accepts g-load
850 // commands for pitch and yaw. This function is used by WsfSixDOF_GuidanceComputer to command a SixDOF vehicle.
851 void SetYandZGLoads(double aYGLoad, double aZGLoad);
852
853 // This sets a yaw rate (rad/sec) command for the SixDOF autopilot for use in guidance
854 void SetCommandedYawRate(double aRate) { mCommandedYawRate = aRate; }
855
856 // This sets a pitch rate (rad/sec) command for the SixDOF autopilot for use in guidance
857 void SetCommandedPitchRate(double aRate) { mCommandedPitchRate = aRate; }
858
859 // This sets a roll rate (rad/sec) command for the SixDOF autopilot for use in guidance
860 void SetCommandedRollRate(double aRate) { mCommandedRollRate = aRate; }
861
862 // This sets a speed (m/sec) command for the SixDOF autopilot for use in guidance
863 void SetCommandedSpeed(double aCommandedSpeed) { mCommandedSpeed = aCommandedSpeed; }
864
865 // void SetCommandedEngineStopTime(double aStopTime) { mCommandedEngineStopTime = aStopTime; }
866
867 void WriteKinematicStatus(ut::log::MessageStream& aStream);
868
869 // This sets the minimum height above terrain (in meters) for terrain following
870 void SetMinimumHeightAboveTerrain(double aMinimum) { mMinimumHeightAboveTerrain = aMinimum; }
871
872 // This returns the current stage index
873 int CurrentStage() const { return (int)mStageIndex; }
874
876
877 // This sets the damage factor for the mover
878 void SetDamageFactor(double aDamageFactor);
879
880 // OnPlatformBrokenEvent is called for all platform parts when a platform is "broken", which is typically the result
881 // of combat damage or destruction. By default, most platform parts are "turned off" with this function, but
882 // Mover overrides the function to prevent being turned off, since the mover may continue to move.
883 void OnPlatformBrokenEvent(double aSimTime) override { SetDestroyed(); }
884
885 void ResetPosition(double aSimTime) override;
886
888
889 // This returns true if one or more engines are operating
890 bool GetEngineIsOperating() const { return AnEngineIsOperating(); }
891
892 // This returns true if one or more engines are producing visible smoke
893 bool GetEngineIsSmoking() const { return AnEngineIsSmoking(); }
894
895 // This returns true if one or more engines have an operating afterburner
897
898 // This allows control to have the engines produce visible smoke
899 void MakeEnginesSmoke(bool aEngineSmoking) { MakeEnginesSmoke(); }
900
901 // This returns true if one or more engines are producing contrails
903
904 // This returns true if the mover is producing visible rocket smoke
906
907 // This returns true if the mover is producing visible damage smoke
909
910 // This allows control to have the mover produce visible damage smoke
911 void SetDamageSmokeTrailingEffect(bool aEffectActive) { ActivateDamageSmokeTrailingEffect(aEffectActive); }
912
913 // This returns true if the mover is producing a visible rising smoke plume
915
916 // This allows control to have the mover produce a visible rising smoke plume
917 void SetRisingSmokePlumeIsPresent(bool aSmoking) { mRisingSmokePlume = aSmoking; }
918
919 // This returns true if the mover is producing visible launch smoke
921
922 // This allows control to have the mover produce a visible launch smoke
923 void SetLaunchFlashSmokeIsPresent(bool aLaunchFlashSmoke) { mLaunchFlashSmoke = aLaunchFlashSmoke; }
924
925 // This returns true if the mover is producing visible flames
926 bool GetFlamesArePresent() const { return FlamesArePresent(); }
927
928 // This allows control to have the mover produce a visible flames
929 void SetFlamesArePresent(bool aFlaming) { ActivateFlamesEffect(aFlaming); }
930
931 // This returns true if the mover is lightly damaged
932 bool GetIsLightlyDamaged() const { return mLightDamage; }
933
934 // This allows control to have the mover be lightly damaged
936
937 // This returns true if the mover is heavily damaged
938 bool GetIsHeavilyDamaged() const { return mHeavyDamage; }
939
940 // This allows control to have the mover be heavily damaged
942
944
945 // This will jettison the specified subobject, returning a pointer to the platform if successful, or null if it
946 // fails. Note that this function does not add the platform to the simulation -- this must be performed outside of
947 // this function.
948 WsfPlatform* DirectJettisonSubobjectPlatform(Mover* aJettisonedObject, double aSimTime_sec);
949
951
952 // ParentVehicle is the Vehicle this object is attached to (This may be different from Parent)
954 void SetParentVehicle(Mover* aParentVehicle) { mParentVehicle = aParentVehicle; }
955
956 // ====================================================================================================================
957
958 // Initialization functions
959
960 void DeriveFrom(const Mover& aSrc);
961
962 bool Initialize(double aSimTime_sec, const std::string& aPrefixName);
963
964 bool InitializeConditions(double aSimTime_sec);
965
966 bool InitializeSequencers(double aSimTime_sec);
967 bool InitializeSubobjects(double aSimTime_sec);
968
969 // This "washes-in" (smooths) initial conditions, helping to eliminate "jumps"
970 // as the vehicle reaches a stable state.
971 void SetWashInInitConditions(bool aUseWashInInitConditions) { mUseWashInInitConditions = aUseWashInInitConditions; }
972
973 // ====================================================================================================================
974
975 // Update functions
976
977 void Update(int64_t aSimTime_nanosec);
978 virtual void UpdateObject(int64_t aSimTime_nanosec);
979
980 virtual void UpdateFlightControls(int64_t aSimTime_nanosec) = 0;
981
982 // ====================================================================================================================
983 // Misc object functions
984
985 virtual const Integrator* GetIntegrator() const = 0;
986 virtual PilotManager* GetPilotManager() const = 0;
988
989 virtual AeroCoreObject* GetAeroCoreObject() const = 0;
990
991 // This returns the pilot controller object. Null is returned when
992 // no pilot controller is present.
994
995 virtual bool HasLandingGear() { return false; }
996
997 // ====================================================================================================================
998 // Misc object functions
999
1000 // This returns true if the object has crashed
1001 bool Crashed() const { return mCrashed; }
1002
1003 // This enables/disables the size factor. Size factor effects aerodynamics as
1004 // a size multiplier for reference area.
1005 void SetSizeFactorEnabled(bool aSetting) { mSizeFactor.SetSizeFactorEnabled(aSetting); }
1006
1007 // This is used to move to the preposition location (starting location) at the specified altitude in meters.
1008 // This is often used in testing.
1009 void SetPrepositionAlt_m(double aAltitude_m);
1010
1011 // ====================================================================================================================
1012
1013 // Kinematics state functions
1014 // This returns the kinematics state.
1016
1017 // ====================================================================================================================
1018
1019 // Kinematics state functions
1020 // This returns the kinematics state.
1022
1023 // ====================================================================================================================
1024
1025 // Type manager functions
1026 // This returns the scenario-common environment.
1027 const Environment* GetEnvironment() const { return mEnvironment; }
1028
1029 // ====================================================================================================================
1030
1032
1033 // This provides the latitude/longitude where the object was created
1034 void GetStartingLatLon(double& aStartingLat, double& aStartingLon) const
1035 {
1036 mKinematicState.GetStartingLatLon(aStartingLat, aStartingLon);
1037 }
1038
1039 // This returns the x-component of acceleration (in gees) in body coordinates
1040 double GetNx_g() const { return mKinematicState.GetNx_g(); }
1041
1042 // This returns the y-component of acceleration (in gees) in body coordinates
1043 double GetNy_g() const { return mKinematicState.GetNy_g(); }
1044
1045 // This returns the z-component of acceleration (in gees) in body coordinates
1046 double GetNz_g() const { return mKinematicState.GetNz_g(); }
1047
1048 // This returns the lift in lbs
1049 double GetLift_lbs() const { return mKinematicState.GetLift(); }
1050
1051 // This returns the drag in lbs
1052 double GetDrag_lbs() const { return mKinematicState.GetDrag(); }
1053
1054 // This returns the side force in lbs
1055 double GetSideForce_lbs() const { return mKinematicState.GetSideForce(); }
1056
1057 // This returns the thrust magnitude in lbs
1058 double GetThrustMagnitude_lbs() const { return mKinematicState.GetThrust(); }
1059
1060 // This returns a vector of the acceleration (in meters/sec^2) in NED coordinates
1061 UtVec3dX GetAccelNED_mps2() const;
1062
1063 double GetVertSpeed_fpm() const { return mKinematicState.GetVerticalSpeed_fpm(); }
1064
1065 // This returns the current gamma (flight path angle) in radians
1066 double GetFlightPathAngle_rad() const { return mKinematicState.GetFlightPathAngle_rad(); }
1067 // This returns the current gamma (flight path angle) in degrees
1068 double GetFlightPathAngle_deg() const { return mKinematicState.GetFlightPathAngle_deg(); }
1069
1070 // This provides the current WCS yaw, pitch, and roll in radians
1071 void GetOrientationWCS_rad(double& aWcsYaw_rad, double& aWcsPitch_rad, double& aWcsRoll_rad) const;
1072
1073 // This provides the current NED heading, pitch, and roll in radians
1074 void GetAttitudeNED_rad(double& aHeading, double& aPitch, double& aRoll);
1075
1076 // This returns the current heading in radians
1077 double GetHeading_rad() const { return mKinematicState.GetLocalHeading_rad(); }
1078 // This returns the current heading in degrees
1079 double GetHeading_deg() const { return mKinematicState.GetLocalHeading_deg(); }
1080
1081 // This returns the current pitch in degrees
1082 double GetPitch_rad() const { return mKinematicState.GetLocalPitch_rad(); }
1083 // This returns the current pitch in degrees
1084 double GetPitch_deg() const { return mKinematicState.GetLocalPitch_deg(); }
1085
1086 // This returns the current roll in degrees
1087 double GetRoll_rad() const { return mKinematicState.GetLocalRoll_rad(); }
1088 // This returns the current roll in degrees
1089 double GetRoll_deg() const { return mKinematicState.GetLocalRoll_deg(); }
1090
1091 // This returns the current altitude (in meters)
1092 double GetAltitudeMSL_m() const { return mKinematicState.GetAlt_m(); }
1093 // This returns the current altitude (in feet above sea level)
1094 double GetAltitudeMSL_ft() const { return mKinematicState.GetAlt_ft(); }
1095
1096 // This returns the maximum observed altitude (in Km above sea level)
1097 double GetApogee_km() const { return mKinematicState.GetApogee_km(); }
1098
1099 // This returns the current great-circle range (in kilometers) from the starting location to the current location
1100 double GetRangeSinceStart_km() const { return mKinematicState.GetRangeSinceStart_km(); }
1101
1102 // This provides the current lat/lon (in degrees) and altitude (in meters)
1103 void GetLocationLLA(double& aLat, double& aLon, double& aAlt_m);
1104
1105 // This provides x,y,z values for the current location in WCS
1106 void GetLocationWCS_m(double& aWcsPosX_m, double& aWcsPosY_m, double& aWcsPosZ_m) const;
1107
1108 // This returns a vector for the current location in WCS
1109 UtVec3dX GetLocationWCS_m() const;
1110
1111 // This returns the current latitude in degrees
1112 double GetLatitude_deg() const { return mKinematicState.GetLat(); }
1113 // This returns the current longitude in degrees
1114 double GetLongitude_deg() const { return mKinematicState.GetLon(); }
1115
1116 // This provides the vx, vy, vz WCS velocity components in meters/sec
1117 void GetVelocityWCS_mps(double& aWcsVelX_mps, double& aWcsVelY_mps, double& aWcsVelZ_mps) const;
1118
1119 // This returns a vector of the WCS velocity in meters/sec
1120 UtVec3dX GetVelocityWCS_mps() const;
1121
1122 // This returns a vector of the NED velocity in meters/sec
1123 UtVec3dX GetVelocityNED_mps() const;
1124
1125 // This returns the indicated airspeed in knots based on the current altitude
1126 double GetKIAS() const { return mKinematicState.GetSpeed_kias(); }
1127 // This returns the indicated airspeed in knots based on the current altitude
1128 double GetKCAS() const { return GetKIAS(); }
1129 // This returns the true airspeed in knots
1130 double GetKTAS() const { return mKinematicState.GetSpeed_ktas(); }
1131 // This returns the Mach, based on the current speed and altitude
1132 double GetMach() const { return mKinematicState.GetSpeed_Mach(); }
1133 // This returns the true speed (inertial, not airspeed) in ft/sec
1134 double GetSpeed_fps() const { return mKinematicState.GetSpeed_fps(); }
1135 // This returns the true speed (inertial, not airspeed) in m/sec
1136 double GetSpeed_mps() const { return mKinematicState.GetSpeed_mps(); }
1137
1138 // This provides the current body rates about each axis in radians/sec
1139 void GetBodyRates_rps(double& xAxis_rps, double& yAxis_rps, double& zAxis_rps) const
1140 {
1141 mKinematicState.GetOmegaBody().Get(xAxis_rps, yAxis_rps, zAxis_rps);
1142 }
1143
1144 // This returns the current yaw rate in radians/sec
1145 double GetYawRate_rps() const { return mKinematicState.GetYawRate_rps(); }
1146 // This returns the current yaw rate in degrees/sec
1147 double GetYawRate_dps() const { return mKinematicState.GetYawRate_dps(); }
1148
1149 // This returns the current pitch rate in radians/sec
1150 double GetPitchRate_rps() const { return mKinematicState.GetPitchRate_rps(); }
1151 // This returns the current pitch rate in degrees/sec
1152 double GetPitchRate_dps() const { return mKinematicState.GetPitchRate_dps(); }
1153
1154 // This returns the current roll rate in radians/sec
1155 double GetRollRate_rps() const { return mKinematicState.GetRollRate_rps(); }
1156 // This returns the current roll rate in degrees/sec
1157 double GetRollRate_dps() const { return mKinematicState.GetRollRate_dps(); }
1158
1159 // This returns the current alpha (angle of attack) in radians
1160 double GetAlpha_rad() const { return mKinematicState.GetAlpha_rad(); }
1161 // This returns the current alpha (angle of attack) in degrees
1162 double GetAlpha_deg() const { return mKinematicState.GetAlpha_deg(); }
1163
1164 // This returns the current angle of attack rate (alpha-dot) in radians/sec
1165 double GetAlphaDot_rps() const { return mKinematicState.GetAlphaDot_rps(); }
1166 // This returns the current angle of attack rate (alpha-dot) in degrees/sec
1167 double GetAlphaDot_dps() const { return mKinematicState.GetAlphaDot_dps(); }
1168
1169 // This returns the current beta (angle of sideslip) in radians
1170 double GetBeta_rad() const { return mKinematicState.GetBeta_rad(); }
1171 // This returns the current beta (angle of sideslip) in degrees
1172 double GetBeta_deg() const { return mKinematicState.GetBeta_deg(); }
1173
1174 // This returns the current angle of sideslip rate (beta-dot) in radians/sec
1175 double GetBetaDot_rps() const { return mKinematicState.GetBetaDot_rps(); }
1176 // This returns the current angle of sideslip rate (beta-dot) in degrees/sec
1177 double GetBetaDot_dps() const { return mKinematicState.GetBetaDot_dps(); }
1178
1179 // This provides the current body angular acceleration about each axis in radians/sec^2
1180 void GetBodyAngularAccel_rps2(double& xAxis_rps2, double& yAxis_rps2, double& zAxis_rps2) const
1181 {
1182 mKinematicState.GetOmegaBodyDot().Get(xAxis_rps2, yAxis_rps2, zAxis_rps2);
1183 };
1184
1185 // This returns dynamic pressure in lbs/sq-ft
1186 double GetDynamicPressure_psf() const { return mKinematicState.GetDynamicPressure_psf(); }
1187
1188 // This returns pressure pressure in lbs/sq-ft
1189 double GetStaticPressure_psf() const { return mKinematicState.GetStaticPressure_psf(); }
1190
1191 // This returns the last Nx_g. It is used in sequencers to detect if g-loads are increasing or decreasing.
1192 double GetLastNx_g() const { return mKinematicState.GetLastNx_g(); }
1193
1194 // This returns the last Ny_g. It is used in sequencers to detect if g-loads are increasing or decreasing.
1195 double GetLastNy_g() const { return mKinematicState.GetLastNy_g(); }
1196
1197 // This returns the last Nz_g. It is used in sequencers to detect if g-loads are increasing or decreasing.
1198 double GetLastNz_g() const { return mKinematicState.GetLastNz_g(); }
1199
1200 // This returns the last dynamic pressure (Q). It is used in sequencers to detect if Q is increasing or decreasing.
1201 double GetLastDynamicPressure_psf() const { return mKinematicState.GetLastDynamicPressure_psf(); }
1202
1203 // This returns the last static pressure (P). It is used in sequencers to detect if P is increasing or decreasing.
1204 double GetLastStaticPressure_psf() const { return mKinematicState.GetLastStaticPressure_psf(); }
1205
1206 // This returns the last altitude in feet. It is used in sequencers to detect if the altitude is increasing or decreasing.
1207 double GetLastAltitudeMSL_ft() const { return mKinematicState.GetLastAltitudeMSL_ft(); }
1208
1209 // This returns the last captive state (true means the object is captive to
1210 // its parent). It is used in sequencers to detect if the captive state
1211 // has changed.
1212 bool GetLastIsCaptive() const { return mLastIsCaptive; }
1213
1215
1216 // This sets the location to the lat, lon, altitude specified
1217 void SetLocationLLA(double aLat, double aLon, double aAlt_m);
1218
1219 // This This sets the location to the x, y, z specified in WCS
1220 void SetLocationWCS_m(double aWcsPosX_m, double aWcsPosY_m, double aWcsPosZ_m);
1221
1222 // This sets the velocity using the vx, vy, vz WCS velocity components in meters/sec
1223 void SetVelocityWCS_mps(double aWcsVelX_mps, double aWcsVelY_mps, double aWcsVelZ_mps);
1224
1225 // This sets the velocity using the NED velocity components in meters/sec
1226 void SetVelocityNED_mps(double aVelNorth_mps, double aVelEast_mps, double aVelDown_mps);
1227
1228 // This sets the WCS yaw, pitch, and roll in radians
1229 void SetOrientationWCS_rad(double aWcsYaw_rad, double aWcsPitch_rad, double aWcsRoll_rad);
1230
1231 // This set the NED heading, pitch, and roll in radians
1232 void SetAttitudeNED_rad(double aHeading_rad, double aPitch_rad, double aRoll_rad);
1233
1234 // Zeros body rates, used for autopilot tuning
1235 void ZeroBodyRates();
1236
1237 // This returns the current center of gravity in feet from the reference point
1238 virtual UtVec3dX GetCenterOfGravity_ft() const = 0;
1239
1240 // This returns the mass properties.
1242
1243 double GetEmptyWeight_lbs() const { return mMassProperties.GetBaseMass_lbs(); }
1244 double GetCurrentWeight_lbs() const { return mMassProperties.GetMass_lbs(); }
1245
1247
1248 virtual double MaxPotentialManeuverGLoad() const = 0;
1249
1250 // ====================================================================================================================
1251
1252 virtual bool GetBooleanInput(size_t) const = 0;
1253 virtual bool GetLastBooleanInput(size_t) const = 0;
1254 virtual size_t GetInputHandle(const std::string&) const = 0;
1255
1256 // This sets the mLastSimTime_nanosec to the specified sim time in seconds. If the aIncludeSubobjects flag is true,
1257 // all subobjects will also have their last time values set.
1258 virtual void SetLastSimTime(double aSimTime_sec, bool aIncludeSubobjects = false) = 0;
1259
1260 // ====================================================================================================================
1261
1262 // Aerodynamics functions
1263
1264 // Calulate the stall angle
1265 virtual void CalcStallAngle();
1266
1267 // This function is used to calculate the lift, drag, side force, and moments
1268 // using the current state. The reference point is typically (0,0,0), but
1269 // may be a non-origin reference due to subobjects. This function will include
1270 // aero contributions by subobjects, if appropriate.
1271 virtual void CalculateAeroBodyForceAndMoments(UtVec3dX& aLiftBodyVector_lbs,
1272 UtVec3dX& aDragBodyVector_lbs,
1273 UtVec3dX& aSideForceBodyVector_lbs,
1274 UtVec3dX& aMoment_ftlbs,
1275 UtVec3dX& aReferencePt_ft) = 0;
1276
1277 virtual void CalculateAeroBodyForceAndRotation(UtVec3dX& aLiftBodyVector_lbs,
1278 UtVec3dX& aDragBodyVector_lbs,
1279 UtVec3dX& aSideForceBodyVector_lbs,
1280 UtVec3dX& aRotationAccelerationLimits_rps2,
1281 UtVec3dX& aStabilizingFrequency_rps) = 0;
1282
1283 virtual void CalculateObjectPropulsion(double aSimTime_sec,
1284 double aDeltaT_sec,
1285 double aAlt_ft,
1286 double aDynPress_lbsqft,
1287 double aStatPress_lbssqft,
1288 double aSpeed_fps,
1289 double aMach,
1290 double aAlpha_rad,
1291 double aBeta_rad,
1292 ForceAndMomentsObject& aForceAndMoment,
1293 double& aFuelBurnRate_pps,
1294 double& aFuelBurned_lbs) = 0;
1295
1296 virtual void CalculateObjectPropulsion(double aSimTime_sec,
1297 double aDeltaT_sec,
1298 double aAlt_ft,
1299 double aDynPress_lbsqft,
1300 double aStatPress_lbssqft,
1301 double aSpeed_fps,
1302 double aMach,
1303 double aAlpha_rad,
1304 double aBeta_rad,
1305 ForceAndRotationObject& aForceAndRotation,
1306 double& aFuelBurnRate_pps,
1307 double& aFuelBurned_lbs) = 0;
1308
1309 // This updates the fuel/propellant consumption for propulsion system, but
1310 // does not update burn for any subobjects, which is handled by those objects
1311 void UpdateFuelBurn(int64_t aSimTime_nanosec, double aDeltaT_sec, const KinematicState& aState);
1312
1313
1314 // Parent-object functions
1315
1316 bool IsCaptive() const { return mIsCaptive; }
1317 void SetCaptiveState(bool aIsCaptive) { mIsCaptive = aIsCaptive; }
1318 void SetLastCaptiveState(bool aLastIsCaptive) { mLastIsCaptive = aLastIsCaptive; }
1319 void SetAngRelToParentYPR_rad(const UtVec3dX& aAngRelToParentYPR_rad)
1320 {
1321 mAngRelToParentYPR_rad = aAngRelToParentYPR_rad;
1322 }
1323 void GetPositionRelativeToParent(UtVec3dX& aPosRelToParent_m, UtVec3dX& aAngRelToParentYPR_rad);
1324
1325 void SetYawRelToParent_rad(double aYawAngle_rad);
1326 void SetPitchRelToParent_rad(double aYawAngle_rad);
1327 void SetRollRelToParent_rad(double aYawAngle_rad);
1328
1329 void AdjustForParentInducedEffects();
1330 void ImpartSeparationEffects();
1331
1332 // Subobject functions
1333
1334 size_t GetNumSubobjects() const { return mSubObjectList.size(); }
1335 bool JettisonSubobject(const std::string& aSubobjectName, int64_t aSimTime_nanosec);
1336 bool JettisonSubobject(Mover* aSubobject, int64_t aSimTime_nanosec);
1337
1338 // This will remove/jettison the specified subobject, transferring ownership to the caller if successful. Note that
1339 // this does not create a platform or any other action. It merely removes the subobject from the parent and removes
1340 // the captive flag.
1341 std::unique_ptr<Mover> DirectJettisonOfSubobject(Mover* aSubobject, double aSimTime_sec);
1342
1343 // This adds the designated object as a subobject
1344 void AddSubObject(std::unique_ptr<Mover> aSubObject);
1345
1346 // This returns a reference to the list of subobjects
1347 const std::list<std::unique_ptr<Mover>>& GetSubobjectList() const;
1348
1349 Mover* GetSubobjectByName(const std::string& aSubobjectName) const;
1350 Mover* GetSubobjectByBaseName(const std::string& aSubobjectName) const;
1351
1352 // GetThrustProducerObjectByName returns the engine with the specified name
1353 virtual ThrustProducerObject* GetThrustProducerObjectByName(const std::string& aName) const;
1354
1355 virtual ThrustProducerObject* GetThrustProducerObjectByName(const std::string& aName,
1356 const Mover* aCallingObject,
1357 int aCallingLevel = 0) const;
1358
1359 // This returns true if afterburners are present
1360 bool HasAfterburner() const;
1361
1362 // GetFuelTankByName returns the fuel source with the specified name
1363 FuelTank* GetFuelTankByName(const std::string& aName) const;
1364
1365 FuelTank* GetFuelTankByName(const std::string& aName, const Mover* aCallingObject, int aCallingLevel = 0) const;
1366
1367 // This specifies the fuel feed (input tank name) for the specified engine. It returns true if the assignment is
1368 // successful.
1369 bool SetFuelFeed(std::string aEngineName, std::string aFuelTankName);
1370
1371 // This specifies the fuel feed (input tank name) for all engines.
1372 // It returns true if the assignment is successful.
1373 bool SetFuelFeed(std::string aFuelTankName);
1374
1375 // This returns the maximum total capacity of fuel in tanks for the object and all of its subobjects. Note that
1376 // this is capacity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets.
1377 double GetTotalFuelTankCapacity_lbs() const;
1378
1379 // This returns the current total amount of fuel in tanks for the object and all of its subobjects. Note that this
1380 // is quantity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets. This returns
1381 // the total amount of fuel in tanks for the object and all of its subobjects.
1382 double GetCurrentTotalFuelTankQuantity_lbs() const;
1383
1384 // This returns the maximum total capacity of fuel in tanks for the object, but not including any of its subobjects.
1385 // Note that this is capacity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets.
1386 double GetInternalFuelTankCapacity_lbs() const;
1387
1388 // This returns the current total amount of fuel in tanks for the object, but not including any of its subobjects.
1389 // Note that this is quantity of fuel in fuel tanks, and does not include integral fuel in solid propellant rockets.
1390 double GetCurrentInternalFuelTankQuantity_lbs() const;
1391
1392 // This returns the maximum total capacity of fuel in external tanks for the object. It does this by summing the fuel
1393 // in the first level subobjects. Note that this is capacity of fuel in fuel tanks, and does not include integral
1394 // fuel in solid-propellant rockets.
1395 double GetExternalFuelTankCapacity_lbs() const;
1396
1397 // This returns the maximum total capacity of fuel in external tanks for the object. It does this by summing the fuel
1398 // in the first level subobjects. Note that this is capacity of fuel in fuel tanks, and does not include integral
1399 // fuel in solid-propellant rockets.
1400 double GetCurrentExternalFuelTankQuantity_lbs() const;
1401
1402 // Returns the current fuel remaining (in percent)
1403 double GetRemainingFuelPercent() const;
1404
1405 // This adds fuel to the object in a simplistic manner. It does not use the "fill rate" limit of tanks -- hence all
1406 // of the fuel is put into the tank(s) at once. Later, we can add a "proper" fuel fill that is more realistic and
1407 // deals with a fill rate that will require a finite amount of time to transfer. This function will fill internal
1408 // tanks first and then any external/drop tanks and subobjects will be filled next. However, for simplicity, it
1409 // will make all non-internal tanks filled to the same percent full level, even if they already contained more
1410 // fuel -- in other words, it will redistribute non-internal fuel to keep the percent full consistent.
1411 void AddFuelQuantity_lbs(double aFuelToAdd_lbs);
1412
1413 // This will set the fuel in a specified tank to the specified level, as long as the tank capacity can contain
1414 // it -- otherwise, the tank will be filled and the excess fuel will be "wasted". This function performs the
1415 // transfer instantly, regardless of the transfer rates supported by the tank and fuel system. It also ignores any
1416 // fuel that already may be in the tank.
1417 void SetFuelInTank_lbs(const std::string& aTankName, double aFuel_lbs);
1418
1419 // Returns the number of external fuel tanks (subobjects that can contain fuel) being carried.
1420 // Note -- This only checks the first level of subobjects.
1421 int GetNumberOfExternalTanks() const;
1422
1423 // This returns the total fuel flow (lbs/hr) for all engines on the vehicle
1424 virtual double GetTotalVehicleFuelFlow_pph() const = 0;
1425
1426 // This returns the total fuel flow (lbs/hr) for the main engines on the vehicle. It does not include any subobjects.
1427 virtual double GetTotalFuelFlow_pph() const = 0;
1428
1429 // Ignite all of the engines in the propulsion object
1430 void IgniteObject(int64_t aIgniteTimeInFrame_nanosec);
1431
1432 // This terminates thrust from the propulsion object but not any subobjects aTerminateTime_sec is the time
1433 // termination occurs
1434 void ShutdownObject(int64_t aTerminateTime_nanosec = 0);
1435
1436 // This terminates thrust from the propulsion object and all subobjects aTerminateTime_sec is the time
1437 // termination occurs
1438 void TerminateThrust(int64_t aTerminateTime_nanosec = 0);
1439
1440 // This enables/disables controls. When controls are disabled, all control inputs are set to zero.
1441 void EnableControls(bool aEnabled);
1442
1443 // This returns the controls enabled/disabled state.
1444 bool ControlsEnabled() const;
1445
1446 // This returns true if an autopilot is present
1447 bool AutopilotAvailable() const;
1448
1449 virtual double GetCurrentThrust_lbs() = 0;
1450 virtual double GetCurrentForwardThrust_lbs() = 0;
1451 virtual double GetMaximumPotentialThrust_lbs() const = 0;
1452 virtual double GetMinimumPotentialThrust_lbs() const = 0;
1453
1454 // This provides the current normalized military-power thrust produced by engines on the vehicle. It includes
1455 // thrust from any first-level/immediate subobjects and may range from 0.0 to 1.0. Note -- This uses the first
1456 // engine on the vehicle (which may differ from other engines).
1457 double GetNormalizedMilitaryThrust() const;
1458
1459 // This provides the current normalized afterburner thrust produced by engines on the vehicle. It includes
1460 // thrust from any first-level/immediate subobjects and may range from 0.0 to 1.0. Note -- This uses the first
1461 // engine on the vehicle (which may differ from other engines).
1462 double GetNormalizedAfterburnerThrust() const;
1463
1464 // This provides the current normalized total thrust produced by engines on the vehicle. It includes thrust
1465 // from any first-level/immediate subobjects and may range from 0.0 to 2.0, where 0.0 is idle thrust, 1.0 is
1466 // full military power, and 2.0 is full afterburner. Note -- This uses the first engine on the vehicle (which
1467 // may differ from other engines).
1468 double GetNormalizedTotalThrust() const;
1469
1470 virtual void SetActiveAeroObject(const std::string& aName) = 0;
1471
1472 // ====================================================================================================================
1473
1474 // Sequencer functions
1475
1476 Sequencer* GetSequencerByName(const std::string& aName) const;
1477
1478 // This determines when the next time-based events (either sequencer event or a guidance and control event) will
1479 // occur, within a goal simulation time. It returns true if the event time is valid, else returns false, indicating
1480 // that there are no currently queued sequencer or guidance/control events.
1481 bool PendingEventTimes_nanosec(int64_t aSimTime_nanosec, std::set<int64_t>& aEventTime_nanosec);
1482
1483 // This determines when the next time-based sequencer events will occur, within a goal simulation time. It returns true
1484 // if the event time is valid, else returns false, indicating that there are no currently queued sequencer or
1485 // guidance/control events.
1486 bool PendingSequencerEventTimes_nanosec(int64_t aSimTime_nanosec, std::set<int64_t>& aEventTime_nanosec);
1487
1488 // This determines when the next time-based guidance or control event will occur, within a goal simulation time. It
1489 // returns true if the event time is valid, else returns false, indicating that there are no currently queued
1490 // sequencer or guidance/control events.
1491 bool PendingGuidanceControlEventTimes_nanosec(int64_t aSimTime_nanosec, std::set<int64_t>& aEventTime_nanosec);
1492
1493 // This will attempt to activate a sequencer with the specified name. Returns true if the sequencer was activated. It
1494 // will return false if the sequencer was already activated or cannot be activated.
1495 bool ActivateSequencer(const std::string& aSequencerName);
1496
1497 // This will attempt to activate the specified sequencer on the specified subobject. If there is no first-level
1498 // subobjects with the specified name, the command will be passed to subobject, which will recurse the command to its
1499 // subobjects, and so on. Returns true if the sequencer was activated. It will return false if the sequencer was
1500 // already activated or cannot be activated.
1501 bool ActivateSequencer(const std::string& aSubobjectName, const std::string& aSequencerName);
1502
1503 // ====================================================================================================================
1504
1505 // Timing functions
1506
1507 // This returns the nominal timestep (in seconds) of the object
1509
1510 // This returns the last update time (in seconds) of the object
1512
1513 // This returns the total lifetime (in seconds) of the object, including time when the object was free or captive
1514 // to a parent
1516
1517 // This returns the time of flight (in seconds) of the object, when it was free from being captive to a parent
1519
1520 // This returns the total lifetime (in integer nanoseconds) of the object, including time when the object was free or
1521 // captive to a parent
1522 int64_t GetLifeTime_nanosec() const { return mLifeTime_nanosec; }
1523
1524 // This returns the time of flight (in integer nanoseconds) of the object, when it was free from being captive to a parent
1526
1527 // ====================================================================================================================
1528
1529 // Naming functions
1530
1531 // This gets the type name
1532 const std::string& GetName() const { return mTypeName; }
1533
1534 // This gets the base name
1535 std::string GetBaseName() const { return mBaseName; }
1536
1537 // This gets the derived from object name
1538 std::string GetDerivedFromName() const { return mDerivedFromName; }
1539
1540 // This is called to (possibly) add a prefix to the name of the object instance
1541 void SetNamePrefix(const std::string& aPrefixName);
1542
1543 // This sets the basename
1544 void SetBaseName(const std::string& aName) { mBaseName = aName; }
1545
1546 // This sets the type name
1547 void SetName(const std::string& aName) { mTypeName = aName; }
1548
1549 // ====================================================================================================
1550
1551 // Testing functions
1552
1554
1555 // This function is used to drive SixDOF in external programs, especially for performance calculations. It
1556 // automatically resets internal SixDOF data as well as setting the altitude, speed, pitch angle, stick and throttle
1557 // as specified. It also sets flags for freeze location, altitude, fuel burn, and no lag testing as well as
1558 // performing a single Update() function, automatically a synthetic sim time argument. Note: the stick back value may
1559 // be +/-1 while flaps are are 0-1. Throttle forward assumes that 1 is full (afterburner) and 0.5 is military power.
1560 virtual void TestingUpdate(double aAltitude_ft,
1561 double aSpeed_fps,
1562 double aPitchAngle_deg,
1563 double aStickBack,
1564 double aThrottleForward,
1565 double aFlapsDown);
1566
1568
1569 double GetNominalEstimateMaxMach() const { return mMaxMach; }
1573
1574 // These functions return the normalized control input (lever) value
1575 virtual double GetStickRightInput() const = 0;
1576 virtual double GetStickBackInput() const = 0;
1577 virtual double GetRudderRightInput() const = 0;
1578 virtual double GetThrottleInput() const = 0;
1579 virtual double GetSpeedBrakeInput() const = 0;
1580 virtual double GetSpoilerInput() const = 0;
1581 virtual double GetLandingGearInput() const = 0;
1582
1583 // ====================================================================================================================
1584
1585 // Damage and Destruction
1586
1587 // This destroys the mover
1588 void SetDestroyed();
1589
1590 bool GetIsDestroyed() const { return mIsDestroyed; }
1591
1592 // ====================================================================================================================
1593
1594 // Appearance functions
1595
1596 // This group of functions provide support for appearance attributes, which are often used by visualization tools and
1597 // networked simulation, such as DIS. These functions are included in the SixDOF_Vehicle class, since the vehicle is
1598 // best able to determine these appearances.
1599
1600 virtual void UpdateAppearance(){};
1601
1602 // External appearance control. These functions allow the appearance to be set from an external source.
1603 bool AnEngineIsOperating() const;
1604 bool AnEngineIsSmoking() const;
1605 bool AnEngineHasAfterburnerOn() const;
1606 bool ContrailTrailingEffectPresent() const;
1607 bool RocketSmokeTrailingEffectPresent() const;
1608 bool DamageSmokeTrailingEffectPresent() const;
1609 bool FlamesArePresent() const;
1610
1611 void MakeEnginesSmoke();
1612 void ActivateDamageSmokeTrailingEffect(bool aEffectActive);
1613 void ActivateFlamesEffect(bool aFlamesPresent);
1614
1615 // This returns true if the specified altitude is within the contrailing band. If it is not within the band or
1616 // contrailing conditions do not exist, it returns false.
1617 bool WithinContrailAltitudeBand(double aAltitude_ft) const;
1618
1619 virtual void CalcTotalFuelFlowAndQuantity(double& aCurrentTotalFuelFlow_pph,
1620 double& aCurrentTotalFuel_lbs,
1621 double& aMaxTotalFuel_lbs) = 0;
1622
1623 // The returns true is a spherical-earth model is being used instead of an oblate-earth model.
1624 bool UsingSphericalEarth() const { return mKinematicState.UseSphericalEarth(); }
1625
1626 // This is used to prevent crashes when passing through the ground/sea surface or the artificial "floor" of sea
1627 // level. It is usually set to true when testing.
1629
1630 // This returns true when crashes with the ground will be ignored
1632
1633 // This is used to prevent the vehicle from going below sea level at any time. The effectively limits the altitude
1634 // to zero. It is sometimes set to true when testing.
1636
1637 // This returns true when the vehicle will be prevented from going below sea level at any time. The altitude will
1638 // effectively be limited to zero.
1640
1641 // ====================================================================================================================
1642
1643 UtCallbackListN<void(double)> CrashedIntoGround;
1644 // First Mover* is the Newly Jettisoned Object, and the second is the Parent object that released it
1645 UtCallbackListN<void(std::unique_ptr<Mover>&)> SubobjectJettisoned;
1646
1651
1652 UtCallbackListN<void(double)> RouteChanged;
1653 UtCallbackListN<void(double, double)> StageIgnition;
1654 UtCallbackListN<void(double, double)> StageBurnout;
1655 UtCallbackListN<void(double, double)> StageSeparation;
1657
1658protected:
1659 explicit Mover(const Mover& aSrc);
1660
1661 bool ExecuteTriggersCB(unsigned int aPointIndex);
1662 bool ExecuteTriggers(double aSimTime, unsigned int aPointIndex) override;
1663
1664 void CrashIntoGroundCB(double aSimTime);
1665
1666 void CheckForNewlyJettisonedPlatforms(double aSimTime);
1667
1668 // This is a callback to handle a jettison
1669 void HandleSubobjectJettison(std::unique_ptr<Mover>& aJettisonedObject);
1670
1671 // This is used to perform common tasks required when a subobject is jettisoned. If it succeeds, it returns a
1672 // pointer to a newly created platform. If it fails, it returns null.
1673 WsfPlatform* CommonSubobjectJettisonTasks(std::unique_ptr<Mover> aJettisonedObject);
1674
1675 Route* ConvertWsfRouteToSixDOF_Route(const WsfRoute* aWsfRoute);
1676
1677 void InitializeSubobject(double aSimTime,
1678 std::string& aRootName,
1679 Mover* aObject,
1680 const UtQuaternion& aRotation,
1681 const UtVec3dX& aOffset);
1682
1683 virtual void CopyDataFromParent();
1684
1685 // This is used by all Initialize functions to complete "details"
1686 virtual bool InitializeDetails(double aSimTime_sec) { return true; };
1687
1688 virtual void CalculateWashIn(double aSimTime_sec);
1689
1690 virtual void UpdatePropulsionFuelBurn(double aSimTime_sec, double aDeltaTime_sec, const KinematicState& aState) = 0;
1691
1692 // This removes a sequencer (with specified name), from the sequencer list
1693 bool RemoveSequencer(const std::string& aName);
1694
1695 std::unique_ptr<Mover> SeparateSubObject(Mover* aSubObject);
1696
1697 void SetSphericalEarthFlagOnSubobjects(bool aSetting);
1698
1699 void CalculateSizeFactor(double dT_sec);
1700
1701 void SetupStartingLatLon();
1702 void SetTheLastValues();
1703
1704 virtual void HandleGroundContact(int64_t aSimTime_nanosec);
1705
1706 virtual void PerformCrash(int64_t aSimTime_nanosec);
1707 void ClampToSeaLevelMinAlt();
1708
1709 void ComputeWashInConditions(double aSimTime_sec);
1710
1711 // ====================================================================================================================
1712
1713 const double cUNDEFINED_DOUBLE = 1.0E+30; // This must be a large POSITIVE value
1714
1716
1724
1726
1727 double mMaxGees = 0.0;
1728 double mSpeed = 0.0;
1730
1732 double mYGLoad = 0.0; // Using mYGLoad instead of mYForce
1733 double mZGLoad = 0.0; // Using mZGLoad instead of mZForce
1734 double mCommandedYawRate = 0.0;
1737 double mCommandedSpeed = -1.0;
1738
1743
1746
1748
1749 double mFMM_Time = -1.0;
1750 double mFMM_Heading = 0.0;
1751 double mFMM_LocWCS[3]{0.0, 0.0, 0.0};
1753
1754 double mLastStickX = 0.0;
1755 double mLastStickY = 0.0;
1756 double mLastRudder = 0.0;
1757 double mLastThrottle = 0.0;
1761
1763
1768 double mInitialNEDPitch = 0.0;
1769 double mInitialNEDRoll = 0.0;
1779
1780 UtCloneablePtr<wsf::six_dof::ManeuverSequence> mManeuverPtr{nullptr};
1781
1782 unsigned int mStageIndex = 0;
1783
1784 std::queue<WsfPlatform*> mNewlyJettisonedPlatforms;
1785
1786 UtCloneablePtr<WsfRoute> mWsfRoutePtr{nullptr};
1787 UtCloneablePtr<WsfRoute> mDefaultWsfRoutePtr{nullptr};
1788
1790
1791 double mJokerFuel_lbs = 0.0;
1792 double mBingoFuel_lbs = 0.0;
1793
1794 // Event Pipe Manager for SixDOF Data. Maps a message name to an update rate and number of updates.
1795 std::map<std::string, std::pair<double, int>> mEventPipeManager;
1796 std::map<std::string, std::vector<WsfVisualPart*>> mVisualPartManager;
1797 UtCallbackHolder mCallbacks;
1798
1799 bool mIsInitialized = false;
1800
1801 std::string mTypeName; // This type
1802 std::string mBaseName; // Base type
1803 std::string mDerivedFromName; // Immediate ancestor type
1805
1810
1811 bool mIsCaptive = false;
1812 bool mLastIsCaptive = true;
1813
1818
1819 std::list<std::unique_ptr<Mover>> mSubObjectList;
1820 std::vector<ut::CloneablePtr<Sequencer>> mSequencerList;
1821
1825
1827
1828 // The size factor allows effects (esp aerodynamic)
1830
1831 double mStallAngle = 0.0;
1832 double mStallDetectionDeltaAngle = 0.0; // This is a delta angle where stall is detected
1833
1834 // These parameters are used to generate internal tabular data. Although the object can
1835 // operate outside of these values, the tabular data will be clamped to the highest value.
1836 // For this reason, accurate estimates of the operating envelope should be used.
1837 double mMaxMach = 100.0;
1838 double mMaxAlpha_deg = 180.0;
1839 double mMinAlpha_deg = -180.0;
1840 double mMaxBeta_deg = 90.0;
1841
1842 // If set to true, the object will not move
1843 bool mFixedObject = false;
1844
1845 double mPrepositionLat = 0.0;
1846 double mPrepositionLon = 0.0;
1847 double mInitialLat = 0.0;
1848 double mInitialLon = 0.0;
1849 double mInitialAlt_m = 0.0;
1850 double mDownRangeDist_m = 0.0;
1853
1855
1856 bool mCrashed = false;
1857 bool mEngineOn = false;
1858 bool mAfterburnerOn = false;
1859 bool mSmoking = false;
1860 bool mOnFire = false;
1862 bool mFlamesPresent = false;
1863 bool mIsDestroyed = false;
1864
1867 bool mRisingSmokePlume = false;
1868 bool mLaunchFlashSmoke = false;
1869 bool mLightDamage = false;
1870 bool mHeavyDamage = false;
1871
1872 bool mInitSetupMode = false;
1876
1878};
1879} // namespace six_dof
1880} // namespace wsf
1881
1882#endif
aObjectPtr GetLocationLLA(lla[0], lla[1], lla[2])
aObjectPtr Update(simTime)
WsfSpatialDomain
A collection of enumerations and type definitions that are used across a number of components.
Definition WsfTypes.hpp:32
@ WSF_SPATIAL_DOMAIN_AIR
Cars, trucks, buildings, etc.
Definition WsfTypes.hpp:35
Definition WsfMoverGuidance.hpp:23
WsfMover()=delete
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
A collection of WsfWaypoint objects that represent a path to be followed.
Definition WsfRoute.hpp:40
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfVisualPart.hpp:26
Definition WsfSixDOF_AeroCoreObject.hpp:35
Definition WsfSixDOF_Environment.hpp:30
Definition WsfSixDOF_ForceAndMomentsObject.hpp:28
Definition WsfSixDOF_ForceAndRotationObject.hpp:30
Definition WsfSixDOF_FuelTank.hpp:35
Definition WsfSixDOF_Integrator.hpp:31
Definition WsfSixDOF_KinematicState.hpp:34
Definition WsfSixDOF_MassProperties.hpp:29
Definition WsfSixDOF_MoverTestObject.hpp:33
This is a base class for detailed air movers. This umbrella can cover RB6 or PM6 models.
Definition WsfSixDOF_Mover.hpp:58
UtCallbackListN< void(std::unique_ptr< Mover > &)> SubobjectJettisoned
Definition WsfSixDOF_Mover.hpp:1645
virtual bool GetLastBooleanInput(size_t) const =0
virtual bool FlapRightValid() const
Definition WsfSixDOF_Mover.hpp:694
void SetBingoFuelState(double aBingoFuel_kg)
Definition WsfSixDOF_Mover.hpp:805
bool AnEngineIsOperating() const
Definition WsfSixDOF_Mover.cpp:2844
double GetInternalFuelRemaining() const
Definition WsfSixDOF_Mover.cpp:3766
virtual bool StabilizerLeftValid() const
Definition WsfSixDOF_Mover.hpp:697
void ClampToSeaLevelMinAlt()
Definition WsfSixDOF_Mover.cpp:1994
double GetAlpha_rad() const
Definition WsfSixDOF_Mover.hpp:1160
bool GetIsLightlyDamaged() const
Definition WsfSixDOF_Mover.hpp:932
bool mThrottleFullAtStart
Definition WsfSixDOF_Mover.hpp:1719
double GetAlt_m() const
Definition WsfSixDOF_Mover.hpp:118
double mLastFlapsLeverPosition
Definition WsfSixDOF_Mover.hpp:1760
void SetTheLastValues()
Definition WsfSixDOF_Mover.cpp:1203
void SetTestingClampToSeaLevelMinAlt(bool aValue)
Definition WsfSixDOF_Mover.hpp:1635
bool GetTestingIgnoreAllCrashes() const
Definition WsfSixDOF_Mover.hpp:1631
const Environment * GetEnvironment() const
Definition WsfSixDOF_Mover.hpp:1027
double GetFuelTankCapacity(const std::string &aTankName) const
Definition WsfSixDOF_Mover.cpp:3776
UtVec3dX mPosRelToParent_m
Definition WsfSixDOF_Mover.hpp:1814
double GetLandingGearLeverPosition() const
Definition WsfSixDOF_Mover.cpp:4338
double GetBetaDot_rps() const
Definition WsfSixDOF_Mover.hpp:1175
double GetTimeOfFlight_sec() const
Definition WsfSixDOF_Mover.hpp:1518
Mover * GetParentVehicle() const
Definition WsfSixDOF_Mover.hpp:953
std::string GetDerivedFromName() const
Definition WsfSixDOF_Mover.hpp:1538
void InitializeSubobject(double aSimTime, std::string &aRootName, Mover *aObject, const UtQuaternion &aRotation, const UtVec3dX &aOffset)
Definition WsfSixDOF_Mover.cpp:3498
bool mLastIsCaptive
Definition WsfSixDOF_Mover.hpp:1812
void SetGuidance(WsfMoverGuidance *aGuidancePtr)
Set the pointer to the mover guidance object. Ownership is retained by the caller.
Definition WsfSixDOF_Mover.hpp:843
double GetEmptyWeight_lbs() const
Definition WsfSixDOF_Mover.hpp:1243
Mover(const WsfScenario &aScenario)
Constructor.
Definition WsfSixDOF_Mover.cpp:63
virtual double GetSpeedBrakeInput() const =0
bool mIsInitialized
Definition WsfSixDOF_Mover.hpp:1799
double mCommandedPitchRate
Definition WsfSixDOF_Mover.hpp:1735
virtual double GetMaximumPotentialThrust_lbs() const =0
virtual double GetCurrentForwardThrust_lbs()=0
double mInitialSpeed_NED_Y_fps
Definition WsfSixDOF_Mover.hpp:1771
virtual void SetSpoilersPosition(double aPosition)=0
virtual double GetCurrentThrust_lbs()=0
UtVec3dX mSeparationVel_fps
Definition WsfSixDOF_Mover.hpp:1816
double GetJokerFuelState()
Definition WsfSixDOF_Mover.hpp:808
double GetTotalFuelCapacity() const
Definition WsfSixDOF_Mover.cpp:3741
virtual void CalculateAeroBodyForceAndMoments(UtVec3dX &aLiftBodyVector_lbs, UtVec3dX &aDragBodyVector_lbs, UtVec3dX &aSideForceBodyVector_lbs, UtVec3dX &aMoment_ftlbs, UtVec3dX &aReferencePt_ft)=0
bool PendingEventTimes_nanosec(int64_t aSimTime_nanosec, std::set< int64_t > &aEventTime_nanosec)
Definition WsfSixDOF_Mover.cpp:1749
virtual PropulsionSystem * GetPropulsionSystem() const =0
bool PendingSequencerEventTimes_nanosec(int64_t aSimTime_nanosec, std::set< int64_t > &aEventTime_nanosec)
Definition WsfSixDOF_Mover.cpp:1720
void AddFuel(double aFuelMass_kg)
Definition WsfSixDOF_Mover.cpp:3746
virtual bool GetBooleanInput(size_t) const =0
size_t GetNumSubobjects() const
Definition WsfSixDOF_Mover.hpp:1334
virtual double GetThrottleInput() const =0
bool GetContrailTrailingEffect() const
Definition WsfSixDOF_Mover.hpp:902
double GetLastUpdateTime_sec() const
Definition WsfSixDOF_Mover.hpp:1511
bool ExecuteTriggersCB(unsigned int aPointIndex)
Definition WsfSixDOF_Mover.cpp:3372
virtual bool AileronRightValid() const
Definition WsfSixDOF_Mover.hpp:692
void GetStartingLatLon(double &aStartingLat, double &aStartingLon) const
Definition WsfSixDOF_Mover.hpp:1034
double GetYawRate()
Definition WsfSixDOF_Mover.hpp:139
bool GetFlamesArePresent() const
Definition WsfSixDOF_Mover.hpp:926
void SetLastCaptiveState(bool aLastIsCaptive)
Definition WsfSixDOF_Mover.hpp:1318
virtual double GetStickRightInput() const =0
virtual void UpdateAppearance()
Definition WsfSixDOF_Mover.hpp:1600
virtual bool StabilizerRightValid() const
Definition WsfSixDOF_Mover.hpp:698
virtual double GetSpoilerInput() const =0
virtual double GetTotalVehicleFuelFlow_pph() const =0
double GetSideForce_nt() const
Definition WsfSixDOF_Mover.hpp:154
const MassProperties & GetMassProperties() const
Definition WsfSixDOF_Mover.hpp:1241
virtual bool RudderValid() const
Definition WsfSixDOF_Mover.hpp:701
bool GetLastIsCaptive() const
Definition WsfSixDOF_Mover.hpp:1212
virtual bool FlapLeftValid() const
Definition WsfSixDOF_Mover.hpp:693
void SetWashInInitConditions(bool aUseWashInInitConditions)
Definition WsfSixDOF_Mover.hpp:971
bool mEnableThrustVectoringAtStart
Definition WsfSixDOF_Mover.hpp:1722
UtCallbackHolder mCallbacks
Definition WsfSixDOF_Mover.hpp:1797
double GetStepSize_sec() const
Definition WsfSixDOF_Mover.hpp:1508
virtual bool RudderLeftValid() const
Definition WsfSixDOF_Mover.hpp:700
double mCommandedYawRate
Definition WsfSixDOF_Mover.hpp:1734
UtCallbackListN< void(double, double)> StageSeparation
Definition WsfSixDOF_Mover.hpp:1655
int64_t mStepSize_nanosec
Definition WsfSixDOF_Mover.hpp:1807
void CalculateSizeFactor(double dT_sec)
Definition WsfSixDOF_Mover.cpp:1484
double mInitialLat
Definition WsfSixDOF_Mover.hpp:1847
void SetBaseName(const std::string &aName)
Definition WsfSixDOF_Mover.hpp:1544
double GetSpeed_mps() const
Definition WsfSixDOF_Mover.hpp:1136
UtCallbackListN< void(double, double)> StageBurnout
Definition WsfSixDOF_Mover.hpp:1654
std::unique_ptr< Mover > SeparateSubObject(Mover *aSubObject)
Definition WsfSixDOF_Mover.cpp:2153
bool ContrailTrailingEffectPresent() const
Definition WsfSixDOF_Mover.cpp:2882
double GetNominalEstimateMaxBeta_deg() const
Definition WsfSixDOF_Mover.hpp:1572
double mLastSpdBrakeLeverPosition
Definition WsfSixDOF_Mover.hpp:1758
const double cUNDEFINED_DOUBLE
Definition WsfSixDOF_Mover.hpp:1713
std::queue< WsfPlatform * > mNewlyJettisonedPlatforms
Definition WsfSixDOF_Mover.hpp:1784
double GetThrustMagnitude_lbs() const
Definition WsfSixDOF_Mover.hpp:1058
void TerminateThrust(int64_t aTerminateTime_nanosec=0)
Definition WsfSixDOF_Mover.cpp:2768
double GetAlphaDot_rps() const
Definition WsfSixDOF_Mover.hpp:1165
double GetBetaDot_dps() const
Definition WsfSixDOF_Mover.hpp:1177
virtual void CalculateBetaAtSpecifiedGLoad_deg(double aMach, double &aBeta_deg) const =0
virtual bool LandingGearNoseValid() const
Definition WsfSixDOF_Mover.hpp:705
bool mValidInitialNEDPitch
Definition WsfSixDOF_Mover.hpp:1776
void SetAngRelToParentYPR_rad(const UtVec3dX &aAngRelToParentYPR_rad)
Definition WsfSixDOF_Mover.hpp:1319
double GetDrag_lbs() const
Definition WsfSixDOF_Mover.hpp:1052
double GetRollRate_rps() const
Definition WsfSixDOF_Mover.hpp:1155
bool IsExternalFuelTank()
Definition WsfSixDOF_Mover.cpp:2514
double GetExternalFuelRemaining() const
Definition WsfSixDOF_Mover.cpp:3771
void SetCommandedSpeed(double aCommandedSpeed)
Definition WsfSixDOF_Mover.hpp:863
UtVec3d mManeuverPlane
Definition WsfSixDOF_Mover.hpp:1729
const Environment * mEnvironment
Definition WsfSixDOF_Mover.hpp:1822
double GetInternalFuelCapacity() const
Definition WsfSixDOF_Mover.cpp:3751
double mInitialLon
Definition WsfSixDOF_Mover.hpp:1848
UtCloneablePtr< WsfRoute > mWsfRoutePtr
Definition WsfSixDOF_Mover.hpp:1786
double GetCurrentWeight_kg() const
Definition WsfSixDOF_Mover.hpp:172
double mInitialNEDHeading
Definition WsfSixDOF_Mover.hpp:1767
bool mIsCaptive
Definition WsfSixDOF_Mover.hpp:1811
virtual double GetSpeedBrakePosition() const =0
bool AutopilotAvailable() const
Definition WsfSixDOF_Mover.cpp:1520
bool mLightDamage
Definition WsfSixDOF_Mover.hpp:1869
bool GetIsHeavilyDamaged() const
Definition WsfSixDOF_Mover.hpp:938
bool mAfterburnerOn
Definition WsfSixDOF_Mover.hpp:1858
double GetRudderRightPosition() const
Definition WsfSixDOF_Mover.cpp:4283
double mLastStickX
Definition WsfSixDOF_Mover.hpp:1754
double mInitialPosition_Longitude
Definition WsfSixDOF_Mover.hpp:1765
double GetAlpha_deg() const
Definition WsfSixDOF_Mover.hpp:1162
void HandleSubobjectJettison(std::unique_ptr< Mover > &aJettisonedObject)
Definition WsfSixDOF_Mover.cpp:3569
void GetBodyRates_rps(double &xAxis_rps, double &yAxis_rps, double &zAxis_rps) const
Definition WsfSixDOF_Mover.hpp:1139
double mCommandedSpeed
Definition WsfSixDOF_Mover.hpp:1737
double GetExternalFuelCapacity() const
Definition WsfSixDOF_Mover.cpp:3756
double GetThrustReverserControlPosition() const
Definition WsfSixDOF_Mover.cpp:4316
double GetHeading_rad() const
Definition WsfSixDOF_Mover.hpp:1077
bool GetIsDestroyed() const
Definition WsfSixDOF_Mover.hpp:1590
virtual double GetRudderRightInput() const =0
double GetLongitude_deg() const
Definition WsfSixDOF_Mover.hpp:1114
double mInitialSpeed_NED_Z_fps
Definition WsfSixDOF_Mover.hpp:1772
double GetDynamicPressure_psf() const
Definition WsfSixDOF_Mover.hpp:1186
double mJokerFuel_lbs
Definition WsfSixDOF_Mover.hpp:1791
virtual size_t GetInputHandle(const std::string &) const =0
double GetPitch_rad() const
Definition WsfSixDOF_Mover.hpp:1082
double GetLastStaticPressure_psf() const
Definition WsfSixDOF_Mover.hpp:1204
double mThrustTerminationTime_sec
Definition WsfSixDOF_Mover.hpp:1851
void SetFuelInTank(const std::string &aTankName, double aFuel_kg)
Definition WsfSixDOF_Mover.cpp:3798
UtCallbackListN< void(double)> RouteChanged
Definition WsfSixDOF_Mover.hpp:1652
double GetTotalFuelFlow() const
Definition WsfSixDOF_Mover.cpp:3803
double GetApogee_km() const
Definition WsfSixDOF_Mover.hpp:1097
void UpdateFuelBurn(int64_t aSimTime_nanosec, double aDeltaT_sec, const KinematicState &aState)
Definition WsfSixDOF_Mover.cpp:1399
virtual double GetFlapsPosition() const =0
double GetLatitude_deg() const
Definition WsfSixDOF_Mover.hpp:1112
bool mFollowVerticalTrack
Definition WsfSixDOF_Mover.hpp:1789
virtual void SetLastSimTime(double aSimTime_sec, bool aIncludeSubobjects=false)=0
virtual bool HasLandingGear()
Definition WsfSixDOF_Mover.hpp:995
double mInitialAltitude_m
Definition WsfSixDOF_Mover.hpp:1766
void SetName(const std::string &aName)
Definition WsfSixDOF_Mover.hpp:1547
double mInitialPosition_Latitude
Definition WsfSixDOF_Mover.hpp:1764
bool UsingSphericalEarth() const
Definition WsfSixDOF_Mover.hpp:1624
double mMaxGees
Definition WsfSixDOF_Mover.hpp:1727
FreezeFlags * GetFreezeFlags()
Definition WsfSixDOF_Mover.hpp:1021
double GetPitchRate()
Definition WsfSixDOF_Mover.hpp:142
virtual void TestingUpdate(double aAltitude_ft, double aSpeed_fps, double aPitchAngle_deg, double aStickBack, double aThrottleForward, double aFlapsDown)
Definition WsfSixDOF_Mover.cpp:839
bool mProducesLaunchSmoke
Definition WsfSixDOF_Mover.hpp:1865
double mPrepositionLon
Definition WsfSixDOF_Mover.hpp:1846
bool mValidInitialAltitude_ft
Definition WsfSixDOF_Mover.hpp:1774
double GetNormalizedMilitaryThrust() const
Definition WsfSixDOF_Mover.cpp:2685
double mStallDetectionDeltaAngle
Definition WsfSixDOF_Mover.hpp:1832
void SetLaunchFlashSmokeIsPresent(bool aLaunchFlashSmoke)
Definition WsfSixDOF_Mover.hpp:923
void SetIsHeavilyDamaged()
Definition WsfSixDOF_Mover.hpp:941
double GetRollRate()
Definition WsfSixDOF_Mover.hpp:145
virtual bool RudderRightValid() const
Definition WsfSixDOF_Mover.hpp:702
double GetNormalizedAfterburnerThrust() const
Definition WsfSixDOF_Mover.cpp:2705
UtCallbackListN< void(double)> CrashedIntoGround
Definition WsfSixDOF_Mover.hpp:1643
double GetPitch() const
Definition WsfSixDOF_Mover.hpp:133
double GetStickBackPosition() const
Definition WsfSixDOF_Mover.cpp:4261
bool RemoveSequencer(const std::string &aName)
Definition WsfSixDOF_Mover.cpp:1979
std::string GetBaseName() const
Definition WsfSixDOF_Mover.hpp:1535
virtual bool LandingGearMainRightValid() const
Definition WsfSixDOF_Mover.hpp:707
double GetStaticPressure_psf() const
Definition WsfSixDOF_Mover.hpp:1189
double GetFlightPathAngle()
Definition WsfSixDOF_Mover.hpp:124
double GetSpeed_Mach() const
Definition WsfSixDOF_Mover.hpp:169
double GetVerticalSpeed()
Definition WsfSixDOF_Mover.hpp:121
std::map< std::string, std::pair< double, int > > mEventPipeManager
Definition WsfSixDOF_Mover.hpp:1795
virtual double GetNormalizedAileronRight() const
Definition WsfSixDOF_Mover.hpp:673
double GetKIAS() const
Definition WsfSixDOF_Mover.hpp:1126
double GetSpeed_KCAS() const
Definition WsfSixDOF_Mover.hpp:163
double GetSpeed_KIAS() const
Definition WsfSixDOF_Mover.hpp:160
FreezeFlags mFreezeFlags
Definition WsfSixDOF_Mover.hpp:1826
bool mLaunchFlashSmoke
Definition WsfSixDOF_Mover.hpp:1868
virtual void ZeroKinematicsDuringTesting()=0
virtual bool LandingGearValid() const
Definition WsfSixDOF_Mover.hpp:704
UtCallbackListN< void(double, double)> StageIgnition
Definition WsfSixDOF_Mover.hpp:1653
void MakeEnginesSmoke(bool aEngineSmoking)
Definition WsfSixDOF_Mover.hpp:899
UtCloneablePtr< WsfRoute > mDefaultWsfRoutePtr
Definition WsfSixDOF_Mover.hpp:1787
double GetFlapsLeverPosition() const
Definition WsfSixDOF_Mover.cpp:4349
double mPrepositionLat
Definition WsfSixDOF_Mover.hpp:1845
bool mThrottleAfterburnerAtStart
Definition WsfSixDOF_Mover.hpp:1720
virtual void CopyDataFromParent()
Definition WsfSixDOF_Mover.cpp:3564
virtual void HandleGroundContact(int64_t aSimTime_nanosec)
Definition WsfSixDOF_Mover.cpp:1411
virtual double GetMinimumPotentialThrust_lbs() const =0
double mInitialNEDPitch
Definition WsfSixDOF_Mover.hpp:1768
bool GetDamageSmokeTrailingEffect() const
Definition WsfSixDOF_Mover.hpp:908
double GetThrustMagnitude_nt() const
Definition WsfSixDOF_Mover.hpp:157
virtual void UpdatePropulsionFuelBurn(double aSimTime_sec, double aDeltaTime_sec, const KinematicState &aState)=0
double GetPotentialManeuverGLoadMax()
Definition WsfSixDOF_Mover.hpp:318
UtCloneablePtr< wsf::six_dof::ManeuverSequence > mManeuverPtr
Definition WsfSixDOF_Mover.hpp:1780
bool mFlamesPresent
Definition WsfSixDOF_Mover.hpp:1862
void SetCommandedPitchRate(double aRate)
Definition WsfSixDOF_Mover.hpp:857
virtual void SetActiveAeroObject(const std::string &aName)=0
virtual double GetNormalizedSpoilerLeft() const
Definition WsfSixDOF_Mover.hpp:676
bool mValidInitialNEDHeading
Definition WsfSixDOF_Mover.hpp:1775
double mDownRangeDist_m
Definition WsfSixDOF_Mover.hpp:1850
double GetLift_nt() const
Definition WsfSixDOF_Mover.hpp:148
virtual double GetNormalizedStabilizerRight() const
Definition WsfSixDOF_Mover.hpp:679
double mStallAngle
Definition WsfSixDOF_Mover.hpp:1831
bool GetEngineIsOperating() const
Definition WsfSixDOF_Mover.hpp:890
std::string mTypeName
Definition WsfSixDOF_Mover.hpp:1801
bool mDamageSmokeTrailingEffect
Definition WsfSixDOF_Mover.hpp:1861
virtual double GetNormalizedRudderRight() const
Definition WsfSixDOF_Mover.hpp:683
virtual double MaxPotentialManeuverGLoad() const =0
double GetHeading_deg() const
Definition WsfSixDOF_Mover.hpp:1079
bool ControlsEnabled() const
Definition WsfSixDOF_Mover.cpp:1511
virtual bool GetWeightOnWheels() const
Definition WsfSixDOF_Mover.hpp:184
virtual UtVec3dX GetCenterOfGravity_ft() const =0
double GetLastNx_g() const
Definition WsfSixDOF_Mover.hpp:1192
void ActivateFlamesEffect(bool aFlamesPresent)
Definition WsfSixDOF_Mover.cpp:2917
double GetNominalEstimateMinAlpha_deg() const
Definition WsfSixDOF_Mover.hpp:1571
void GetBodyAngularAccel_rps2(double &xAxis_rps2, double &yAxis_rps2, double &zAxis_rps2) const
Definition WsfSixDOF_Mover.hpp:1180
double GetFlightPathAngle_rad() const
Definition WsfSixDOF_Mover.hpp:1066
double GetAltitudeMSL_ft() const
Definition WsfSixDOF_Mover.hpp:1094
bool FlamesArePresent() const
Definition WsfSixDOF_Mover.cpp:2912
virtual void CalculateCurrentMassProperties()=0
double GetFlightPathAngle_deg() const
Definition WsfSixDOF_Mover.hpp:1068
virtual PilotManager * GetPilotManager() const =0
double GetKCAS() const
Definition WsfSixDOF_Mover.hpp:1128
double mYGLoad
Definition WsfSixDOF_Mover.hpp:1732
virtual void CalculateAeroBodyForceAndRotation(UtVec3dX &aLiftBodyVector_lbs, UtVec3dX &aDragBodyVector_lbs, UtVec3dX &aSideForceBodyVector_lbs, UtVec3dX &aRotationAccelerationLimits_rps2, UtVec3dX &aStabilizingFrequency_rps)=0
std::string mBaseName
Definition WsfSixDOF_Mover.hpp:1802
double GetHeading() const
Definition WsfSixDOF_Mover.hpp:130
double GetSpeedBrakeControlPosition() const
Definition WsfSixDOF_Mover.cpp:4327
double mLastSpoilerLeverPosition
Definition WsfSixDOF_Mover.hpp:1759
double mFMM_Heading
Definition WsfSixDOF_Mover.hpp:1750
double GetTotalFuelRemaining() const
Definition WsfSixDOF_Mover.cpp:3761
double GetBeta_rad() const
Definition WsfSixDOF_Mover.hpp:1170
WsfSpatialDomain GetSpatialDomain() const override
Definition WsfSixDOF_Mover.hpp:68
double GetSpeed_KTAS() const
Definition WsfSixDOF_Mover.hpp:166
double GetAlphaDot_dps() const
Definition WsfSixDOF_Mover.hpp:1167
double GetCurrentWeight_lbs() const
Definition WsfSixDOF_Mover.hpp:1244
double GetPitchRate_dps() const
Definition WsfSixDOF_Mover.hpp:1152
bool DamageSmokeTrailingEffectPresent() const
Definition WsfSixDOF_Mover.cpp:2902
void EmptyAllInternalTanks()
Definition WsfSixDOF_Mover.cpp:2530
virtual double GetTotalFuelFlow_pph() const =0
void IgniteObject(int64_t aIgniteTimeInFrame_nanosec)
Definition WsfSixDOF_Mover.cpp:2746
bool mAutopilotNoControlAtStart
Definition WsfSixDOF_Mover.hpp:1721
bool mEnginesOffAtStart
Definition WsfSixDOF_Mover.hpp:1717
double GetSideForce_lbs() const
Definition WsfSixDOF_Mover.hpp:1055
std::string mIntegratorTypeName
Definition WsfSixDOF_Mover.hpp:1804
double mInitialSpeed_NED_X_fps
Definition WsfSixDOF_Mover.hpp:1770
virtual double GetNormalizedElevator() const
Definition WsfSixDOF_Mover.hpp:680
virtual double GetNormalizedFlapRight() const
Definition WsfSixDOF_Mover.hpp:675
double GetNy_g() const
Definition WsfSixDOF_Mover.hpp:1043
bool GetLaunchFlashSmokeIsPresent() const
Definition WsfSixDOF_Mover.hpp:920
void EmptyAllInternalandExternalTanks()
Definition WsfSixDOF_Mover.cpp:3809
bool mThrottleIdleAtStart
Definition WsfSixDOF_Mover.hpp:1718
WsfMoverGuidance * mGuidancePtr
Definition WsfSixDOF_Mover.hpp:1731
double mLastRudder
Definition WsfSixDOF_Mover.hpp:1756
double mMaxBeta_deg
Definition WsfSixDOF_Mover.hpp:1840
void SetTestingIgnoreAllCrashes(bool aValue)
Definition WsfSixDOF_Mover.hpp:1628
double GetBeta_deg() const
Definition WsfSixDOF_Mover.hpp:1172
bool mCrashed
Definition WsfSixDOF_Mover.hpp:1856
virtual const Integrator * GetIntegrator() const =0
void SetMinimumHeightAboveTerrain(double aMinimum)
Definition WsfSixDOF_Mover.hpp:870
virtual double GetNormalizedStabilizerLeft() const
Definition WsfSixDOF_Mover.hpp:678
bool mValidInitialNEDRoll
Definition WsfSixDOF_Mover.hpp:1777
double GetRoll_deg() const
Definition WsfSixDOF_Mover.hpp:1089
bool GetEngineAfterburnerIsOn() const
Definition WsfSixDOF_Mover.hpp:896
bool AnEngineHasAfterburnerOn() const
Definition WsfSixDOF_Mover.cpp:2864
int64_t mLastSimTime_nanosec
Definition WsfSixDOF_Mover.hpp:1806
void EnableControls(bool aEnabled)
Definition WsfSixDOF_Mover.cpp:1503
const WsfRoute * GetDefaultRoute() const override
Definition WsfSixDOF_Mover.hpp:425
bool mRisingSmokePlume
Definition WsfSixDOF_Mover.hpp:1867
bool mUseWashInInitConditions
Definition WsfSixDOF_Mover.hpp:1873
double GetLastNz_g() const
Definition WsfSixDOF_Mover.hpp:1198
void SetSphericalEarthFlagOnSubobjects(bool aSetting)
Definition WsfSixDOF_Mover.cpp:1492
virtual MoverTestObject * GetTestSupportObject() const =0
virtual double GetNormalizedRudder() const
Definition WsfSixDOF_Mover.hpp:682
virtual double GetNormalizedAileronLeft() const
Definition WsfSixDOF_Mover.hpp:672
double GetAltitudeMSL_m() const
Definition WsfSixDOF_Mover.hpp:1092
virtual bool AileronLeftValid() const
Definition WsfSixDOF_Mover.hpp:691
virtual double GetNormalizedLandingGearMainLeft() const
Definition WsfSixDOF_Mover.hpp:687
SizeFactor mSizeFactor
Definition WsfSixDOF_Mover.hpp:1829
bool mIsDestroyed
Definition WsfSixDOF_Mover.hpp:1863
void StartupEngines(double aSimTime_sec)
Definition WsfSixDOF_Mover.cpp:3815
virtual double GetNormalizedLandingGearNose() const
Definition WsfSixDOF_Mover.hpp:686
bool IsCaptive() const
Definition WsfSixDOF_Mover.hpp:1316
virtual bool LandingGearMainLeftValid() const
Definition WsfSixDOF_Mover.hpp:706
void CrashIntoGroundCB(double aSimTime)
Definition WsfSixDOF_Mover.cpp:3421
virtual 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, ForceAndMomentsObject &aForceAndMoment, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)=0
virtual AeroCoreObject * GetAeroCoreObject() const =0
WsfMoverGuidance * GetGuidance() const
Get the pointer to the mover guidance object.
Definition WsfSixDOF_Mover.hpp:846
void ShutdownEngines(double aSimTime_sec)
Definition WsfSixDOF_Mover.cpp:3820
double mMaxAlpha_deg
Definition WsfSixDOF_Mover.hpp:1838
bool GetTestingClampToSeaLevelMinAlt() const
Definition WsfSixDOF_Mover.hpp:1639
WsfPlatform * CommonSubobjectJettisonTasks(std::unique_ptr< Mover > aJettisonedObject)
Definition WsfSixDOF_Mover.cpp:3634
virtual void CalcTotalFuelFlowAndQuantity(double &aCurrentTotalFuelFlow_pph, double &aCurrentTotalFuel_lbs, double &aMaxTotalFuel_lbs)=0
double mMinimumHeightAboveTerrain
The minimum height above terrain required for terrain following.
Definition WsfSixDOF_Mover.hpp:1745
virtual bool ThrottleValid() const =0
void SetDestroyed()
Definition WsfSixDOF_Mover.cpp:6088
bool ExecuteTriggers(double aSimTime, unsigned int aPointIndex) override
Executes any actions tied to the waypoint at aPointIndex.
Definition WsfSixDOF_Mover.cpp:3378
double GetGLoad()
Definition WsfSixDOF_Mover.hpp:127
virtual bool InitializeDetails(double aSimTime_sec)
Definition WsfSixDOF_Mover.hpp:1686
bool PendingGuidanceControlEventTimes_nanosec(int64_t aSimTime_nanosec, std::set< int64_t > &aEventTime_nanosec)
Definition WsfSixDOF_Mover.cpp:1741
KinematicState mKinematicState
Definition WsfSixDOF_Mover.hpp:1824
virtual double GetSpoilersPosition() const =0
bool mValidInitialPosition
Definition WsfSixDOF_Mover.hpp:1773
std::string mDerivedFromName
Definition WsfSixDOF_Mover.hpp:1803
virtual double GetNormalizedRudderLeft() const
Definition WsfSixDOF_Mover.hpp:681
bool mSmoking
Definition WsfSixDOF_Mover.hpp:1859
double GetStickRightPosition() const
Definition WsfSixDOF_Mover.cpp:4272
double GetRollRate_dps() const
Definition WsfSixDOF_Mover.hpp:1157
bool mFixedObject
Definition WsfSixDOF_Mover.hpp:1843
virtual double GetNormalizedLandingGear() const
Definition WsfSixDOF_Mover.hpp:685
bool mTestingClampToSeaLevelMinAlt
Definition WsfSixDOF_Mover.hpp:1875
double GetThrottleAfterburnerPosition() const
Definition WsfSixDOF_Mover.cpp:4305
virtual double GetLandingGearInput() const =0
double GetRoll() const
Definition WsfSixDOF_Mover.hpp:136
void CheckForNewlyJettisonedPlatforms(double aSimTime)
Definition WsfSixDOF_Mover.cpp:3488
bool GetEngineIsSmoking() const
Definition WsfSixDOF_Mover.hpp:893
void SetSizeFactorEnabled(bool aSetting)
Definition WsfSixDOF_Mover.hpp:1005
void SetCommandedRollRate(double aRate)
Definition WsfSixDOF_Mover.hpp:860
double GetLastAltitudeMSL_ft() const
Definition WsfSixDOF_Mover.hpp:1207
virtual double GetNormalizedFlapLeft() const
Definition WsfSixDOF_Mover.hpp:674
double mSpeed
Definition WsfSixDOF_Mover.hpp:1728
std::vector< ut::CloneablePtr< Sequencer > > mSequencerList
Definition WsfSixDOF_Mover.hpp:1820
double GetNominalEstimateMaxAlpha_deg() const
Definition WsfSixDOF_Mover.hpp:1570
virtual double GetNormalizedSpoilerRight() const
Definition WsfSixDOF_Mover.hpp:677
std::map< std::string, std::vector< WsfVisualPart * > > mVisualPartManager
Definition WsfSixDOF_Mover.hpp:1796
bool mTestingIgnoreAllCrashes
Definition WsfSixDOF_Mover.hpp:1874
double GetSpeed_fps() const
Definition WsfSixDOF_Mover.hpp:1134
bool mOnFire
Definition WsfSixDOF_Mover.hpp:1860
double mFMM_LocWCS[3]
Definition WsfSixDOF_Mover.hpp:1751
virtual void CalcStallAngle()
Definition WsfSixDOF_Mover.cpp:1530
double GetYawRate_rps() const
Definition WsfSixDOF_Mover.hpp:1145
int64_t GetLifeTime_nanosec() const
Definition WsfSixDOF_Mover.hpp:1522
bool GetRisingSmokePlumeIsPresent() const
Definition WsfSixDOF_Mover.hpp:914
double mLaunchSmokeTime_sec
Definition WsfSixDOF_Mover.hpp:1866
double mZGLoad
Definition WsfSixDOF_Mover.hpp:1733
bool mEnableControlsAtStart
Definition WsfSixDOF_Mover.hpp:1723
MassProperties mMassProperties
Definition WsfSixDOF_Mover.hpp:1823
double GetPitch_deg() const
Definition WsfSixDOF_Mover.hpp:1084
double GetLifeTime_sec() const
Definition WsfSixDOF_Mover.hpp:1515
double GetDrag_nt() const
Definition WsfSixDOF_Mover.hpp:151
void EmptyAllExternalTanks()
Definition WsfSixDOF_Mover.cpp:2538
double mMaxMach
Definition WsfSixDOF_Mover.hpp:1837
void SetCaptiveState(bool aIsCaptive)
Definition WsfSixDOF_Mover.hpp:1317
void SetCommandedYawRate(double aRate)
Definition WsfSixDOF_Mover.hpp:854
double mInitialNEDRoll
Definition WsfSixDOF_Mover.hpp:1769
double mInitialAlt_m
Definition WsfSixDOF_Mover.hpp:1849
void SetJokerFuelState(double aJokerFuel_kg)
Definition WsfSixDOF_Mover.hpp:802
UtVec3dX mAngRelToParentYPR_rad
Definition WsfSixDOF_Mover.hpp:1815
int CurrentStage() const
Definition WsfSixDOF_Mover.hpp:873
double GetVertSpeed_fpm() const
Definition WsfSixDOF_Mover.hpp:1063
double GetSpoilersLeverPosition() const
Definition WsfSixDOF_Mover.cpp:4360
bool mThrustTerminationTimeValid
Definition WsfSixDOF_Mover.hpp:1852
bool mEngineOn
Definition WsfSixDOF_Mover.hpp:1857
double GetRangeSinceStart_km() const
Definition WsfSixDOF_Mover.hpp:1100
void SetRisingSmokePlumeIsPresent(bool aSmoking)
Definition WsfSixDOF_Mover.hpp:917
KinematicState * GetKinematicState()
Definition WsfSixDOF_Mover.hpp:1015
virtual double GetStickBackInput() const =0
double mLastThrottle
Definition WsfSixDOF_Mover.hpp:1757
int64_t GetTimeOfFlight_nanosec() const
Definition WsfSixDOF_Mover.hpp:1525
double GetLastNy_g() const
Definition WsfSixDOF_Mover.hpp:1195
double GetLift_lbs() const
Definition WsfSixDOF_Mover.hpp:1049
Mover * mParentVehicle
Definition WsfSixDOF_Mover.hpp:1715
void CheckForFrequencyUnits(double &value, UtInput &aInput)
Check an input for frequency units (hz) and convert to seconds if so.
Definition WsfSixDOF_Mover.hpp:820
void SetFlamesArePresent(bool aFlaming)
Definition WsfSixDOF_Mover.hpp:929
Route * ConvertWsfRouteToSixDOF_Route(const WsfRoute *aWsfRoute)
Definition WsfSixDOF_Mover.cpp:3687
double mCommandedEngineStopTime
Definition WsfSixDOF_Mover.hpp:1742
bool RocketSmokeTrailingEffectPresent() const
Definition WsfSixDOF_Mover.cpp:2892
bool ActivateSequencer(const std::string &aSequencerName)
Definition WsfSixDOF_Mover.cpp:1790
double GetNx_g() const
Definition WsfSixDOF_Mover.hpp:1040
double GetRoll_rad() const
Definition WsfSixDOF_Mover.hpp:1087
double GetLastDynamicPressure_psf() const
Definition WsfSixDOF_Mover.hpp:1201
void ComputeWashInConditions(double aSimTime_sec)
Definition WsfSixDOF_Mover.cpp:1230
double mLastStickY
Definition WsfSixDOF_Mover.hpp:1755
bool mInitSetupMode
Definition WsfSixDOF_Mover.hpp:1872
std::list< std::unique_ptr< Mover > > mSubObjectList
Definition WsfSixDOF_Mover.hpp:1819
virtual bool ElevatorValid() const
Definition WsfSixDOF_Mover.hpp:699
bool Crashed() const
Definition WsfSixDOF_Mover.hpp:1001
Sequencer * GetSequencerByName(const std::string &aName) const
Definition WsfSixDOF_Mover.cpp:1777
double GetNormalizedTotalThrust() const
Definition WsfSixDOF_Mover.cpp:2725
double GetMach() const
Definition WsfSixDOF_Mover.hpp:1132
double GetPitchRate_rps() const
Definition WsfSixDOF_Mover.hpp:1150
double GetDesignWeightForMaxG_lbs() const
Definition WsfSixDOF_Mover.hpp:600
void SetIsLightlyDamaged()
Definition WsfSixDOF_Mover.hpp:935
void ActivateDamageSmokeTrailingEffect(bool aEffectActive)
Definition WsfSixDOF_Mover.cpp:2907
unsigned int mStageIndex
The index of the current stage.
Definition WsfSixDOF_Mover.hpp:1782
double GetKTAS() const
Definition WsfSixDOF_Mover.hpp:1130
void SetupStartingLatLon()
Definition WsfSixDOF_Mover.cpp:1173
virtual void SetFlapsPosition(double aPosition)=0
void ShutdownObject(int64_t aTerminateTime_nanosec=0)
Definition WsfSixDOF_Mover.cpp:2757
bool mHeavyDamage
Definition WsfSixDOF_Mover.hpp:1870
double GetBingoFuelState()
Definition WsfSixDOF_Mover.hpp:811
virtual 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, ForceAndRotationObject &aForceAndRotation, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)=0
double GetEmptyWeight_kg() const
Definition WsfSixDOF_Mover.hpp:175
bool GetRocketSmokeTrailingEffect() const
Definition WsfSixDOF_Mover.hpp:905
double GetNominalEstimateMaxMach() const
Definition WsfSixDOF_Mover.hpp:1569
double GetFuelInTank(const std::string &aTankName) const
Definition WsfSixDOF_Mover.cpp:3787
double mMinAlpha_deg
Definition WsfSixDOF_Mover.hpp:1839
double GetNz_g() const
Definition WsfSixDOF_Mover.hpp:1046
virtual bool SpoilerLeftValid() const
Definition WsfSixDOF_Mover.hpp:695
double GetThrottleMilitaryPosition() const
Definition WsfSixDOF_Mover.cpp:4294
int64_t mTimeOfFlight_nanosec
Definition WsfSixDOF_Mover.hpp:1809
virtual bool SpoilerRightValid() const
Definition WsfSixDOF_Mover.hpp:696
void SetParentVehicle(Mover *aParentVehicle)
Definition WsfSixDOF_Mover.hpp:954
virtual bool SpeedBrakeValid() const
Definition WsfSixDOF_Mover.hpp:703
void SetDamageSmokeTrailingEffect(bool aEffectActive)
Definition WsfSixDOF_Mover.hpp:911
int64_t mTestingSimTime_nanosec
Definition WsfSixDOF_Mover.hpp:1877
double mCommandedRollRate
Definition WsfSixDOF_Mover.hpp:1736
void OnPlatformBrokenEvent(double aSimTime) override
Owning platform has issued a broken event.
Definition WsfSixDOF_Mover.hpp:883
virtual double GetNormalizedSpeedBrake() const
Definition WsfSixDOF_Mover.hpp:684
const std::string & GetName() const
Definition WsfSixDOF_Mover.hpp:1532
double mFMM_Time
Information captured at time of 'first missile motion' (needed by trajectory output).
Definition WsfSixDOF_Mover.hpp:1749
PilotObject * GetActivePilotObject() const
Definition WsfSixDOF_Mover.cpp:1221
virtual void UpdateFlightControls(int64_t aSimTime_nanosec)=0
const WsfRoute * GetRoute() const override
Definition WsfSixDOF_Mover.hpp:423
virtual void CalculateAlphaAtSpecifiedGLoad_deg(double aMach, double &aAlpha_deg) const =0
UtVec3dX mSeparationOmega_rps
Definition WsfSixDOF_Mover.hpp:1817
virtual void PerformCrash(int64_t aSimTime_nanosec)
Definition WsfSixDOF_Mover.cpp:1464
double GetYawRate_dps() const
Definition WsfSixDOF_Mover.hpp:1147
bool mValidInitialSpeed_NED
Definition WsfSixDOF_Mover.hpp:1778
int64_t mLifeTime_nanosec
Definition WsfSixDOF_Mover.hpp:1808
double mBingoFuel_lbs
Definition WsfSixDOF_Mover.hpp:1792
friend class TypeManager
Definition WsfSixDOF_Mover.hpp:59
bool AnEngineIsSmoking() const
Definition WsfSixDOF_Mover.cpp:2854
virtual double GetNormalizedLandingGearMainRight() const
Definition WsfSixDOF_Mover.hpp:688
Definition WsfSixDOF_PilotManager.hpp:34
Definition WsfSixDOF_PilotObject.hpp:39
Definition WsfSixDOF_PropulsionSystem.hpp:35
Definition WsfSixDOF_Route.hpp:32
Definition WsfSixDOF_Sequencer.hpp:32
Definition WsfSixDOF_SizeFactor.hpp:28
Definition WsfSixDOF_ThrustProducerObject.hpp:35
TurnDirection
Turn direction for TurnToHeading and TurnToRelativeHeading.
Definition WsfPath.hpp:88
Mode
Definition WsfSixDOF_VehicleData.hpp:196
Mode
Definition WsfSixDOF_VehicleData.hpp:232
Mode
Definition WsfSixDOF_VehicleData.hpp:213
WSF_SIX_DOF_EXPORT int64_t TimeToTime(double aSimTime_sec)
Definition WsfSixDOF_Utils.cpp:41
Definition WsfSA_Processor.hpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Definition WsfSixDOF_VehicleData.hpp:320
Copyrights Multiple, All Rights Reserved