VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
groundAutoControllerComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 #pragma once
12 
15 
16 class DtString;
19 class DtTaskMessage;
20 class DtSoilFactors;
21 class DtAutomotivePSR;
25 
35 {
36 public:
37 
41  DtLocalObject* owner,
42  DtSimulationServices* simManager,
43  DtComponentDescriptor* desc = 0,
44  DtReaderWriterRegistry* parentRegistry = 0);
45 
48 
50  virtual bool init();
51 
54  virtual const char* type() const;
55 
58  virtual void clearTask();
59 
76  virtual double computeSpeedForFastestTurn();
77 
97  virtual double approximateThrottle(double desiredSpeed, double headingError = 0.0);
98  virtual double headingErrorRequiringMinTurnRadius() { return 0.5; }
99 
108  virtual double calculateSteering(double currentHeading, double
109  desiredHeading) const;
110 
111 
112  virtual double calculateCurrentBrakingDistance() const;
113 
116  virtual bool createAutomotiveControlPortGroup();
117  virtual bool createThrottlePort();
118  virtual bool createSteeringPort();
119  virtual bool createBrakePort();
120  virtual bool createGearPort();
121  virtual bool createParkingBrakePort();
122 
123  virtual DtConstrainedAnalogOutputPort * throttlePort();
124  virtual DtConstrainedAnalogOutputPort * steeringPort();
125  virtual DtConstrainedAnalogOutputPort * brakePort();
126  virtual DtConstrainedIntegerOutputPort * gearPort();
127  virtual DtBooleanOutputPort * parkingBrakePort();
128 
129  virtual double decelerationSoilFactor() const;
130 
136  virtual double calcSteeringForTurnInPlace();
137 
141  virtual double calcThrottleForTurnInPlace();
142 
145  virtual double calcBrakeForTurnInPlace();
146 
154  virtual int calcGearForTurnInPlace();
155 
159  virtual double calcSteeringForPivot();
160 
164  virtual double calcThrottleForPivot();
165 
169  virtual double calcSteeringForKTurn();
170 
174  virtual double calcThrottleForKTurn();
175 
179  virtual double calcBrakeForKTurn();
180 
186  virtual double findSpeedForKTurn();
187 
191  virtual double findHeadingForKTurn();
192 
194  virtual void setHeadingToTurnTo(double headingToTurnTo);
195  virtual double headingToTurnTo() const;
196 
198  virtual double calculateHeadingToTurnTo();
199 
201  virtual void setTurnToMode(int headingToTurnTo);
202  virtual int turnToMode() const;
203 
207  virtual void setKTurnReverseGoalHeading(double kTurnReverseGoalHeading);
208  virtual double kTurnReverseGoalHeading() const;
209 
213  virtual void setKTurnReverseComplete(bool kTurnReverseComplete);
214  virtual bool kTurnReverseComplete() const;
215 
219  static void setSpeedCallback(DtSimMessage * msg, void * usrData);
220  virtual void processSetSpeed(DtSimMessage * msg);
222 
223 protected:
225  virtual bool createPorts();
226 
228  virtual bool createPortGroups();
229 
237  virtual void lookupAndCacheProcessSR();
238 
241  virtual bool postAddComponentsInit();
242 
243  virtual const DtSoilFactors * currentSoilFactors() const;
244 
247  virtual bool decideToGiveUpTask() const;
248 
249 private:
250 
253 
256  orig);
257 
261 
262 
263 protected:
264 
266 
269 
276 
283 
290 
297 
303 
308 
310 
317 
322 
325 
328 
330 };
DtConstrainedIntegerOutputPort is a version of DtIntegerOutputPort which will constrain any outgoing ...
Definition: constrainedIntegerIOPort.h:53
virtual double headingErrorRequiringMinTurnRadius()
Definition: groundAutoControllerComponent.h:98
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtConstrainedIntegerOutputPort * myGearPort
Output Port Name: gear Output Port Description: Output Port Range: Output Port Default Value: Outp...
Definition: groundAutoControllerComponent.h:296
Description: This repository holds all information that is common to all the forms of local ground en...
Definition: groundVehicleStateRepository.h:30
DtAutomotivePSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: groundAutoControllerComponent.h:316
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
DtConstrainedAnalogOutputPort * mySteeringPort
Output Port Name: steering Output Port Description: Output Port Range: -1.0 to 1.0 Output Port Default Value: Output Group Parent: automotive-control.
Definition: groundAutoControllerComponent.h:282
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
DtConstrainedAnalogOutputPort is a version of DtAnalogOutputPort which will constrain any outgoing va...
Definition: constrainedAnalogIOPort.h:57
virtual bool init() override
Calls setRadio()
double mySpeedLastTick
For derivative control in approximateThrottle. Note–not added to process state; on scenario reload...
Definition: groundAutoControllerComponent.h:321
Instances of DtAutomotivePSR are used to hold the shared/checkpointable data for an automotive system...
Definition: automotivePSR.h:37
double mySpeedForFastestTurn
Caches the value computed in init() with computeSpeedForFastestTurn.
Definition: groundAutoControllerComponent.h:327
File: simMsg.h.
Definition: simMessage.h:35
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
virtual bool decideToGiveUpTask() const
This function is used to determine if the controller should give up trying to execute the current tas...
class DtSoilFactors:
Definition: soilFactors.h:31
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtConstrainedAnalogOutputPort * myBrakePort
Output Port Name: brake Output Port Description: Output Port Range: 0. to 1. Output Port Default Val...
Definition: groundAutoControllerComponent.h:289
DtConstrainedAnalogOutputPort * myThrottlePort
Output Port Name: throttle Output Port Description: Output Port Range: 0. to 1. Output Port Default ...
Definition: groundAutoControllerComponent.h:275
double myAccumulatedSpeedError
For integral speed control.
Definition: groundAutoControllerComponent.h:324
DtOutputPortGroup * myAutomotiveControlPortGroup
Output Port Group Name: automotive-control Output Port Group Description: Collection of control outpu...
Definition: groundAutoControllerComponent.h:307
DtBooleanOutputPort * myParkingBrakePort
Output Port Name: parking-brake Output Port Description: Output Port Default Value: True Output Grou...
Definition: groundAutoControllerComponent.h:302
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: groundAutoControllerComponent.h:329
DtGroundVehicleStateRepository * myGroundVehicleState
Definition: groundAutoControllerComponent.h:265
DtGroundAutoControllerComponent is a base controller that holds capabilitites common to all automotiv...
Definition: groundAutoControllerComponent.h:34
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 Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)