VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fixedWingFollowEntityController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2003 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 #pragma once
12 
13 
15 
16 #include <vlutil/vlString.h>
17 #include <matrix/vlVector.h>
18 
20 class DtSimMessage;
21 class DtLocalObject;
22 
33 {
34 
35 public:
36 
40  DtLocalObject* owner,
41  DtSimulationServices* simManager,
42  DtComponentDescriptor* desc = 0,
43  DtReaderWriterRegistry* parentRegistry = 0);
45  virtual ~DtFixedWingFollowEntityController() override;
46 
49  virtual const char* type() const override;
50 
54  virtual void tick() override;
55 
57  virtual void doMoving() override;
58  virtual void doFlying() override;
59  virtual void doTaxiing() override;
60 
64  static void followEntityCallback(DtSimMessage * msg, void * usrData);
65  virtual void processFollowEntityTask(DtSimMessage * msg);
66 
67  virtual DtUUID entityToFollow() const;
68  virtual void setEntityToFollow(const DtUUID& entity);
69 
70  virtual const DtVector& offsetVector() const;
71  virtual void setOffsetVector(const DtVector& offsets);
72 
76  static DtSimComponent * creator(const DtString& name,
77  DtLocalObject* owner,
78  DtSimulationServices* simManager,
79  DtComponentDescriptor* desc = 0,
80  DtReaderWriterRegistry* parentRegistry = 0);
81 
82 protected:
86 
89  orig);
90 
94 
96  virtual void registerTaskMsgCallbacks() override;
97 
102  virtual bool setupControlPoint() override;
103 
117  virtual bool getCurrentLeaderState(DtVector& localPosition,
118  DtVector& localVelocity, DtTaitBryan& topoOrientation,
119  DtVector& topoRotationRate);
120 
122  virtual double findDesiredFlyingSpeed(
123  const double leaderSpeed,
124  const double forwardPositionError);
125 
131  virtual double flyingControlSpeed(double targetSpeed,
132  double targetDistance);
133 
142  virtual double calculateControlClimbRate(double altitudeDiff,
143  DtVector& topoEntityCurrentVelocity,
144  DtVector& topoNextTickVelocity,
145  double dt);
146 
151  virtual double turnRateToFollowLine(double estimatedTurnRadius,
152  DtVector& topoEntityToGoal, DtVector topoGoalHorizDirection,
153  DtVector topoEntityVelocity,
154  double dt);
155 
159  DtVector predictedMove(const DtVector& vInitial,
160  const DtVector& vFinal, double dt);
161 
163  virtual double findDesiredSpeed() override;
164 
165  virtual double lastHeadingError() const;
166  virtual void setLastHeadingError(const double error);
167 
170  virtual double integratedHorizontalError() const;
171  virtual void setIntegratedHorizontalError(const double error);
174  virtual void updateIntegratedHorizontalError(const double currentError,
175  const double dt, const double decayRate);
177 
178  virtual void updateTaskVisualizations() override;
179 
180 protected:
181 
185 
190  double myStationSpeed;
194 
197 
201 
204 
208  std::vector<DtVector> myVisLine;
209 
211  {
217  nearLineRegion
218  };
219  enum approachRegion myApproachState;
221 
225 };
226 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVector myStationLocalVelocity
Calculations saved for the duration of a tick.
Definition: fixedWingFollowEntityController.h:189
DtFixedWingFollowEntityController is a controller that models follow behavior for fixed-wing entities...
Definition: fixedWingFollowEntityController.h:32
Definition: fixedWingFollowEntityController.h:214
Definition: fixedWingFollowEntityController.h:213
DtFixedWingMoveToController & operator=(const DtFixedWingMoveToController &orig)
assignment operator
virtual void doTaxiing()
Determines if the entity is near its goal. If it is, it sets the finishing flag to true...
DtVector myStationLocalPosition
Calculations saved for the duration of a tick.
Definition: fixedWingFollowEntityController.h:188
double myIntegratedHorizontalError
Accumulated horizontal offset error, decayed over time, for integral control.
Definition: fixedWingFollowEntityController.h:200
virtual void tick() override
Calculate new control values. If myWaitingToSetMovementStatus is set in myProcessState, then setMovementStatusFromRoute is called to see if the required terrain data is now available.
std::vector< DtVector > myVisLine
Temporary variables (updated each tick) that support task visualization.
Definition: fixedWingFollowEntityController.h:208
DtSimObjectReference myEntityPointer
Set fresh each frame by setupControlPoint.
Definition: fixedWingFollowEntityController.h:183
double myLastAltitudeError
Definition: fixedWingFollowEntityController.h:224
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
double myStationSpeed
Calculations saved for the duration of a tick.
Definition: fixedWingFollowEntityController.h:190
Definition: readerWriterRegistry.h:39
Definition: fixedWingFollowEntityController.h:215
DtMovementSimObjectFacade myEntityPointerMovementSimObjectFacade
Definition: fixedWingFollowEntityController.h:184
double myLastHeadingError
Error from last tick, for derivative control.
Definition: fixedWingFollowEntityController.h:196
bool myGaveLeaderStateWarning
Remember if a warning was given about the leader state.
Definition: fixedWingFollowEntityController.h:203
DtTaitBryan myStationTopoOrientation
From velocity.
Definition: fixedWingFollowEntityController.h:191
File: simMsg.h.
Definition: simMessage.h:35
double myLastDistanceToLine
Past error state for use in the derivative part of PD controllers.
Definition: fixedWingFollowEntityController.h:223
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
Definition: asyncJobServer.h:39
virtual double findDesiredSpeed()
This function returns the appropriate speed for the movement status of the FWE. The desired speed can...
virtual void doFlying()
Determines if the entity is five seconds or fewer away from being at the waypoint using the entity’s s...
DtFixedWingMoveToController is a controller used to model the movement of a fixed wing entity to a sp...
Definition: fixedWingMoveToController.h:28
approachRegion
Temporary variables (updated each tick) that support task visualization.
Definition: fixedWingFollowEntityController.h:210
Definition: fixedWingFollowEntityController.h:212
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
DtVector myStationTopoRotationRate
Calculations saved for the duration of a tick.
Definition: fixedWingFollowEntityController.h:192
virtual void doMoving()
Determines what state the entity is currently in and then calls the appropriate doMoving function for...
virtual void updateTaskVisualizations() override
update visualizations
virtual bool setupControlPoint()
Sets up initial information for where the fixed wing wants to move to. Must call setMovementStatusFro...
virtual void registerTaskMsgCallbacks() override
Overrides this so it can register its interest in MoveTo commands and all other messages described in...
Definition: fixedWingFollowEntityController.h:216
A locally simulated VRF object.
Definition: localObject.h:98

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