![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1999 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: gndAutoCntlr.h,v $ $Revision: 1.44 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00014 00015 #ifndef DtGroundAutoControllerComponent_H_ 00016 #define DtGroundAutoControllerComponent_H_ 00017 00018 #include "vrfobjcore/singleTaskControllerComponent.h" 00019 00020 class DtString; 00021 class DtSimManager; 00022 class DtGroundVehicleStateRepository; 00023 class DtTaskMessage; 00024 class DtSoilFactors; 00025 class DtAutomotivePSR; 00026 class DtConstrainedAnalogOutputPort; 00027 class DtConstrainedIntegerOutputPort; 00028 class DtBooleanOutputPort; 00029 00037 #include "vrfmodel/vrfmodelDefines.h" 00038 class DT_DLL_vrfmodel DtGroundAutoControllerComponent : public DtSingleTaskControllerComponent 00039 { 00040 public: 00041 00044 DtGroundAutoControllerComponent(const DtString& name, 00045 DtVrfObject* owner, 00046 DtSimManager* simManager, 00047 DtComponentDescriptor* desc = 0, 00048 DtReaderWriterRegistry* parentRegistry = 0); 00049 00051 virtual ~DtGroundAutoControllerComponent(); 00052 00054 virtual bool init(); 00055 00058 virtual DtString type() const; 00059 00062 virtual void clearTask(); 00063 00066 virtual double approximateThrottle(double speed); 00067 virtual double calculateSteering(double currentHeading, double 00068 desiredHeading) const; 00069 virtual double calculateCurrentBrakingDistance() const; 00070 00073 virtual bool createAutomotiveControlPortGroup(); 00074 virtual bool createThrottlePort(); 00075 virtual bool createSteeringPort(); 00076 virtual bool createBrakePort(); 00077 virtual bool createGearPort(); 00078 virtual bool createParkingBrakePort(); 00079 00080 virtual DtConstrainedAnalogOutputPort * throttlePort(); 00081 virtual DtConstrainedAnalogOutputPort * steeringPort(); 00082 virtual DtConstrainedAnalogOutputPort * brakePort(); 00083 virtual DtConstrainedIntegerOutputPort * gearPort(); 00084 virtual DtBooleanOutputPort * parkingBrakePort(); 00085 00086 virtual double decelerationSoilFactor() const; 00087 00093 virtual double calcSteeringForTurnInPlace(); 00094 00098 virtual double calcThrottleForTurnInPlace(); 00099 00102 virtual double calcBrakeForTurnInPlace(); 00103 00111 virtual int calcGearForTurnInPlace(); 00112 00116 virtual double calcSteeringForPivot(); 00117 00121 virtual double calcThrottleForPivot(); 00122 00126 virtual double calcSteeringForKTurn(); 00127 00131 virtual double calcThrottleForKTurn(); 00132 00136 virtual double calcBrakeForKTurn(); 00137 00143 virtual double findSpeedForKTurn(); 00144 00148 virtual double findHeadingForKTurn(); 00149 00151 virtual void setHeadingToTurnTo(double headingToTurnTo); 00152 virtual double headingToTurnTo() const; 00153 00157 virtual void setKTurnReverseGoalHeading(double kTurnReverseGoalHeading); 00158 virtual double kTurnReverseGoalHeading() const; 00159 00163 virtual void setKTurnReverseComplete(bool kTurnReverseComplete); 00164 virtual bool kTurnReverseComplete() const; 00165 00166 protected: 00168 virtual bool createPorts(); 00169 00171 virtual bool createPortGroups(); 00172 00180 virtual void lookupAndCacheProcessSR(); 00181 00184 virtual bool postAddComponentsInit(); 00185 00186 virtual DtSoilFactors * currentSoilFactors() const; 00187 00190 virtual bool decideToGiveUpTask() const; 00191 00192 private: 00193 00195 DtGroundAutoControllerComponent(); 00196 00198 DtGroundAutoControllerComponent(const DtGroundAutoControllerComponent & 00199 orig); 00200 00202 const DtGroundAutoControllerComponent & operator=(const 00203 DtGroundAutoControllerComponent & orig); 00204 00205 00206 protected: 00207 00208 DtGroundVehicleStateRepository * myGroundVehicleState; 00209 00212 00218 DtConstrainedAnalogOutputPort * myThrottlePort; 00219 00225 DtConstrainedAnalogOutputPort * mySteeringPort; 00226 00232 DtConstrainedAnalogOutputPort * myBrakePort; 00233 00239 DtConstrainedIntegerOutputPort * myGearPort; 00240 00245 DtBooleanOutputPort * myParkingBrakePort; 00246 00250 DtOutputPortGroup* myAutomotiveControlPortGroup; 00251 00253 00259 DtAutomotivePSR* myProcessState; 00260 }; 00261 #endif 00262 00263 00264