WSF
WsfBrawlerMover.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFBRAWLERMOVER_HPP
13#define WSFBRAWLERMOVER_HPP
14
15#include "wsf_brawler_export.h"
16
17#include "BrawlerMover.hpp"
18
20class WsfDraw;
21#include "WsfFuel.hpp"
22#include "WsfMover.hpp"
23#include "WsfRoute.hpp"
24
25
30class WSF_BRAWLER_EXPORT WsfBrawlerMover : public WsfMover, public BrawlerMover
31{
32public:
33 WsfBrawlerMover(WsfScenario& aScenario);
35 ~WsfBrawlerMover() override;
36
39 WsfMover* Clone() const override;
40
41 void SwapMoverInitiated(double aSimTime, WsfMover* aOldMoverPtr) override;
42 bool Initialize(double aSimTime) override;
43 bool ProcessInput(UtInput& aInput) override;
44 void Update(double aSimTime) override;
45 WsfSpatialDomain GetSpatialDomain() const override;
46
47 void TurnOn(double aSimTime) override;
48
49 void DeleteMover() override;
50
51 void UpdateFuel(double aTimeStep, double aInitialFlow, double aThrottle, double& aFuelQuantity, double& aVehicleMass) override;
52
53 const char* GetScriptClassName() const override { return "WsfBrawlerMover"; }
54
55
60
62 bool FlyRates(const UtVec3d& aAngularRates, // radians/sec
63 const UtVec3d& aLongitudinalAccel) override; // meters/sec^2
64
65 bool FlyHeadingSpeedAltitude(double aHeading, // deg
66 double aSpeed, // meters/sec
67 double aAltitude, // meters
68 double aMaxGees, // meters/sec^2
69 double aMaxClimb) override; // meters/sec
70
71 bool TurnInPlaneWithSpeed(const UtVec3d& aPlane, // world coordinates (not body coordinates), meters
72 double aGees, // meters/sec^2
73 double aSpeed) override; // meters/sec
74
75 bool TurnInPlaneWithThrottle(const UtVec3d& aPlane, // world coordinates (not body coordinates)
76 double aGees, // meters/sec^2
77 double aThrottle) override; //[0-3]
78
79 bool FlyVectorWithSpeed(const UtVec3d& aVelocityVector, // world coordinates (not body coordinates) (magnitude does
80 // not matter, just direction)
81 double aMaxGees, // meters/sec^2
82 double aSpeed) override; // meters/sec
83
84 bool FlyVectorWithThrottle(const UtVec3d& aVelocityVector, // world coordinates (not body coordinates) (magnitude
85 // does not matter, just direction)
86 double aMaxGees, // meters/sec^2
87 double aThrottle) override; //[0-3]
89
94 bool ProjectForward(double delta, UtEntity& projected);
95
97 // WsfMover virtual methods
102
104 const WsfRoute* GetRoute() const override { return &mRoute; }
105
106 int RoutePointIndex() const override { return mCurrentRouteIndex; }
107
108 bool GoToLocation(double aSimTime, double aLatitude, double aLongitude, double aAltitude) override;
109
110 bool TurnToHeading(double aSimTime,
111 double aHeading, // radians
112 double aRadialAccel, // meters/second^2
113 WsfPath::TurnDirection aTurnDirection) override;
114
115 bool GoToSpeed(double aSimTime,
116 double aSpeed, // meters/sec
117 double aLinearAccel,
118 bool aKeepRoute) override;
119
120 bool GoToAltitude(double aSimTime,
121 double aAltitude, // meters
122 double aClimbDiveRate,
123 bool aKeepRoute) override;
124
125 bool TurnToRelativeHeading(double aSimTime,
126 double aHeadingChange,
127 double aRadialAccel,
128 WsfPath::TurnDirection aTurnDirection) override;
129
130 // support route control
131 bool ReturnToRoute(double aSimTime) override;
132 // FollowRoute_1: FollowRoute(WsfRoute aRoute);
133 // FollowRoute_2: FollowRoute(WsfRoute aRoute, string aRouteAction);
134 // FollowRoute_3: FollowRoute(string aRouteName);
135 // FollowRoute_4: FollowRoute(string aRouteName, string aRouteAction);
136 // FollowRoute_5: FollowRoute(WsfRoute aRoute, int aIndex);
137 // FollowRoute_6: FollowRoute(string aRouteName, int aIndex);
138 // implementing UpdateRoute() will enable FollowRoute_1 & FollowRoute_3
139 bool UpdateRoute(double aSimTime, const WsfRoute& aRoute) override;
140 // also implementing GoToClosestPoint() & GoToLabel() will enable FollowRoute_2 & FollowRoute_4
141 bool GoToClosestPoint(double aSimTime) override;
142 bool GoToLabel(double aSimTime, WsfStringId aLabelId) override;
143 // also implementing GoToWaypoint() will enable FollowRoute_5 & FollowRoute_6
144 bool GoToWaypoint(double aSimTime, unsigned int aDestination) override;
145 // bool SetRoute(double aSimTime,
146 // const WsfRoute& aRoute) override;
147
148 // Return the brawler computed throttle position
149 double GetThrottlePosition() override;
150
151 bool Slice(double aDesiredHeading, double aDesiredAltitude, double aDesiredMach);
152
153 bool Prlvl(double aDesiredHeading, double aDesiredMach);
154
155 bool Prlvlg(double aDesiredHeading, double aDesiredMach, double aDesiredgees);
156
157 void SetMaxThrottle(double aThrottle);
158
160
161
162
163protected:
164 // calculates how much excess power to use for climb rate compared to what to use for acceleration
165 // returns the appropriate "max climb rate", favors achieving speed first over climb
166 double ReasonableClimbRate(double desiredSpeed);
167
169 WsfBrawlerMover(const WsfBrawlerMover& aSrc);
170
174
176
180};
181
182#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
WsfSpatialDomain
A collection of enumerations and type definitions that are used across a number of components.
Definition WsfTypes.hpp:32
virtual void UpdateFuel(double aTimeStep, double aInitialFlow, double aThrottle, double &aFuelQuantity, double &aVehicleMass)
Definition BrawlerMover.cpp:574
BrawlerMover(const BrawlerMover &aSrc)
Definition BrawlerMover.cpp:232
virtual void DeleteMover()=0
void SetMaxThrottle(double aThrottle)
Definition BrawlerMover.cpp:8303
Definition WsfBrawlerMover.hpp:31
const char * GetScriptClassName() const override
Definition WsfBrawlerMover.hpp:53
WsfDraw * mDrawPtr
Pointer to a wsfDraw object to allow drawing of projection.
Definition WsfBrawlerMover.hpp:172
int RoutePointIndex() const override
Definition WsfBrawlerMover.hpp:106
const WsfRoute * GetRoute() const override
Definition WsfBrawlerMover.hpp:104
bool mDrawProjection
Flag indicating if visual aid of projection should be drawn.
Definition WsfBrawlerMover.hpp:171
UtEntity mDebugEntityProjection
A UtEntity for storing projection state.
Definition WsfBrawlerMover.hpp:173
int mCurrentRouteIndex
Index of the current spot in the route.
Definition WsfBrawlerMover.hpp:179
WsfBrawlerMover & operator=(const WsfBrawlerMover &)=delete
WsfBrawlerMover(WsfScenario &aScenario)
Definition WsfBrawlerMover.cpp:26
WsfFuel * mFuelPtr
Pointer to a fuel object on the platform.
Definition WsfBrawlerMover.hpp:175
WsfRoute mRoute
The route the mover will follow.
Definition WsfBrawlerMover.hpp:177
bool mFlyingRoute
Flag indicating the mover is following its defined route.
Definition WsfBrawlerMover.hpp:178
Definition WsfBrawlerProcessor.hpp:40
Provides the capability to draw shapes into the WSF replay file.
Definition WsfDraw.hpp:35
Definition WsfFuel.hpp:30
virtual bool FlyVectorWithSpeed(const UtVec3d &aVelocityVector, double aMaxGees, double aSpeed)
Definition WsfMover.hpp:201
virtual bool GoToLabel(double aSimTime, WsfStringId aLabelId)
Definition WsfMover.cpp:414
bool ProcessInput(UtInput &aInput) override
Definition WsfMover.cpp:138
virtual bool TurnToHeading(double aSimTime, double aHeading, double aRadialAccel, WsfPath::TurnDirection aTurnDirection)
Definition WsfMover.cpp:454
bool Initialize(double aSimTime) override
Definition WsfMover.cpp:108
virtual bool FlyHeadingSpeedAltitude(double aHeading, double aSpeed, double aAltitude, double aMaxGees, double aMaxClimb)
Definition WsfMover.hpp:178
virtual bool ReturnToRoute(double aSimTime)
Definition WsfMover.cpp:393
virtual WsfSpatialDomain GetSpatialDomain() const
Definition WsfMover.cpp:339
virtual bool GoToAltitude(double aSimTime, double aAltitude, double aClimbDiveRate, bool aKeepRoute)
Definition WsfMover.cpp:383
WsfMover * Clone() const override=0
virtual bool GoToSpeed(double aSimTime, double aSpeed, double aLinearAccel, bool aKeepRoute)
Definition WsfMover.cpp:441
virtual bool TurnInPlaneWithThrottle(const UtVec3d &aPlane, double aGees, double aThrottle)
Definition WsfMover.hpp:194
virtual bool GoToClosestPoint(double aSimTime)
Definition WsfMover.cpp:403
WsfMover()=delete
virtual bool FlyVectorWithThrottle(const UtVec3d &aVelocityVector, double aMaxGees, double aThrottle)
Definition WsfMover.hpp:209
virtual bool GoToWaypoint(double aSimTime, unsigned int aDestination)
Definition WsfMover.cpp:512
virtual bool TurnInPlaneWithSpeed(const UtVec3d &aPlane, double aGees, double aSpeed)
Definition WsfMover.hpp:187
virtual bool GoToLocation(double aSimTime, double aLatitude, double aLongitude, double aAltitude)
Definition WsfMover.cpp:428
virtual bool TurnToRelativeHeading(double aSimTime, double aHeadingChange, double aRadialAccel, WsfPath::TurnDirection aTurnDirection)
Definition WsfMover.cpp:467
virtual bool FlyRates(const UtVec3d &aAngularRates, const UtVec3d &aLongitudinalAccel)
Definition WsfMover.hpp:172
void TurnOn(double aSimTime) override
Definition WsfMover.cpp:255
void Update(double aSimTime) override
Definition WsfMover.cpp:310
virtual bool UpdateRoute(double aSimTime, const WsfRoute &aRoute)
Definition WsfMover.cpp:492
virtual double GetThrottlePosition()
Definition WsfMover.hpp:267
virtual void SwapMoverInitiated(double aSimTime, WsfMover *aOldMoverPtr)
Definition WsfMover.cpp:99
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
TurnDirection
Turn direction for TurnToHeading and TurnToRelativeHeading.
Definition WsfPath.hpp:88
Copyrights Multiple, All Rights Reserved