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 
208  virtual double slopeBoostRate() const;
209  virtual void setSlopeBoostRate(const double boost);
210 
223  virtual double calculateSlopeBoostRate();
224 
226 
240  virtual void calculateOrientationAndPosition(
241  const DtVector& newLocalProjectedLocation, double newHeading,
242  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
243 
246 
252  virtual bool useHighFidelityGroundClamping() const;
253 
256  virtual bool useNavDataGroundClamping();
257 
269  bool groundClamp(double heading, const DtVector& location,
270  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
271 
276  void groundClampHighFidelity(double heading, const DtVector& location,
277  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
278 
284  void groundClampLowFidelity(double heading, const DtVector& location,
285  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
286 
289  void groundClampWithNavData(double heading, const DtVector& location,
290  DtAttachedTerrain& terrain, DtVector& newNormal);
291 
293 
317  virtual double calculateHeading(const double oldHeading,
318  const DtAutoTransmissionGear gear,
319  const double steering, const double throttle, const double distanceMovedFwd,
320  const double forwardSpeed,
321  const double maxTractionAcceleration, const double soilDragFactor,
322  const double dT, double& curvature);
323 
330  virtual DtVector calculateBodyAcceleration(double throttle,
331  DtAutoTransmissionGear gear, double brake,
332  const DtVector& oldBodyVelocity, double oldPitch,
333  double maxTractionAcceleration, double dragFactor, double dT);
334 
335  virtual DtVector calculateBodyVelocity(
336  const DtVector& oldBodyVelocity, const DtVector& newBodyAcceleration,
337  double dT);
338 
341  virtual DtVector calculateProjectedLocation(
342  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
343  const DtVector& oldBodyVelocity, double newHeading);
344 
348  virtual DtVector calculateProjectedLocationNoPivot(
349  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
350  const DtVector& oldBodyVelocity, double newHeading, const double signedCurvature);
351 
354 
363  virtual bool checkForTerrainCollisions() const;
364 
370  virtual bool foundTerrainCollision(double heading,
371  const DtVector& oldLocalPosition,
372  const DtVector& newLocalPosition,
374  &collisionIntersectionRecord) const;
375 
385  virtual bool createMovementChord(DtChord& movementChord,
386  double heading,
387  const DtVector& oldLocalPosition,
388  const DtVector& newLocalPosition) const;
389 
394  virtual bool terrainPassable(double heading,
396  terrainIntersectionRecord) const;
397 
399 
404  virtual double calculateMaxSpeed();
405 
408  virtual double calculateMaxAcceleration();
409 
413  virtual void calculateDirectionOfLinearMotion(
414  const DtDcm& newLocalOrientation, const DtVector& newLocalPosition,
415  DtDcm& newLocalDirectionOfLinearMotion);
416 
418  virtual bool createPortGroups() override;
419 
421  virtual bool createPorts() override;
422 
428  virtual bool createPSR();
429 
433  virtual bool rotationalVelocityShouldBeClamped(const DtVector&
434  bodyRotationalVelocity);
435 
438 
440  virtual double steeringControlValue() const;
442  virtual double throttleControlValue() const;
444  virtual double brakeControlValue() const;
446  virtual DtAutoTransmissionGear gearControlValue() const;
448  virtual bool parkingBrakeControlValue() const;
449 
451 
454  virtual bool checkIfMoveOntoEmbarked(const DtVector& localPosition);
455 
456  virtual bool checkAndDisembarkIfEmbarked(const DtVector& localPosition);
457 
460 
464  static void terainChangeNotification(const DtTerrainChangeNotificationInfo& terrainChangeInfo, void* usr);
465 
470  void processTerrainChangeNotification(const DtTerrainChangeNotificationInfo& terrainChangeInfo);
471 
473 private:
476 
479 
483 
484 protected:
485 
488 
495 
502 
509 
516 
523 
528 
535 
537 
539 
543 
547 
553 
554  double myLastPitch;
557 
559 
562 
565 
570 
573 
578 
579 };
580 
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
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:556
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:577
DtAutomotivePSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: automotiveActuatorComponent.h:542
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:534
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:546
DtConstrainedAnalogInputPort * myBrakePort
Input Port Name: brake Input Port Description: Input Port Range: 0.0 to 1.0 Input Port Default Valu...
Definition: automotiveActuatorComponent.h:508
DtConstrainedIntegerInputPort * myGearPort
Input Port Name: gear Input Port Description: Input Port Default Value: 0 Input Port Range: Reverse...
Definition: automotiveActuatorComponent.h:515
DtConstrainedAnalogInputPort * myThrottlePort
Input Port Name: throttle Input Port Description: Input Port Range: Input Port Default Value: 0 Inp...
Definition: automotiveActuatorComponent.h:494
bool myKeepParentPosition
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:551
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:569
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 from ...
double mySlopeBoostRate
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:558
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:501
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:561
DtBooleanInputPort * myParkingBrakePort
Input Port Name: parking-brake Input Port Description: Input Port Range: Input Port Default Value: ...
Definition: automotiveActuatorComponent.h:522
DtGroundVehicleStateRepository * myGroundVehicleState
Definition: automotiveActuatorComponent.h:538
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:564
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
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
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:550
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
DtUUID myWasJustEmbarkedOn
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:552
double myLastPitch
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:554
DtInputPortGroup * myAutomotiveControlPortGroup
Input Port Group Name: automotive-control Input Port Group Description: Provides input to the automot...
Definition: automotiveActuatorComponent.h:527
DtAutomotiveActuatorComponent provides a kinematics-based model of an automotive system.
Definition: automotiveActuatorComponent.h:48
double myLastPitchHeading
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:555
bool myStuckWarningMessagePrinted
Indicates whether a message has been printed about being stuck.
Definition: automotiveActuatorComponent.h:572
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 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)