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 
47  virtual ~DtGroundAutoControllerComponent() override;
48 
50  virtual bool init() override;
51 
54  virtual const char* type() const override;
55 
58  virtual void clearTask() override;
59 
68  virtual double mildAccelerationConstant() const;
70  virtual double standardAccelerationConstant() const;
72  virtual double hardAccelerationConstant() const;
74  virtual double maxAccelerationConstant() const;
75 
80  virtual double currentAccelerationToUse() const;
82 
103  virtual double computeSpeedForFastestTurn(
104  const double latAccelLimit = 0.0) const;
105 
110  virtual double speedForFastestTurn() const;
111  virtual void setSpeedForFastestTurn(double speed);
112 
134  virtual double approximateThrottle(double desiredSpeed, double headingError = 0.0);
135 
147  double speedConstraintForHeadingError(
148  const double headingError, const double maxAccel = 0.0) const;
152  virtual double headingErrorRequiringMinTurnRadius() const { return 1.0; }
153 
162  virtual double calculateSteering(double currentHeading, double
163  desiredHeading) const;
164 
165 
166  virtual double calculateCurrentBrakingDistance() const;
167 
170 
173  virtual bool createAutomotiveControlPortGroup();
174  virtual bool createThrottlePort();
175  virtual bool createSteeringPort();
176  virtual bool createBrakePort();
177  virtual bool createGearPort();
178  virtual bool createParkingBrakePort();
179 
180  virtual DtConstrainedAnalogOutputPort * throttlePort();
181  virtual DtConstrainedAnalogOutputPort * steeringPort();
182  virtual DtConstrainedAnalogOutputPort * brakePort();
183  virtual DtConstrainedIntegerOutputPort * gearPort();
184  virtual DtBooleanOutputPort * parkingBrakePort();
185 
189  virtual void setThrottleFromSignedThrottle(const double signedAccel);
190 
192 
193  virtual double decelerationSoilFactor() const;
194 
202  virtual double tractionFactorFromSoilAndWeather() const;
203 
209  virtual double calcSteeringForTurnInPlace();
210 
214  virtual double calcThrottleForTurnInPlace();
215 
218  virtual double calcBrakeForTurnInPlace();
219 
227  virtual int calcGearForTurnInPlace();
228 
232  virtual double calcSteeringForPivot();
233 
237  virtual double calcThrottleForPivot();
238 
242  virtual double calcSteeringForKTurn();
243 
247  virtual double calcThrottleForKTurn();
248 
252  virtual double calcBrakeForKTurn();
253 
259  virtual double findSpeedForKTurn();
260 
264  virtual double findHeadingForKTurn();
265 
267  virtual void setHeadingToTurnTo(double headingToTurnTo);
268  virtual double headingToTurnTo() const;
269 
271  virtual double calculateHeadingToTurnTo();
272 
274  virtual void setTurnToMode(int headingToTurnTo);
275  virtual int turnToMode() const;
276 
280  virtual void setKTurnReverseGoalHeading(double kTurnReverseGoalHeading);
281  virtual double kTurnReverseGoalHeading() const;
282 
286  virtual void setKTurnReverseComplete(bool kTurnReverseComplete);
287  virtual bool kTurnReverseComplete() const;
288 
292  static void setSpeedCallback(DtSimMessage * msg, void * usrData);
293  virtual void processSetSpeed(DtSimMessage * msg);
295 
297  virtual DtString obstacleAvoidanceOperation() const;
298 
300  virtual DtAutomotivePSR* processState() const;
301 
302 protected:
304  virtual bool createPorts() override;
305 
307  virtual bool createPortGroups() override;
308 
316  virtual void lookupAndCacheProcessSR();
317 
320  virtual bool postAddComponentsInit() override;
321 
322  virtual const DtSoilFactors * currentSoilFactors() const;
323 
326  virtual bool decideToGiveUpTask() const override;
327 
328 private:
329 
332 
335  orig);
336 
340 
341 
342 protected:
343 
345 
348 
355 
362 
369 
376 
382 
387 
389 
396 
401 
404 
407 
409 
413 };
DtConstrainedIntegerOutputPort is a version of DtIntegerOutputPort which will constrain any outgoing ...
Definition: constrainedIntegerIOPort.h:53
#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:375
Description: This repository holds all information that is common to all the forms of local ground en...
Definition: groundVehicleStateRepository.h:30
bool myHaveWarnedAboutNoPivotSpeed
Flag to make sure a warning is printed only the first time. Mutable so it can be modified in otherwis...
Definition: groundAutoControllerComponent.h:412
DtAutomotivePSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: groundAutoControllerComponent.h:395
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:361
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 double headingErrorRequiringMinTurnRadius() const
When a controller is trying to steer to a desired heading, if the heading error is above this value...
Definition: groundAutoControllerComponent.h:152
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:400
Instances of DtAutomotivePSR are used to hold the shared/checkpointable data for an automotive system...
Definition: automotivePSR.h:45
double mySpeedForFastestTurn
Caches the value computed in init() with computeSpeedForFastestTurn.
Definition: groundAutoControllerComponent.h:406
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:97
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:368
DtConstrainedAnalogOutputPort * myThrottlePort
Output Port Name: throttle Output Port Description: Output Port Range: 0. to 1. Output Port Default ...
Definition: groundAutoControllerComponent.h:354
double myAccumulatedSpeedError
For integral speed control.
Definition: groundAutoControllerComponent.h:403
DtOutputPortGroup * myAutomotiveControlPortGroup
Output Port Group Name: automotive-control Output Port Group Description: Collection of control outpu...
Definition: groundAutoControllerComponent.h:386
DtBooleanOutputPort * myParkingBrakePort
Output Port Name: parking-brake Output Port Description: Output Port Default Value: True Output Grou...
Definition: groundAutoControllerComponent.h:381
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:408
DtGroundVehicleStateRepository * myGroundVehicleState
Definition: groundAutoControllerComponent.h:344
DtGroundAutoControllerComponent is a base controller that holds capabilitites common to all automotiv...
Definition: groundAutoControllerComponent.h:34
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)