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) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vlpi/disEnums.h>
17 #include <matrix/vlVector.h>
18 
19 class DtChord;
20 class DtString;
23 class boolPort;
24 class DtTaitBryan;
25 class DtSoilFactors;
26 class DtAutomotivePSR;
30 class DtBooleanInputPort;
32 class DtAttachedTerrain;
34 
46 {
47 
48 public:
49 
53  DtSimulationServices* simManager,
54  DtComponentDescriptor* desc = 0,
55  DtReaderWriterRegistry* parentRegistry = 0);
56 
57 
60 
62  virtual bool init();
63 
66  virtual const char* type() const;
67 
69  virtual void tick();
70 
74  static DtSimComponent * creator(const DtString& name,
75  DtLocalObject* owner,
76  DtSimulationServices* simManager,
77  DtComponentDescriptor* desc = 0,
78  DtReaderWriterRegistry* parentRegistry = 0);
79 
80 protected:
81 
83  virtual double accelSoilFactor() const;
84 
86  virtual double decelSoilFactor() const;
87 
89  virtual DtString soilTypeString() const;
90 
93  virtual const DtSoilFactors* soilFactors(const DtString& soilType) const;
94 
101  virtual void useFuel(double fuelUsed);
102 
108  virtual double fuelLeft() const;
109 
127  virtual void updateRepository(const DtVector & localPosition,
128  const DtVector & localVelocity, const DtVector & localAcceleration,
129  const DtTaitBryan & localOrientation, const DtVector& rotationalVelocity,
130  double newHeading);
131 
136  virtual double calculateMaxDecelerationFromBrake(double brake);
137 
145  virtual double calculateAccelerationFromEngine(double throttle,
146  double speed,
148  double pitch);
149 
156  virtual void calculateFactorsFromSoilAndWeather(const DtVector& location,
157  double& tractionFactor, double& dragFactor);
158 
164  virtual double calculateMaximumTractionAcceleration(const double tractionFactor);
165 
172  virtual double calculateSoilDragDeceleration(const double dragFactor,
173  const double speed);
174 
178  virtual double calculateAccelerationFromSlope(double pitch);
179 
193  virtual void calculateOrientationAndPosition(
194  const DtVector& newLocalProjectedLocation, double newHeading,
195  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
196 
202  virtual bool useHighFidelityGroundClamping() const;
203 
206  virtual bool useNavDataGroundClamping();
207 
219  bool groundClamp(double heading, const DtVector& location,
220  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
221 
226  void groundClampHighFidelity(double heading, const DtVector& location,
227  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
228 
234  void groundClampLowFidelity(double heading, const DtVector& location,
235  DtAttachedTerrain& terrain, DtVector& newNormal, bool& dataAvailable);
236 
239  void groundClampWithNavData(double heading, const DtVector& location,
240  DtAttachedTerrain& terrain, DtVector& newNormal);
241 
254  virtual double calculateHeading(const double oldHeading,
255  const DtVector& oldBodyVelocity, const DtAutoTransmissionGear gear,
256  const double steering, const double throttle, const double speed,
257  const double maxTractionAcceleration, const double soilDragFactor,
258  const double dT);
259 
266  virtual DtVector calculateBodyAcceleration(double throttle,
267  DtAutoTransmissionGear gear, double brake,
268  const DtVector& oldBodyVelocity, double oldPitch,
269  double maxTractionAcceleration, double dragFactor, double dT);
270 
271  virtual DtVector calculateBodyVelocity(
272  const DtVector& oldBodyVelocity, const DtVector& newBodyAcceleration,
273  double dT);
274 
275  virtual DtVector calculateProjectedLocation(
276  const DtVector& oldLocalPosition, const DtVector& newBodyAcceleration,
277  const DtVector& oldBodyVelocity, double newHeading);
278 
287  virtual bool checkForTerrainCollisions() const;
288 
294  virtual bool foundTerrainCollision(double heading,
295  const DtVector& oldLocalPosition,
296  const DtVector& newLocalPosition,
298  &collisionIntersectionRecord) const;
299 
309  virtual bool createMovementChord(DtChord& movementChord,
310  double heading,
311  const DtVector& oldLocalPosition,
312  const DtVector& newLocalPosition) const;
313 
318  virtual bool terrainPassable(double heading,
320  terrainIntersectionRecord) const;
321 
322 
327  virtual double calculateMaxSpeed();
328 
331  virtual double calculateMaxAcceleration();
332 
336  virtual void calculateDirectionOfLinearMotion(
337  const DtDcm& newLocalOrientation, const DtVector& newLocalPosition,
338  DtDcm& newLocalDirectionOfLinearMotion);
339 
346  virtual double slopeBoostRate() const;
347  virtual void setSlopeBoostRate(const double boost);
348 
361  virtual double calculateSlopeBoostRate();
362 
364  virtual bool createPortGroups();
365 
367  virtual bool createPorts();
368 
374  virtual bool createPSR();
375 
379  virtual bool rotationalVelocityShouldBeClamped(const DtVector&
380  bodyRotationalVelocity);
381 
383  virtual double steeringControlValue() const;
385  virtual double throttleControlValue() const;
387  virtual double brakeControlValue() const;
389  virtual DtAutoTransmissionGear gearControlValue() const;
391  virtual bool parkingBrakeControlValue() const;
392 
395  virtual bool checkIfMoveOntoEmbarked(const DtVector& localPosition);
396 
397  virtual bool checkAndDisembarkIfEmbarked(const DtVector& localPosition);
398 
402  static void terainChangeNotification(const DtExtent& spatExtent, void* usr);
403 
408  void processTerrainChangeNotification(const DtExtent& spatExtent);
409 private:
412 
415 
419 
420 protected:
421 
424 
431 
438 
445 
452 
459 
464 
471 
473 
475 
479 
483 
489 
490  double myLastPitch;
493 
495 
498 
501 
506 };
507 
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:492
Description: This repository holds all information that is common to all the forms of local ground en...
Definition: groundVehicleStateRepository.h:30
Definition: attachedTerrain.h:46
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
DtAutomotivePSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: automotiveActuatorComponent.h:478
virtual bool init()
Overridden to cache a pointer to the entity&#39;s radio in this class.
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:470
Definition: readerWriterRegistry.h:39
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
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 DtObjectType 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:482
DtConstrainedAnalogInputPort * myBrakePort
Input Port Name: brake Input Port Description: Input Port Range: 0.0 to 1.0 Input Port Default Valu...
Definition: automotiveActuatorComponent.h:444
DtConstrainedIntegerInputPort * myGearPort
Input Port Name: gear Input Port Description: Input Port Default Value: 0 Input Port Range: Reverse...
Definition: automotiveActuatorComponent.h:451
DtConstrainedAnalogInputPort * myThrottlePort
Input Port Name: throttle Input Port Description: Input Port Range: Input Port Default Value: 0 Inp...
Definition: automotiveActuatorComponent.h:430
bool myKeepParentPosition
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:487
Instances of DtAutomotivePSR are used to hold the shared/checkpointable data for an automotive system...
Definition: automotivePSR.h:37
DtAutomotiveActuatorDescriptor; descriptor for the DtAutomotiveActuatorComponent component.
Definition: automotiveActuatorDescriptor.h:24
bool myDataUnavailableOnTerrainUpdate
A flag to indicate that data was not available when querying terrain during a terrain update so that ...
Definition: automotiveActuatorComponent.h:505
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:494
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:437
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:497
DtBooleanInputPort * myParkingBrakePort
Input Port Name: parking-brake Input Port Description: Input Port Range: Input Port Default Value: ...
Definition: automotiveActuatorComponent.h:458
DtGroundVehicleStateRepository * myGroundVehicleState
Definition: automotiveActuatorComponent.h:474
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:500
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:95
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
Definition: vrfChordIntersectionRecord.h:19
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:25
const DtAutomotiveActuatorDescriptor * myAutomotiveDescriptor
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:486
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:488
double myLastPitch
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:490
DtInputPortGroup * myAutomotiveControlPortGroup
Input Port Group Name: automotive-control Input Port Group Description: Provides input to the automot...
Definition: automotiveActuatorComponent.h:463
DtAutomotiveActuatorComponent provides a kinematics-based model of an automotive system.
Definition: automotiveActuatorComponent.h:45
double myLastPitchHeading
Member to allow for access to platform specific data.
Definition: automotiveActuatorComponent.h:491
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:31
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. 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 Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)