VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtAutomotiveActuatorComponent Class Reference

DtAutomotiveActuatorComponent provides a kinematics-based model of an automotive system. More...

Inheritance diagram for DtAutomotiveActuatorComponent:
Inheritance graph
[legend]

Public Member Functions

 DtAutomotiveActuatorComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtAutomotiveActuatorComponent ()
 destructor
virtual bool init ()
 Calls createPSR() to create our process state repository.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void tick ()
 Calculate new kinematic state.
- Public Member Functions inherited from DtActuatorComponent
virtual ~DtActuatorComponent ()
 destructor
virtual DtSimBaseRadioradio ()
virtual bool tickWhileDestroyed () const
 By default, all actuators tick when the entity is destroyed.
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual ~DtSimComponent ()
 destructor
void setParentSystem (DtComponentSystem *system)
 Sets the parent system of this component.
virtual bool postAddComponentsInit ()
 Called after all components have been created, initialized and added to the component manager.
virtual void preFirstTickInit ()
 This function can be overridden to initialize a component before it is ticked for the first time.
virtual void postTick ()
 This function is called immediately after tick() is called.
virtual void timedTick ()
 This version of tick checks to see if the time to tick has arrived.
virtual void setMinTickPeriod (double minTickPeriod)
 specifies a minimum tick period (which can also be thought of as
virtual double minTickPeriod () const
 access the minimum tick period
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 set the variance in the minimum tick time
virtual double minTickPeriodVariance () const
 access the variance in the minimum tick period
virtual void setNextTickTime (double nextTickTime)
 The next tick time is normally calculated internally.
virtual double nextTickTime () const
 access the next tick time
virtual double calculateNextTickTime () const
 The next tick time is equal to mySimManager->exerciseClock()-> approximateElapsedRealTime() + myMinTickPeriod + a random # between -myMinTickPeriodVariance/2.
virtual double calculateFirstTickTime () const
 Returns the first time value that the component should tick at.
virtual void setEntity (DtVrfObject *entity)
 The entity's state repository is the place that actuator components make updates and other components look to see our current state.
virtual DtSimComponentnextComponent ()
 List management functions.
virtual DtSimComponentprevComponent ()
virtual void setListItem (DtListItem *item)
 Used by DtComponentList.
virtual DtListItem * listItem ()
virtual void putData (FILE *fp, int indentLevel=0)
 putData writes our type, which is provided by the virtual type accessor of the deriving class.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 getData is just used to get us past the type in the data stream, since it's not actual stored.
virtual void addInputPort (DtInputPort *port)
 Adds this input port to the components input port list so that other components can look it up and attach to it.
virtual void removeInputPort (DtInputPort *port)
virtual DtInputPortlookupInputPort (const DtString &portName)
 Returns a pointer to the input port registered on this component with the specified name.
virtual DtList inputPortList () const
 Returns the list of DtInputPorts registered on this component.
virtual void addOutputPort (DtOutputPort *port)
 Adds this output port to the components output port list so that other components can look it up and attach to it.
virtual void removeOutputPort (DtOutputPort *port)
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 Returns a pointer to the output port registered on this component with the specified name.
virtual DtList outputPortList () const
 Returns the list of DtOutputPorts registered on this component.
virtual void addInputPortGroup (DtInputPortGroup *group)
 Adds this input port to the components input port list so that other components can look it up and attach to it.
virtual void removeInputPortGroup (DtInputPortGroup *group)
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 Returns a pointer the input port group registered on this component with the specified name.
virtual DtList inputPortGroupList () const
 Returns the list of DtInputPortGroups registered on this component.
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 Adds this output port group to the components output port group list so that other components can look it up and attach to it.
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 Returns a pointer the output port group registered on this component with the specified name.
virtual DtList outputPortGroupList () const
 Returns the list of DtOutputPortGroups registered on this component.
virtual int priority () const
 Return the current connection priority for this component.
virtual void setPriority (int priority)
 Sets a new connection priority for this component, and changes all current outgoing connections from this component to the new value.
double dT () const
 This is the delta-t for this component, which may or may not be the same as the exerciseClock dT.
virtual void setDT (double deltaT)
 Note that while dT is calculated internally, this makes it possible to 'lie' to the component about dT if necessary.
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 The component descriptor specified in the order of battle file or parameter file that was used to create this component.
virtual const
DtComponentDescriptor
componentDescriptor () const
DtVrfProcessStateRepositoryManagerpsrManager ()
virtual DtString componentFullName () const
virtual void enable ()
 Is this component enabled or not.
virtual void disable ()
 Is this component enabled or not.
virtual bool isEnabled ()
 Is this component enabled or not.
virtual void setIsEnabled (bool yesNo)
 Is this component enabled or not.
virtual DtOutputStream & objectConsoleDebug () const
virtual DtOutputStream & objectConsoleVerbose () const
virtual DtOutputStream & objectConsoleInfo () const
virtual DtOutputStream & objectConsoleWarn () const
virtual DtOutputStream & objectConsoleError () const
virtual DtSimResourceManagerresourceManager ()
virtual const
DtSimResourceManager
resourceManager () const
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 default constructor
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 real constructor Setting the readonly flag prevents object from writing itself to the stream.
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 assignment operator
virtual ~DtReaderWriter ()
 destructor
virtual void putSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Top level call to write itself to file.
virtual void getSelf (DtlObjPtr args, const DtFilename &searchPath=DtFilename::nullFilename(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 Top level to read itself from an input stream.
virtual void writeSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Called from putSelf, calls myRegistry.putSelf which in turn calls putSelf on each reader/writer in the registry.
virtual DtSymbolString name () const
 Accessor for name of this readable/writable object.
virtual void addAlias (const DtSymbolString &alias)
 Add an alias as an alternative name for this object.
virtual bool hasAlias (const DtSymbolString &alias)
virtual const aliasContaineraliases () const
virtual void setReadonly (bool flag)
 Set read-only flag.
virtual bool isReadonly () const
virtual bool variableIsBound () const
virtual void unbindVariable ()
 Sets the myVariableIsBound flag to false.
virtual void setName (const DtString &)
 Set the name of the object.
virtual const char * readerWriterType () const
 Used to supply a string type that this reader writer type is.
virtual DtString prettyPrint () const
 Routine to return a human readable form of the reader/writer variable.
virtual void bindVariables (DtVariableBindingsList variableBindings)
 Runs a variable binding pass on this reader writer and any of its children.
virtual std::list
< DtVariableNameType
unboundVariables () const
bool invalid () const
virtual bool hasChild (const DtReaderWriter *p) const
 Returns true if this variable has a child p in it's chain.
virtual void setValueSpecified (bool specified, bool recurse=false)
 The specified flags are used for optional values.
virtual bool valueSpecified () const
 The specified flags are used for optional values.
virtual bool isVariableReference () const
 Specifies whether or not this reader writer is really a variable that is specified elsewhere.
virtual void setIsVariableReference (bool value)
virtual DtSymbolString variableName () const
 The variable name, if this object is a variable reference.
virtual void setVariableName (const DtSymbolString variableName)
 The variable name, if this object is a variable reference.
const DtReaderWriterRegistryregistry () const
 Collection of child DtReaderWriter nodes owned by this object.
DtReaderWriterRegistryregistry ()
 Collection of child DtReaderWriter nodes owned by this object.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual double maxSpeedSoilFactor () const
virtual double accelSoilFactor () const
virtual double decelSoilFactor () const
virtual DtSoilFactorssoilFactors () const
virtual bool disableControl ()
 Checks if another components needs to disable the movement actuator Currently the DI-Guy controller does this so that it can keep the entity insynch with the animation it's DI-Guy representation is performing.
virtual void useFuel (double fuelUsed)
 Looks up the resource named “fuel” in the entity’s Resource Manager.
virtual double fuelLeft () const
 Looks up the resource named “fuel” in the entity’s Resource Manager.
virtual void updateRepository (const DtVector &localPosition, const DtVector &localVelocity, const DtVector &localAcceleration, const DtTaitBryan &localOrientation, const DtVector &rotationalVelocity, double newHeading)
 Updates the local state repository: It places the position, velocity, acceleration, and orientation arguments into the local repository.
virtual double calculateMaxDecelerationFromFriction (const DtVector &oldBodyVelocity)
 Calculates the maximum possible deceleration resulting from friction for the current tick.
virtual double calculateMaxDecelerationFromBrake (double brake)
virtual double calculateAccelerationFromEngine (double throttle, DtAutoTransmissionGear gear)
virtual double calculateDecelerationFromSoilType (const DtVector &oldBodyVelocity)
 Calculates the amount of deceleration caused by movement over the current soil type.
virtual double calculateAccelerationFromSlope (double slope)
virtual void calculateOrientationAndPosition (const DtVector &newLocalProjectedLocation, double newHeading, DtDcm &newLocalOrientation, DtVector &newLocalPosition)
 Calculates the orientation and position of the entity, given a new location and heading.
virtual bool useHighFidelityGroundClamping () const
bool groundClamp (double heading, const DtVector &location, DtAttachedTerrain &terrain, DtVector &newNormal)
 Clamps the entity to the ground at the specified location, and determines the normal of the plane the entity is on at that location.
void groundClampHighFidelity (double heading, const DtVector &location, DtAttachedTerrain &terrain, DtVector &newNormal)
 Uses all four ground interaction points to determine the plane of the entity and the soil type.
void groundClampLowFidelity (double heading, const DtVector &location, DtAttachedTerrain &terrain, DtVector &newNormal)
 Uses only the center ground interaction point.
virtual double calculateHeading (double oldHeading, const DtVector &oldBodyVelocity, DtAutoTransmissionGear gear, double steering, double throttle, double dT)
 Determines the new heading given the old heading, the velocity, gear, steering, throttle, and time delta.
virtual DtVector calculateBodyAcceleration (double throttle, DtAutoTransmissionGear gear, double brake, const DtVector &oldBodyVelocity, double oldPitch, double dT)
 Calculates the linear acceleration in body coordinates of the entity in meters/second/second.
virtual DtVector calculateBodyVelocity (const DtVector &oldBodyVelocity, const DtVector &newBodyAcceleration, double dT)
virtual DtVector calculateProjectedLocation (const DtVector &oldLocalPosition, const DtVector &newBodyAcceleration, const DtVector &oldBodyVelocity, double newHeading)
virtual bool checkForTerrainCollisions () const
virtual bool foundTerrainCollision (double heading, const DtVector &oldLocalPosition, const DtVector &newLocalPosition, DtChordIntersectionRecord &collisionIntersectionRecord) const
 Checks the terrain in between the specified old and new positions, along the specified heading for any terrain intersections.
virtual bool createMovementChord (DtChord &movementChord, double heading, const DtVector &oldLocalPosition, const DtVector &newLocalPosition) const
 Creates a chord along the specified heading, starting at the old position and ending at the new position, but each location is increased by the half height of the entity so that the check is done along the center of the entity's movement.
virtual bool terrainPassable (double heading, const DtChordIntersectionRecord &terrainIntersectionRecord) const
 Determines if the terrain referenced in the intersection record is "passable" by the entity.
virtual double calculateMaxSpeed ()
 Calculates the maximum speed for the entity, considering soil factors.
virtual double calculateMaxAcceleration ()
 Calculates the maximum acceleration for the entity, considering soil factors.
virtual DtVector calculateRotationalVelocity (const DtDcm &newOrientation, const DtDcm &oldOrientation, double dT)
 Calculates rotational velocity from new and old orientation body DCMs.
virtual double calculatePitch (const DtVector &localPosition, double heading, const DtAttachedTerrain &terrain)
 Calculates pitch at given local position and given heading.
virtual void calculateDirectionOfLinearMotion (const DtDcm &newLocalOrientation, const DtVector &newLocalPosition, DtDcm &newLocalDirectionOfLinearMotion)
 Computes direction of linear motion.
virtual double getPitchAdjustedMaxSpeed (double maxSpeed, double pitch) const
 Computes a new maximum speed, adjusted for the current pitch of the entity.
virtual bool createPortGroups ()
 Creates the local port groups.
virtual bool createPorts ()
 Creates the input ports and adds them to the component.
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.
virtual bool rotationalVelocityShouldBeClamped (const DtVector &bodyRotationalVelocity)
 Returns true if given magnitude of body rotational velocity is < 0.0001 radians/sec, false otherwise.
virtual double steeringControlValue () const
virtual double throttleControlValue () const
virtual double brakeControlValue () const
virtual DtAutoTransmissionGear gearControlValue () const
virtual bool parkingBrakeControlValue () const
- Protected Member Functions inherited from DtActuatorComponent
 DtActuatorComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString& name,
 DtActuatorComponent (const DtActuatorComponent &orig)
 copy constructor
const DtActuatorComponentoperator= (const DtActuatorComponent &orig)
 assignment operator
virtual void setRadio (DtSimBaseRadio *radio)
 DtActuatorComponent ()
 Default constructor; should not be called.
- Protected Member Functions inherited from DtSimComponent
bool testInvariant () const
virtual DtPhysicalWorldphysicalWorld ()
 Gets the physical world that this component's entity exists in.
virtual const DtPhysicalWorldphysicalWorld () const
virtual DtAttachedTerrainterrainAttachedTo ()
 Gets the terrain that this component's entity is attached to, if any.
virtual const DtAttachedTerrainterrainAttachedTo () const
virtual DtVrfObjectentity ()
 Gets the entity.
virtual const DtVrfObjectentity () const
virtual DtSimManagersimManager ()
 Gets the sim manager.
virtual const DtSimManagersimManager () const
virtual const Coordinate_SystemcoordinateSystem () const
 Gets the coordinate system, as it should always exist if the physical world is in a valid state!
virtual Coordinate_SystemcoordinateSystem ()
virtual
DtVrfObjectStateRepository
localStateRepository ()
 Gets the local state repository.
virtual const
DtVrfObjectStateRepository
localStateRepository () const
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 Copies values from the specified DtReaderWriter.
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 Checks to see if this RW object is a variable reference that can be bound using the provided bindings.

Protected Attributes

DtGroundVehicleStateRepositorymyGroundVehicleState
DtAutomotivePSRmyProcessState
 Container for state data associated with this component.
const
DtAutomotiveActuatorDescriptor
myAutomotiveDescriptor
Ports and Port Groups
DtConstrainedAnalogInputPortmyThrottlePort
 Input Port Name: throttle
Input Port Description:
Input Port Range:
Input Port Default Value: 0
Input Group Parent:
DtConstrainedAnalogInputPortmySteeringPort
 Input Port Name: steering
Input Port Description:
Input Port Range: -1.0 to 1.0
Input Port Default Value: 0
Input Group Parent:
DtConstrainedAnalogInputPortmyBrakePort
 Input Port Name: brake
Input Port Description:
Input Port Range: 0.0 to 1.0
Input Port Default Value: 0
Input Group Parent: automotive-control.
DtConstrainedIntegerInputPortmyGearPort
 Input Port Name: gear
Input Port Description:
Input Port Default Value: 0
Input Port Range: Reverse, Neutral, Forward, Pivot
Input Group Parent: automotive-control.
DtBooleanInputPortmyParkingBrakePort
 Input Port Name: parking-brake
Input Port Description:
Input Port Range:
Input Port Default Value: True (Brake On)
Input Group Parent: automotive-control.
DtInputPortGroupmyAutomotiveControlPortGroup
 Input Port Group Name: automotive-control
Input Port Group Description: Provides input to the automotive actuator (powertrain).
DtBooleanInputPortmyMovementDisableInputPort
 Input Port Name: movement-disable
Input Port Description: Checks to see if another component is determining the movements of the entity.
- Protected Attributes inherited from DtActuatorComponent
DtSimBaseRadiomyRadio
 Actuators can send messages.
- Protected Attributes inherited from DtSimComponent
DtVrfObjectmyEntity
DtVrfObjectStateRepositorymyLocalStateRepository
DtSimManagermySimManager
DtComponentSystemmySystem
 Pointer to the DtComponentSystem that this component belongs.
DtListItem * myListItem
DtInputPortMap myInputPortList
DtOutputPortMap myOutputPortList
DtInputPortGroupMap myInputPortGroupList
DtOutputPortGroupMap myOutputPortGroupList
int myPriority
double myMinTickPeriod
double myMinTickPeriodVariance
double myNextTickTime
double myLastTickSimTime
double myDT
bool myIsEnabled
 Indicates whether this component should be enabled for ticking or not.
bool myFirstTick
 Initialized to true in the constructor, set to false by the first call to postTick.
const DtComponentDescriptormyComponentDescriptor
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
DtReaderWriterRegistry myRegistry
bool myValueSpecified
bool myReadOnlyFlag
bool myIsVariableReference
DtSymbolString myVariableName
bool myVariableIsBound
aliasContainer myAliases
 Container for the aliases which represent alternative names for the object.
bool myInvalid
 Set to true if there is a problem reading this item.

Private Member Functions

 DtAutomotiveActuatorComponent ()
 Default constructor; not implemented.
 DtAutomotiveActuatorComponent (const DtAutomotiveActuatorComponent &orig)
 Copy constructor; not implemented.
const
DtAutomotiveActuatorComponent
operator= (const DtAutomotiveActuatorComponent &orig)
 assignment operator; not implemented

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
- Protected Types inherited from DtSimComponent
typedef std::map< DtString,
DtInputPort * > 
DtInputPortMap
typedef std::map< DtString,
DtOutputPort * > 
DtOutputPortMap
typedef std::map< DtString,
DtInputPortGroup * > 
DtInputPortGroupMap
typedef std::map< DtString,
DtOutputPortGroup * > 
DtOutputPortGroupMap
- Static Protected Attributes inherited from DtSimComponent
static DtSimComponentFactorymyFactory

Detailed Description

DtAutomotiveActuatorComponent provides a kinematics-based model of an automotive system.

End User Description: The DtAutomotiveActuatorComponent converts throttle, brake, and steering into orientation, acceleration, velocity, and position.

Examples

Constructor & Destructor Documentation

DtAutomotiveActuatorComponent::DtAutomotiveActuatorComponent ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

virtual DtAutomotiveActuatorComponent::~DtAutomotiveActuatorComponent ( )
virtual

destructor

DtAutomotiveActuatorComponent::DtAutomotiveActuatorComponent ( )
private

Default constructor; not implemented.

DtAutomotiveActuatorComponent::DtAutomotiveActuatorComponent ( const DtAutomotiveActuatorComponent orig)
private

Copy constructor; not implemented.

Member Function Documentation

virtual bool DtAutomotiveActuatorComponent::init ( )
virtual

Calls createPSR() to create our process state repository.

Reimplemented from DtActuatorComponent.

Reimplemented in MyActuatorComponent.

virtual DtString DtAutomotiveActuatorComponent::type ( ) const
virtual

Returns a string identifies the class type of component.

Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.

Returns
DtAutomotiveActuatorType

Reimplemented from DtSimComponent.

Reimplemented in MyActuatorComponent.

virtual void DtAutomotiveActuatorComponent::tick ( )
virtual

Calculate new kinematic state.

Reimplemented from DtSimComponent.

Reimplemented in MyActuatorComponent.

static DtSimComponent* DtAutomotiveActuatorComponent::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
static

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns
New instance of this class.

Reimplemented in MyActuatorComponent.

virtual double DtAutomotiveActuatorComponent::maxSpeedSoilFactor ( ) const
protectedvirtual
Returns
Max speed factor (0-1.) for the current terrain.
virtual double DtAutomotiveActuatorComponent::accelSoilFactor ( ) const
protectedvirtual
Returns
Acceleration factor (0-1.) for the current terrain.
virtual double DtAutomotiveActuatorComponent::decelSoilFactor ( ) const
protectedvirtual
Returns
Deceleration factor (0-1.) for the current terrain.
virtual DtSoilFactors* DtAutomotiveActuatorComponent::soilFactors ( ) const
protectedvirtual
Returns
Ptr to the soil factors instance in the entity's parameter entry.
NULL if the entity is on unspecified type terrain.
virtual bool DtAutomotiveActuatorComponent::disableControl ( )
protectedvirtual

Checks if another components needs to disable the movement actuator Currently the DI-Guy controller does this so that it can keep the entity insynch with the animation it's DI-Guy representation is performing.

virtual void DtAutomotiveActuatorComponent::useFuel ( double  fuelUsed)
protectedvirtual

Looks up the resource named “fuel” in the entity’s Resource Manager.

If the resource is not found, useFuel() just returns. If the resource is found, the amount of fuel passed as the argument to useFuel() is deducted from the resource. When the resource reaches 0, a warning is printed (using DtWarn).

Parameters
fuelUsedAmount of fuel to deplete.
virtual double DtAutomotiveActuatorComponent::fuelLeft ( ) const
protectedvirtual

Looks up the resource named “fuel” in the entity’s Resource Manager.

If the resource is not found, it returns an appropriately large constant to implement unlimited fuel. Otherwise, the value of the resource is returned.

Returns
Amount of fuel resource still available.
virtual void DtAutomotiveActuatorComponent::updateRepository ( const DtVector localPosition,
const DtVector localVelocity,
const DtVector localAcceleration,
const DtTaitBryan &  localOrientation,
const DtVector rotationalVelocity,
double  newHeading 
)
protectedvirtual

Updates the local state repository: It places the position, velocity, acceleration, and orientation arguments into the local repository.

It puts the heading into the repository. It calculates the current speed from the velocity vector passed and sets that value in the local repository. It calculates the distance traveled this frame (speed * dT) and uses that and the fuel consumption ground vehicle parameter to determine the fuel used, and then calls useFuel().

Parameters
localPositionPosition in local (database) coordinates in meters.
localVelocityVelocity in local (database) coordinates in meters/second.
localVelocityVelocity in local (database) coordinates in meters/second/second.
localOrientationLocal orientation of entity in radians.
rotationalVelocityIn radians/second.
newHeadingIn radians.
virtual double DtAutomotiveActuatorComponent::calculateMaxDecelerationFromFriction ( const DtVector oldBodyVelocity)
protectedvirtual

Calculates the maximum possible deceleration resulting from friction for the current tick.

This value is always non-negative, regardless of the direction of movement, but is proportional to the speed.

Returns
The return value of calculateDecelerationFromSoilType().
virtual double DtAutomotiveActuatorComponent::calculateMaxDecelerationFromBrake ( double  brake)
protectedvirtual
Returns
The maximum possible deceleration resulting from the current application of the brake for this thick. This value is always non-negative, regardless of direction of movement. Takes into account deceleration soil factors.
virtual double DtAutomotiveActuatorComponent::calculateAccelerationFromEngine ( double  throttle,
DtAutoTransmissionGear  gear 
)
protectedvirtual
Returns
The acceleration resulting from the internal engine systems of this entity. Result is signed, with positive being body-forward acceleration and negative body-reverse. Calls calculateMaxAcceleration() and modifies that based on the current gear and throttle settings.
virtual double DtAutomotiveActuatorComponent::calculateDecelerationFromSoilType ( const DtVector oldBodyVelocity)
protectedvirtual

Calculates the amount of deceleration caused by movement over the current soil type.

If the entity is moving, the the deceleration component is calculated according to: deceleration = (currentSpeed / maxSpeedOnSoil)^2 * actualMaxAcceleration * (1-accelSoilFactor());

Note
Always returns non-negative value.
Parameters
oldBodyVelocityBody velocity from previous tick (in meters/second).
virtual double DtAutomotiveActuatorComponent::calculateAccelerationFromSlope ( double  slope)
protectedvirtual
Returns
The acceleration resulting from the specified slope. Accounts for the soil type and the entity's maxSlope. Returned acceleration is max-acceleration (for the current soil type) at the entity's max-slope.
Note
Returns a signed value, representing body-forard and body-reverse.
virtual void DtAutomotiveActuatorComponent::calculateOrientationAndPosition ( const DtVector newLocalProjectedLocation,
double  newHeading,
DtDcm &  newLocalOrientation,
DtVector newLocalPosition 
)
protectedvirtual

Calculates the orientation and position of the entity, given a new location and heading.

Checks for intersections with the terrain, to determine altitude and orientation (from support points) from 1/4 of the height of the entity's bounding volume as a rough approximation of the entity's wheel's or tread (or knees).

Returns
nothing, but sets the specified orientation and position appropriately.
Note
As a side effect, this also fills in the soil type, position, and altitude information of the groundCenter of the vrfObject. This is done through the placePoints() call from the state repository.
virtual bool DtAutomotiveActuatorComponent::useHighFidelityGroundClamping ( ) const
protectedvirtual
Returns
a boolean signifying whether or not to use high fidelity ground clamping when calculating the orientation of the entity.
Note
it currently just returns the value of the user specified parameter in the automotivePSR, which defaults to true.
bool DtAutomotiveActuatorComponent::groundClamp ( double  heading,
const DtVector location,
DtAttachedTerrain terrain,
DtVector newNormal 
)
protected

Clamps the entity to the ground at the specified location, and determines the normal of the plane the entity is on at that location.

Returns
a boolean indicating success or failure in performing the ground clamping and determining the new normal.
Note
As a side effect of this function, the soil type in the center ground interaction point is set.

The type of ground clamping also depends on the entity's configuration. Either high or low fidelity ground clamping is performed as specified.

See Also
groundClampHighFidelity
groundClampLowFidelity
void DtAutomotiveActuatorComponent::groundClampHighFidelity ( double  heading,
const DtVector location,
DtAttachedTerrain terrain,
DtVector newNormal 
)
protected

Uses all four ground interaction points to determine the plane of the entity and the soil type.

The left, right, and other support points are used to determine the plane, and the returned normal is the normal to that plane.

void DtAutomotiveActuatorComponent::groundClampLowFidelity ( double  heading,
const DtVector location,
DtAttachedTerrain terrain,
DtVector newNormal 
)
protected

Uses only the center ground interaction point.

The normal is the normal of the polygon on which the center point sits. And the soil type is also the polygon's. This requires fewer intersection tests with the terrain, but also may return an incorrect normal if the entity is sitting across several polygons.

virtual double DtAutomotiveActuatorComponent::calculateHeading ( double  oldHeading,
const DtVector oldBodyVelocity,
DtAutoTransmissionGear  gear,
double  steering,
double  throttle,
double  dT 
)
protectedvirtual

Determines the new heading given the old heading, the velocity, gear, steering, throttle, and time delta.

Returns
The new heading value.
virtual DtVector DtAutomotiveActuatorComponent::calculateBodyAcceleration ( double  throttle,
DtAutoTransmissionGear  gear,
double  brake,
const DtVector oldBodyVelocity,
double  oldPitch,
double  dT 
)
protectedvirtual

Calculates the linear acceleration in body coordinates of the entity in meters/second/second.

Calls following functions for components of the acceleration: calculateAccelerationFromEngine() calculateAccelerationFromSlope() calculateMaxDecelerationFromFriction() calculateMaxDecelerationFromBrake()

virtual DtVector DtAutomotiveActuatorComponent::calculateBodyVelocity ( const DtVector oldBodyVelocity,
const DtVector newBodyAcceleration,
double  dT 
)
protectedvirtual
virtual DtVector DtAutomotiveActuatorComponent::calculateProjectedLocation ( const DtVector oldLocalPosition,
const DtVector newBodyAcceleration,
const DtVector oldBodyVelocity,
double  newHeading 
)
protectedvirtual
virtual bool DtAutomotiveActuatorComponent::checkForTerrainCollisions ( ) const
protectedvirtual
Returns
a boolean signifying whether or not the terrain should be checked for collisions with the entity's bounding volume while it moves. If this returns true, the entity will not move through the terrain. If this is false, it may move through terrain polygons, such as building walls when moving to a new location.
Note
it currently just returns the value of the user specified parameter in the automotivePSR.
virtual bool DtAutomotiveActuatorComponent::foundTerrainCollision ( double  heading,
const DtVector oldLocalPosition,
const DtVector newLocalPosition,
DtChordIntersectionRecord collisionIntersectionRecord 
) const
protectedvirtual

Checks the terrain in between the specified old and new positions, along the specified heading for any terrain intersections.

Returns
a boolean signifying whether or not a terrain collision was found. If so, a valid intersection record is returned in the user specified intersection record.
virtual bool DtAutomotiveActuatorComponent::createMovementChord ( DtChord movementChord,
double  heading,
const DtVector oldLocalPosition,
const DtVector newLocalPosition 
) const
protectedvirtual

Creates a chord along the specified heading, starting at the old position and ending at the new position, but each location is increased by the half height of the entity so that the check is done along the center of the entity's movement.

Additionally, the chord is extended in the heading direction by the half-length of the entity to ensure that collision with the front of the entity and not just the center, are detected.

Returns
a boolean signifying whether or not the chord could be created.
Note
Returns a valid chord in movementChord only if the return value is true.
virtual bool DtAutomotiveActuatorComponent::terrainPassable ( double  heading,
const DtChordIntersectionRecord terrainIntersectionRecord 
) const
protectedvirtual

Determines if the terrain referenced in the intersection record is "passable" by the entity.

Currently, just looks at the slope of the terrain. If the slope is greater than 80 degrees, the terrain is considered impassable.

virtual double DtAutomotiveActuatorComponent::calculateMaxSpeed ( )
protectedvirtual

Calculates the maximum speed for the entity, considering soil factors.

virtual double DtAutomotiveActuatorComponent::calculateMaxAcceleration ( )
protectedvirtual

Calculates the maximum acceleration for the entity, considering soil factors.

virtual DtVector DtAutomotiveActuatorComponent::calculateRotationalVelocity ( const DtDcm &  newOrientation,
const DtDcm &  oldOrientation,
double  dT 
)
protectedvirtual

Calculates rotational velocity from new and old orientation body DCMs.

Thich coordinate system is used shouldn't make a difference so long as the coordinate system is orthographic and consistent.

virtual double DtAutomotiveActuatorComponent::calculatePitch ( const DtVector localPosition,
double  heading,
const DtAttachedTerrain terrain 
)
protectedvirtual

Calculates pitch at given local position and given heading.

Finds the normal to the terrain at localPosition. The pitch is computed as pitch = - asin(normal dot headingVec), where both normal and heading vectors are normalized direction vectors.

virtual void DtAutomotiveActuatorComponent::calculateDirectionOfLinearMotion ( const DtDcm &  newLocalOrientation,
const DtVector newLocalPosition,
DtDcm &  newLocalDirectionOfLinearMotion 
)
protectedvirtual

Computes direction of linear motion.

In base class, this is equivalent to newLocalOrientation, so it sets newLocalDirectionOfLinearMotion = newLocalOrientation.

virtual double DtAutomotiveActuatorComponent::getPitchAdjustedMaxSpeed ( double  maxSpeed,
double  pitch 
) const
protectedvirtual

Computes a new maximum speed, adjusted for the current pitch of the entity.

If the pitch is less than zero 1.2 * maxSpeed is returned. For pitch >= 0, the original maxSpeed is returned.

virtual bool DtAutomotiveActuatorComponent::createPortGroups ( )
protectedvirtual

Creates the local port groups.

Reimplemented from DtSimComponent.

virtual bool DtAutomotiveActuatorComponent::createPorts ( )
protectedvirtual

Creates the input ports and adds them to the component.

Reimplemented from DtSimComponent.

virtual bool DtAutomotiveActuatorComponent::createPSR ( )
protectedvirtual

Creates myProcessState data member, and adds it to our process state repository manager.

Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.

virtual bool DtAutomotiveActuatorComponent::rotationalVelocityShouldBeClamped ( const DtVector bodyRotationalVelocity)
protectedvirtual

Returns true if given magnitude of body rotational velocity is < 0.0001 radians/sec, false otherwise.

Called in tick() to determine whether or not to clamp small values for velocity to zero.

virtual double DtAutomotiveActuatorComponent::steeringControlValue ( ) const
protectedvirtual
Returns
Value on mySteeringPort if an active connection, otherwise 0.
virtual double DtAutomotiveActuatorComponent::throttleControlValue ( ) const
protectedvirtual
Returns
Value on myThrottlePort if an active connection, otherwise 0.
virtual double DtAutomotiveActuatorComponent::brakeControlValue ( ) const
protectedvirtual
Returns
Value on myBreakPort if an active connection, otherwise 1.
virtual DtAutoTransmissionGear DtAutomotiveActuatorComponent::gearControlValue ( ) const
protectedvirtual
Returns
Value on myGearPort if an active connection, otherwise DtAutoGearForward.
virtual bool DtAutomotiveActuatorComponent::parkingBrakeControlValue ( ) const
protectedvirtual
Returns
Value on myParkingBrakePort if an active connection, otherwise false.
const DtAutomotiveActuatorComponent& DtAutomotiveActuatorComponent::operator= ( const DtAutomotiveActuatorComponent orig)
private

assignment operator; not implemented

Member Data Documentation

DtConstrainedAnalogInputPort* DtAutomotiveActuatorComponent::myThrottlePort
protected

Input Port Name: throttle
Input Port Description:
Input Port Range:
Input Port Default Value: 0
Input Group Parent:

DtConstrainedAnalogInputPort* DtAutomotiveActuatorComponent::mySteeringPort
protected

Input Port Name: steering
Input Port Description:
Input Port Range: -1.0 to 1.0
Input Port Default Value: 0
Input Group Parent:

DtConstrainedAnalogInputPort* DtAutomotiveActuatorComponent::myBrakePort
protected

Input Port Name: brake
Input Port Description:
Input Port Range: 0.0 to 1.0
Input Port Default Value: 0
Input Group Parent: automotive-control.

DtConstrainedIntegerInputPort* DtAutomotiveActuatorComponent::myGearPort
protected

Input Port Name: gear
Input Port Description:
Input Port Default Value: 0
Input Port Range: Reverse, Neutral, Forward, Pivot
Input Group Parent: automotive-control.

DtBooleanInputPort* DtAutomotiveActuatorComponent::myParkingBrakePort
protected

Input Port Name: parking-brake
Input Port Description:
Input Port Range:
Input Port Default Value: True (Brake On)
Input Group Parent: automotive-control.

DtInputPortGroup* DtAutomotiveActuatorComponent::myAutomotiveControlPortGroup
protected

Input Port Group Name: automotive-control
Input Port Group Description: Provides input to the automotive actuator (powertrain).

DtBooleanInputPort* DtAutomotiveActuatorComponent::myMovementDisableInputPort
protected

Input Port Name: movement-disable
Input Port Description: Checks to see if another component is determining the movements of the entity.

Currently just the DI-Guy controller will take control to handle any translational, directional changes that are associated with the animation task the entity is performing.
Input Port Range:
Input Port Default Value: false

DtGroundVehicleStateRepository* DtAutomotiveActuatorComponent::myGroundVehicleState
protected
DtAutomotivePSR* DtAutomotiveActuatorComponent::myProcessState
protected

Container for state data associated with this component.

This state is saved and restored as part of a scenario (or checkpoint).

const DtAutomotiveActuatorDescriptor* DtAutomotiveActuatorComponent::myAutomotiveDescriptor
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)