VR-Forces Developer's Guide
 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;
22 class Coordinate_System;
23 class DtVectorInputPort;
25 
37 {
38 public:
39 
42  DtSimpleRotaryWingPilot(const DtString& name,
43  DtLocalObject* owner,
44  DtSimulationServices* simManager,
45  DtComponentDescriptor* desc = 0,
46  DtReaderWriterRegistry* parentRegistry = 0);
47 
49  virtual ~DtSimpleRotaryWingPilot();
50 
53  virtual bool init();
54 
55  virtual bool createPorts();
56 
59  virtual const char* type() const;
60 
62  virtual void tick();
63 
67  static DtSimComponent * creator(const DtString& name,
68  DtLocalObject* owner,
69  DtSimulationServices* simManager,
70  DtComponentDescriptor* desc = 0,
71  DtReaderWriterRegistry* parentRegistry = 0);
72 
73  virtual bool taskVisualizationsActive() const;
74  virtual void updateTaskVisualizations();
75 
76 private:
79 
82 
85 
86 protected:
99  virtual void computeDesiredLinearAccel(DtVector& desiredHorizBodyAccel,
100  double& desiredYawAccel);
101 
112  virtual void computeDesiredTopoAccelToPosition(const double maxAccel, const double period,
113  DtVector& desiredTopoAccel, double& yawAccel);
114 
120  virtual void computeDesiredTopoAccelToVelocity(const DtVector& desiredVel, const double period,
121  DtVector& desiredTopoAccel);
122 
130  virtual double desiredHeadingWithNoMoveGoal();
131 
134  virtual void computeDesiredTopoAccelToHeading(const double desiredHeading, const double desiredSpeed,
135  const double period, DtVector& desiredTopoAccel);
136 
138 
140  virtual void checkLandNoFuel();
141 
150  virtual void findEarthCurveDeltaPosition(DtVector fromPosition,
151  DtVector toPosition, DtVector& deltaPosition,
152  const Coordinate_System* coordinateSystem);
153 
157  virtual void limitAccelFromMaxForwardSpeed(const DtVector& topoVelocity,
158  const DtVector& entityToGoal,
159  const double speedAtGoal,
160  const double distToGoal,
161  const double period,
162  DtVector& desiredTopoAccel);
163 
164  virtual void limitAccelForGoalDistanceAndVelocity(
165  const DtVector& goalVelocity, const DtVector& horizBodyEntToGoal,
166  const DtVector& horizBodyCurrVelocity, const double period,
167  DtVector& desiredAccel);
168 
169 
179  //virtual double limitAccelFromMaxAcceleration(const double desiredAccel);
180 
186  virtual void limitAccelFromMaxAcceleration(DtVector& horizBodyAccel);
187 
192  virtual void computeTopoDeltaPosition(DtVector& topoDeltaPosition);
193 
197  virtual void computeTopoDesiredEndVelocity(const DtVector& topoXyDeltaPos,
198  DtVector& topoXyEndDirection,
199  double& topoXyEndSpeed);
200 
205  virtual double limitedVerticalControlAcceleration(const double verticalControlAccel,
206  const double verticalError, const double currentVerticalVelocity, const double period);
207 
212  virtual bool isCloseToGoalPosition(const DtVector& topoDeltaPos);
213 
215 
226  virtual void setCollectiveAndCyclicFromAccel(const DtVector& desiredAcceleration);
227 
228  virtual void setPedalFromDesiredYawAcceleration(const double yawAccel);
229 
231  virtual void setThrottle();
232 
234 
239  DtVector& topoCurrentVel, double period, DtVector& desiredTopoAccel);
240 
243  virtual DtReal terrainAvoidanceVelocity() const;
244 
251  virtual void calculateTargetAlignmentAngle(DtReal& headingToTarget) const;
252 
255  virtual void computeYawAccelerationToHeading(const double headingToPoint,
256  const double period,
257  double& yawAccel);
258 
260  virtual void getTransformationMatrices();
261 
264  virtual void clearControlState();
265 
268 
276  virtual double stationaryGoalSpeedThreshold(){ return 0.5; }
277 
282  virtual double catchUpSpeedFactor(){ return 1.5; }
283 
284  virtual void lookupAndCacheProcessSR();
285 
286  virtual bool postAddComponentsInit() override;
287 
288  protected:
290 
291  DtVectorInputPort* myTargetLocationInputPort;
298 
301 
303  DtDcm myBodyToRef;
304 
307 
310 
313 
315 
319 
322 
323 
324 public:
325 
329  static DtReal xyDistSquared(DtVector a, DtVector b);
330 
331 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
DtRotaryWingPilotDescriptor * myPilotDescriptor
A pointer to the descriptor for this controller.
Definition: simpleRotaryWingPilot.h:300
virtual bool taskVisualizationsActive() const
Returns true if task visualizations are currently active for this component. Default behavior is to r...
void limitAccelForFixedFlightSlope(DtVector &topoEntToGoal, DtVector &topoCurrentVel, double period, DtVector &desiredTopoAccel)
Limit the acceleration in the Z direction so that the Z speed is a proportion of the horizontal speed...
virtual void tick()
Reads the data from the guidance ports into the state repository.
DtVector myLastIntegralDistError
Definition: simpleRotaryWingPilot.h:318
DtDcm myBodyToRef
The local orientation matrix.
Definition: simpleRotaryWingPilot.h:303
virtual double stationaryGoalSpeedThreshold()
Constants.
Definition: simpleRotaryWingPilot.h:276
Definition: rotaryWingFlightPSR.h:30
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
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:36
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. Implemented by subclasses. ...
Definition: simComponent.h:437
Definition: coordSystem.h:54
virtual bool init()
Overridden to initialize myRotaryWingEntityState.
DtDcm myTopoToBodyHeadingDcm
The 2D rotation about the yaw axis only.
Definition: simpleRotaryWingPilot.h:312
DtRotaryWingFlightPSR * myProcessState
Definition: simpleRotaryWingPilot.h:314
DtVector myLastDistError
PID state variables. In topo coordinates.
Definition: simpleRotaryWingPilot.h:317
DtDcm myLocalToTopoDcm
The local to topographic coordinate transformation matrix.
Definition: simpleRotaryWingPilot.h:306
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:282
DtDcm myTopoToLocalDcm
The topographic to local coordinate transformation matrix.
Definition: simpleRotaryWingPilot.h:309
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:95
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
The DtRotaryWingPilotController class creates the rotary-wing-control port group needed to control ro...
Definition: rotaryWingPilotController.h:38
double myLastYawError
D state variable for yaw control.
Definition: simpleRotaryWingPilot.h:321
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)