VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleRotaryWingPilot.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
15 #include <matrix/vlDcm.h>
16 #include <matrix/vlVector.h>
18 
19 class DtString;
20 class DtSimManager;
22 class Coordinate_System;
23 class DtVectorInputPort;
24 
36 {
37 public:
38 
41  DtSimpleRotaryWingPilot(const DtString& name,
42  DtVrfObject* owner,
43  DtSimManager* simManager,
44  DtComponentDescriptor* desc = 0,
45  DtReaderWriterRegistry* parentRegistry = 0);
46 
48  virtual ~DtSimpleRotaryWingPilot();
49 
52  virtual bool init();
53 
54  virtual bool createPorts();
55 
58  virtual const char* type() const;
59 
61  virtual void tick();
62 
66  static DtSimComponent * creator(const DtString& name,
67  DtVrfObject* owner,
68  DtSimManager* simManager,
69  DtComponentDescriptor* desc = 0,
70  DtReaderWriterRegistry* parentRegistry = 0);
71 
72  virtual bool taskVisualizationsActive() const;
73  virtual void updateTaskVisualizations();
74 
75 private:
78 
81 
84 
85 protected:
98  virtual void computeDesiredLinearAccel(DtVector& desiredHorizBodyAccel,
99  double& desiredYawAccel);
100 
111  virtual void computeDesiredTopoAccelToPosition(const double maxAccel, const double period,
112  DtVector& desiredTopoAccel, double& yawAccel);
113 
119  virtual void computeDesiredTopoAccelToVelocity(const DtVector& desiredVel, const double period,
120  DtVector& desiredTopoAccel);
121 
129  virtual double desiredHeadingWithNoMoveGoal();
130 
133  virtual void computeDesiredTopoAccelToHeading(const double desiredHeading, const double desiredSpeed,
134  const double period, DtVector& desiredTopoAccel);
135 
137 
139  virtual void checkLandNoFuel();
140 
149  virtual void findEarthCurveDeltaPosition(DtVector fromPosition,
150  DtVector toPosition, DtVector& deltaPosition,
151  Coordinate_System* coordinateSystem);
152 
156  virtual void limitAccelFromMaxForwardSpeed(const DtVector& topoVelocity,
157  const double speedAtGoal,
158  const double period,
159  DtVector& desiredTopoAccel);
160 
170  //virtual double limitAccelFromMaxAcceleration(const double desiredAccel);
171 
177  virtual void limitAccelFromMaxAcceleration(DtVector& horizBodyAccel);
178 
183  virtual void computeTopoDeltaPosition(DtVector& topoDeltaPosition);
184 
188  virtual void computeTopoDesiredEndVelocity(const DtVector& topoXyDeltaPos,
189  DtVector& topoXyEndDirection,
190  double& topoXyEndSpeed);
191 
198  virtual void computeAccelerationTowardGoal(const DtVector& topoCurrentXyVel,
199  const DtVector& topoVelDirAtGoalPt, const double horizDesSpeedAtGoal,
200  const DtVector& topoHorizDeltaPos, const double period,
201  double& maxAccelTowardGoal);
202 
207  virtual void limitAccelForFixedFlightSlope(DtVector& topoDeltaPos,
208  DtVector&topoCurrentXyVel, double& maxAccel);
209 
213  virtual void computeAccelerationPerpendicularToGoal(const DtVector& topoCurrentXyVel,
214  const DtVector& topoVelDirAtGoalPt,
215  const DtVector& horizDeltaPos, const double maxAccel, const double delayTime,
216  double& maxAccelTowardGoal);
217 
225  virtual void computeVerticalAcceleration(const DtVector& topoDeltaPos,
226  const double downSpeed,
227  const double period,
228  double& desiredZAccel);
229 
243  virtual double accelFromConstraintsAvoidingOvershoot(
244  const double maxDecel, const double maxAccel, const double period, double speed,
245  double targetDist, const double speedAtTarget);
246 
251  virtual bool isCloseToGoalPosition(const DtVector& topoDeltaPos);
253 
264  virtual void setCollectiveAndCyclicFromAccel(const DtVector& desiredAcceleration);
265 
266  virtual void setPedalFromDesiredYawAcceleration(const double yawAccel);
267 
269  virtual void setThrottle();
270 
272 
275  virtual DtReal terrainAvoidanceVelocity() const;
276 
281  virtual void calculateTargetAlignmentAngle(DtReal& alignmentAngle) const;
282 
285  virtual void computeYawAccelerationToHeading(const double headingToPoint,
286  const double period,
287  double& yawAccel);
288 
290  virtual void getTransformationMatrices();
291 
294 
302  virtual double stationaryGoalSpeedThreshold(){ return 0.5; }
303 
308  virtual double catchUpSpeedFactor(){ return 1.5; }
309 
310  protected:
312 
313  DtVectorInputPort* myTargetLocationInputPort;
320 
323 
325  DtDcm myBodyToRef;
326 
329 
332 
335 
336 public:
337 
341  static DtReal xyDistSquared(DtVector a, DtVector b);
342 
343 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtRotaryWingPilotDescriptor * myPilotDescriptor
A pointer to the descriptor for this controller.
Definition: simpleRotaryWingPilot.h:322
virtual bool taskVisualizationsActive() const
Returns true if task visualizations are currently active for this component.
virtual void tick()
Reads the data from the guidance ports into the state repository.
DtDcm myBodyToRef
The local orientation matrix.
Definition: simpleRotaryWingPilot.h:325
virtual double stationaryGoalSpeedThreshold()
! Constants
Definition: simpleRotaryWingPilot.h:302
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
DtRotaryWingPilotDescriptor is a component descriptor for helicopter flight involving destination poi...
Definition: rotaryWingPilotDescriptor.h:25
DtSimpleRotaryWingPilot is a controller that represents the autopilot aspects of a rotary-wing pilot...
Definition: simpleRotaryWingPilot.h:35
Definition: readerWriterRegistry.h:39
const DtRotaryWingPilotController & operator=(const DtRotaryWingPilotController &orig)
assignment operator; not implemented
virtual bool createPorts()
Overridden to create rotary wing ports.
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:485
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition: coordSystem.h:54
virtual bool init()
Overridden to initialize myRotaryWingEntityState.
DtDcm myTopoToBodyHeadingDcm
The 2D rotation about the yaw axis only.
Definition: simpleRotaryWingPilot.h:334
DtDcm myLocalToTopoDcm
The local to topographic coordinate transformation matrix.
Definition: simpleRotaryWingPilot.h:328
virtual double catchUpSpeedFactor()
When moving toward a moving goal, how much faster than the goal&#39;s speed the entity is allowed to move...
Definition: simpleRotaryWingPilot.h:308
DtDcm myTopoToLocalDcm
The topographic to local coordinate transformation matrix.
Definition: simpleRotaryWingPilot.h:331
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
virtual const char * type() const
Returns a string identifies the class type of component.
The DtRotaryWingPilotController class creates the rotary-wing-control port group needed to control ro...
Definition: rotaryWingPilotController.h:37
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)