VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
automotiveActuatorComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vlpi/disEnums.h>
14 
19 
20 #include <matrix/vlVector.h>
21 
22 class DtChord;
23 class DtString;
26 class boolPort;
27 class DtTaitBryan;
28 class DtSoilFactors;
29 class DtAutomotivePSR;
33 class DtBooleanInputPort;
35 class DtAttachedTerrain;
37 
49 {
50 
51 public:
52 
56  DtSimulationServices* simManager,
57  DtComponentDescriptor* desc = 0,
58  DtReaderWriterRegistry* parentRegistry = 0);
59 
60 
62  virtual ~DtAutomotiveActuatorComponent() override;
63 
65  virtual bool init() override;
66 
69  virtual const char* type() const override;
70 
72  virtual void tick() override;
73 
77  static DtSimComponent * creator(const DtString& name,
78  DtLocalObject* owner,
79  DtSimulationServices* simManager,
80  DtComponentDescriptor* desc = 0,
81  DtReaderWriterRegistry* parentRegistry = 0);
82 
83 protected:
84 
87 
94  virtual void useFuel(double fuelUsed);
95 
101  virtual double fuelLeft() const;
102 
105  virtual double fuelUsed(double speed) const;
106 
108 
126  virtual void updateRepository(const DtVector & localPosition,
127  const DtVector & localVelocity, const DtVector & localAcceleration,
128  const DtTaitBryan & localOrientation, const DtVector& rotationalVelocity,
129  double newHeading);
130 
135  virtual double calculateMaxDecelerationFromBrake(double brake);
136 
144  virtual double calculateAccelerationFromEngine(double throttle,
145  double speed,
147  double pitch);
148 
151 
156  virtual double accelSoilFactor() const;
157 
163  virtual double decelSoilFactor() const;
164 
166  virtual DtString soilTypeString() const;
167 
170  virtual const DtSoilFactors* soilFactors(const DtString& soilType) const;
171 
178  virtual void calculateFactorsFromSoilAndWeather(const DtVector& location,
179  double& tractionFactor, double& dragFactor);
180 
186  virtual double calculateMaximumTractionAcceleration(const double tractionFactor);
187 
194  virtual double calculateSoilDragDeceleration(const double dragFactor,
195  const double speed);
196 
200  virtual double calculateAccelerationFromSlope(double pitch);
201 
213  virtual double slopeBoostRate() const;
214  virtual void setSlopeBoostRate(const double boost);
215 
228  virtual double calculateSlopeBoostRate();
229 
231 
245  virtual void calculateOrientationAndPosition(
246  const DtVector& newLocalProjectedLocation, double newHeading,
247  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
248 
251 
257  virtual bool useHighFidelityGroundClamping() const;
258 
261  virtual bool useNavDataGroundClamping();
262 
274  bool groundClamp(double heading, const DtVector& location,
275  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
276 
281  void groundClampHighFidelity(double heading, const DtVector& location,
282  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
283 
289  void groundClampLowFidelity(double heading, const DtVector& location,
290  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
291 
294  void groundClampWithNavData(double heading, const DtVector& location,
295  DtAttachedTerrain& terrain, DtVector& newNormal);
296 
298 
322  virtual double calculateHeading(const double oldHeading,
323  const DtAutoTransmissionGear gear,
324  const double steering, const double throttle, const double distanceMovedFwd,
325  const double forwardSpeed,
326  const double maxTractionAcceleration, const double soilDragFactor,
327  const double dT, double& curvature);
328 
335  virtual DtVector calculateBodyAcceleration(double throttle,
336  DtAutoTransmissionGear gear, double brake,
337  const DtVector& oldBodyVelocity, double oldPitch,
338  double maxTractionAcceleration, double mobilityFactor, double dT);
339 
340  virtual DtVector calculateBodyVelocity(
341  const DtVector& oldBodyVelocity, const DtVector& newBodyAcceleration,
342  double dT);
343 
346  virtual DtVector calculateProjectedLocation(
347  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
348  const DtVector& oldBodyVelocity, double newHeading);
349 
353  virtual DtVector calculateProjectedLocationNoPivot(
354  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
355  const DtVector& oldBodyVelocity, double newHeading, const double signedCurvature);
356 
359 
368  virtual bool checkForTerrainCollisions() const;
369 
375  virtual bool foundTerrainCollision(double heading,
376  const DtVector& oldLocalPosition,
377  const DtVector& newLocalPosition,
379  &collisionIntersectionRecord) const;
380 
390  virtual bool createMovementChord(DtChord& movementChord,
391  double heading,
392  const DtVector& oldLocalPosition,
393  const DtVector& newLocalPosition) const;
394 
399  virtual bool terrainPassable(double heading,
401  terrainIntersectionRecord) const;
402 
404 
409  virtual double calculateMaxSpeed();
410 
413  virtual double calculateMaxAcceleration();
414 
418  virtual void calculateDirectionOfLinearMotion(
419  const DtDcm& newLocalOrientation, const DtVector& newLocalPosition,
420  DtDcm& newLocalDirectionOfLinearMotion);
421 
423  virtual bool createPortGroups() override;
424 
426  virtual bool createPorts() override;
427 
433  virtual bool createPSR();
434 
438  virtual bool rotationalVelocityShouldBeClamped(const DtVector&
439  bodyRotationalVelocity);
440 
443 
445  virtual double steeringControlValue() const;
447  virtual double throttleControlValue() const;
449  virtual double brakeControlValue() const;
451  virtual DtAutoTransmissionGear gearControlValue() const;
453  virtual bool parkingBrakeControlValue() const;
454 
456 
459  virtual bool checkIfMoveOntoEmbarked(const DtVector& localPosition);
460 
461  virtual bool checkAndDisembarkIfEmbarked(const DtVector& localPosition);
462 
465 
469  static void terainChangeNotification(const DtTerrainChangeNotificationInfo& terrainChangeInfo, void* usr);
470 
475  void processTerrainChangeNotification(const DtTerrainChangeNotificationInfo& terrainChangeInfo);
476 
478 private:
481 
484 
488 
489 protected:
490 
493 
500 
507 
514 
521 
528 
533 
540 
542 
544 
548 
552 
556 
562 
563  double myLastPitch;
566 
568 
571 
574 
579 
582 
588 
589 };
590 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
DtVector myLastPitchLocation
This flag is used to clarify that an embarked entity is stopped (on its parent). If true...
Definition: automotiveActuatorComponent.h:565
Description: This repository holds all information that is common to all the forms of local ground en...
Definition: groundVehicleStateRepository.h:30
This class is used to interface with the terrain a particular entity is &quot;attached&quot; to...
Definition: attachedTerrain.h:57
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
bool myDataUnavailableOnSoil
A flag to indicate that data was not available when querying terrain for soil type so that we do not ...
Definition: automotiveActuatorComponent.h:586
DtAutomotivePSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: automotiveActuatorComponent.h:547
Contains class declarations for DtConstrainedAnalogInputPort and DtConstrainedAnalogOutputPort.
Definition: constrainedAnalogIOPort.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
DtBooleanInputPort * myClampToNavDataPort
Input Port Name: clamp-to-nav-data Input Port Description: Tells the actuator that it should temporar...
Definition: automotiveActuatorComponent.h:539
Definition: readerWriterRegistry.h:39
End User Description: DtActuator is the base class for all actuator model components. Developer Description: The DtActuator base class caches a pointer to the entity&#39;s radio for convenience. Derived classes may have articulated parts that are configured from the DtActuatorComponentDescriptor&#39;s DtSimArtPartDescriptorList. For each articulated part in the list a DtArticulatedPartStateRepository will be created to store the data for the part such as it&#39;s location, rotation and so forth. These are created in the entity&#39;s DtVrfObjectStateRepository createParts() function. This call creates all the attached parts for all the actuators. These articulated state repositories are managed by the DtAttachmentManager. They are cached by their partType which is the DIS Enumeration describing the part from the disEnums.h file and was specified in the actuator&#39;s DtActuatorComponentDescriptor as descriped above. The partType is used as the category of the DtEntityType used to look up articulated parts in the DtAttachementManager. When an actuator needs access to a particular articulated part it looks it up by the part&#39;s object type.
Definition: actuatorComponent.h:47
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
Port group used to set what values should be set into the VRF state repository. All values are in loc...
Definition: automotiveActuatorComponent.h:551
DtConstrainedAnalogInputPort * myBrakePort
Input Port Name: brake Input Port Description: Input Port Range: 0.0 to 1.0 Input Port Default Valu...
Definition: automotiveActuatorComponent.h:513
DtConstrainedIntegerInputPort * myGearPort
Input Port Name: gear Input Port Description: Input Port Default Value: 0 Input Port Range: Reverse...
Definition: automotiveActuatorComponent.h:520
DtConstrainedAnalogInputPort * myThrottlePort
Input Port Name: throttle Input Port Description: Input Port Range: Input Port Default Value: 0 Inp...
Definition: automotiveActuatorComponent.h:499
bool myKeepParentPosition
This flag is used to clarify that an embarked entity is stopped (on its parent). If true...
Definition: automotiveActuatorComponent.h:560
Instances of DtAutomotivePSR are used to hold the shared/checkpointable data for an automotive system...
Definition: automotivePSR.h:45
DtAutomotiveActuatorDescriptor; descriptor for the DtAutomotiveActuatorComponent component.
Definition: automotiveActuatorDescriptor.h:21
bool myDataUnavailableOnTerrainUpdate
A flag to indicate that data was not available when querying terrain during a terrain update so that ...
Definition: automotiveActuatorComponent.h:578
virtual bool init() override
Overridden to cache a pointer to the entity&#39;s radio in this class.
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation frame...
double mySlopeBoostRate
This flag is used to clarify that an embarked entity is stopped (on its parent). If true...
Definition: automotiveActuatorComponent.h:567
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtConstrainedAnalogInputPort * mySteeringPort
Input Port Name: steering Input Port Description: Input Port Range: -1.0 to 1.0 Input Port Default V...
Definition: automotiveActuatorComponent.h:506
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:570
DtBooleanInputPort * myParkingBrakePort
Input Port Name: parking-brake Input Port Description: Input Port Range: Input Port Default Value: ...
Definition: automotiveActuatorComponent.h:527
DtGroundVehicleStateRepository * myGroundVehicleState
Definition: automotiveActuatorComponent.h:543
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...
bool myTerrainUpdateTriggeredFlag
A flag that is set if the terrain has been altered.
Definition: automotiveActuatorComponent.h:573
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
Definition: vrfChordIntersectionRecord.h:19
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:25
const DtAutomotiveActuatorDescriptor * myAutomotiveDescriptor
This flag is used to clarify that an embarked entity is stopped (on its parent). If true...
Definition: automotiveActuatorComponent.h:555
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
DtUUID myWasJustEmbarkedOn
This flag is used to clarify that an embarked entity is stopped (on its parent). If true...
Definition: automotiveActuatorComponent.h:561
double myLastPitch
This flag is used to clarify that an embarked entity is stopped (on its parent). If true...
Definition: automotiveActuatorComponent.h:563
DtInputPortGroup * myAutomotiveControlPortGroup
Input Port Group Name: automotive-control Input Port Group Description: Provides input to the automot...
Definition: automotiveActuatorComponent.h:532
DtAutomotiveActuatorComponent provides a kinematics-based model of an automotive system.
Definition: automotiveActuatorComponent.h:48
double myLastPitchHeading
This flag is used to clarify that an embarked entity is stopped (on its parent). If true...
Definition: automotiveActuatorComponent.h:564
bool myStuckWarningMessagePrinted
Indicates whether a message has been printed about being stuck.
Definition: automotiveActuatorComponent.h:581
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:31
Provides information about the terrain changes: mySpatExtent defines the terrain change type - e...
Definition: terrainImplementation.h:50
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Contains class declarations for DtConstrainedIntegerInputPort and DtConstrainedIntegerOutputPort.
Definition: constrainedIntegerIOPort.h:26
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)