VR-Forces 4.10 Class Documentation
 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 
19 class DtSimManager;
20 class DtSimMessage;
21 
22 
33 {
34 
35 public:
36 
40  DtVrfObject* owner,
41  DtSimManager* simManager,
42  DtComponentDescriptor* desc = 0,
43  DtReaderWriterRegistry* parentRegistry = 0);
46 
49  virtual const char* type() const;
50 
54  virtual void tick();
55 
57  virtual void doMoving();
58  virtual void doFlying();
59  virtual void doTaxiing();
60 
64  static void followEntityCallback(DtSimMessage * msg, void * usrData);
65  virtual void processFollowEntityTask(DtSimMessage * msg);
66 
67  virtual const 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  DtVrfObject* owner,
78  DtSimManager* simManager,
79  DtComponentDescriptor* desc = 0,
80  DtReaderWriterRegistry* parentRegistry = 0);
81 
82 protected:
86 
89  orig);
90 
94 
96  virtual void registerTaskMsgCallbacks();
97 
102  virtual bool setupControlPoint();
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 
149  virtual double calculateControlTurnRate(
150  double desiredHeading, double distanceFromLine, double dt);
151 
160  virtual double calculateControlClimbRate(double altitudeDiff,
161  DtVector& topoEntityCurrentVelocity,
162  DtVector& topoNextTickVelocity,
163  double dt);
164 
184  virtual double desiredHeading(double estimatedTurnRadius,
185  DtVector& topoEntityToGoal,
186  DtVector& topoGoalHorizDirection,
187  DtVector& topoEntityVelocity, DtVector& topoNextVelocity,
188  double dt);
189 
193  DtVector predictedMove(const DtVector& vInitial,
194  const DtVector& vFinal, double dt);
195 
197  virtual double findDesiredSpeed();
198 
199  virtual double lastHeadingError() const;
200  virtual void setLastHeadingError(const double error);
201 
204  virtual double integratedHorizontalError() const;
205  virtual void setIntegratedHorizontalError(const double error);
208  virtual void updateIntegratedHorizontalError(const double currentError,
209  const double dt, const double decayRate);
211 
213 
214 protected:
215 
218 
221 
226  double myStationSpeed;
230 
233 
237 
240 
244  std::vector<DtVector> myVisLine;
246  {
252  nearLineRegion
253  };
254  enum approachRegion myApproachState;
256 };
257 
void updateTaskVisualizations()
update visualizations
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVector myStationLocalVelocity
Definition: fixedWingFollowEntityController.h:225
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtFixedWingFollowEntityController is a controller that models follow behavior for fixed-wing entities...
Definition: fixedWingFollowEntityController.h:32
virtual void tick()
Calculate new control values.
Definition: fixedWingFollowEntityController.h:249
Definition: fixedWingFollowEntityController.h:248
DtFixedWingMoveToController & operator=(const DtFixedWingMoveToController &orig)
assignment operator
virtual void doTaxiing()
Determines if the entity is near its goal.
DtVector myStationLocalPosition
Calculations saved for the duration of a tick.
Definition: fixedWingFollowEntityController.h:224
virtual void registerTaskMsgCallbacks()
Overrides this so it can register its interest in MoveTo commands and all other messages described in...
double myIntegratedHorizontalError
Accumulated horizontal offset error, decayed over time, for integral control.
Definition: fixedWingFollowEntityController.h:236
std::vector< DtVector > myVisLine
Temporary variables (updated each tick) that support task visualization.
Definition: fixedWingFollowEntityController.h:244
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *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:42
double myStationSpeed
Definition: fixedWingFollowEntityController.h:226
Definition: readerWriterRegistry.h:39
Definition: fixedWingFollowEntityController.h:250
double myLastHeadingError
Error from last tick, for derivative control.
Definition: fixedWingFollowEntityController.h:232
bool myGaveLeaderStateWarning
Remember if a warning was given about the leader state.
Definition: fixedWingFollowEntityController.h:239
DtTaitBryan myStationTopoOrientation
From velocity.
Definition: fixedWingFollowEntityController.h:227
File: simMsg.h.
Definition: simMessage.h:35
Definition: asyncJobServer.h:39
virtual double findDesiredSpeed()
This function returns the appropriate speed for the movement status of the FWE.
virtual void doFlying()
Determines if the entity is five seconds or fewer away from being at the waypoint using the entity’s s...
const DtVrfObject * myEntityPointer
Set fresh each frame by setupControlPoint.
Definition: fixedWingFollowEntityController.h:217
DtFixedWingMoveToController is a controller used to model the movement of a fixed wing entity to a sp...
Definition: fixedWingMoveToController.h:30
approachRegion
Definition: fixedWingFollowEntityController.h:245
Definition: fixedWingFollowEntityController.h:247
virtual const char * type() const
Returns a string identifies the class type of component.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtVector myStationTopoRotationRate
Definition: fixedWingFollowEntityController.h:228
virtual void doMoving()
Determines what state the entity is currently in and then calls the appropriate doMoving function for...
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
virtual bool setupControlPoint()
Sets up initial information for where the fixed wing wants to move to.
Definition: fixedWingFollowEntityController.h:251
DtVrfObject * myWorkingControlPoint
Locally allocated waypoint - we set myControlPoint to point to it.
Definition: fixedWingFollowEntityController.h:220

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)