VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtGroundAutoControllerComponent Class Reference

DtGroundAutoControllerComponent is a base controller that holds capabilitites common to all automotive controllers.

Uses Descriptor Type: DtComponentDescriptor

Examples
Inheritance diagram for DtGroundAutoControllerComponent:
Inheritance graph
[legend]

Public Member Functions

 DtGroundAutoControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtGroundAutoControllerComponent () override
 
virtual bool init () override
 
virtual const chartype () const override
 
virtual void clearTask () override
 
virtual double computeSpeedForFastestTurn (const double latAccelLimit=0.0) const
 
virtual double speedForFastestTurn () const
 
virtual void setSpeedForFastestTurn (double speed)
 
virtual double approximateThrottle (double desiredSpeed, double headingError=0.0)
 
double speedConstraintForHeadingError (const double headingError, const double maxAccel=0.0) const
 
virtual double headingErrorRequiringMinTurnRadius () const
 
virtual double calculateSteering (double currentHeading, double desiredHeading) const
 
virtual double calculateCurrentBrakingDistance () const
 
virtual double decelerationSoilFactor () const
 
virtual double tractionFactorFromSoilAndWeather () const
 
virtual double calcSteeringForTurnInPlace ()
 
virtual double calcThrottleForTurnInPlace ()
 
virtual double calcBrakeForTurnInPlace ()
 
virtual int calcGearForTurnInPlace ()
 
virtual double calcSteeringForPivot ()
 
virtual double calcThrottleForPivot ()
 
virtual double calcSteeringForKTurn ()
 
virtual double calcThrottleForKTurn ()
 
virtual double calcBrakeForKTurn ()
 
virtual double findSpeedForKTurn ()
 
virtual double findHeadingForKTurn ()
 
virtual void setHeadingToTurnTo (double headingToTurnTo)
 
virtual double headingToTurnTo () const
 
virtual double calculateHeadingToTurnTo ()
 
virtual void setTurnToMode (int headingToTurnTo)
 
virtual int turnToMode () const
 
virtual void setKTurnReverseGoalHeading (double kTurnReverseGoalHeading)
 
virtual double kTurnReverseGoalHeading () const
 
virtual void setKTurnReverseComplete (bool kTurnReverseComplete)
 
virtual bool kTurnReverseComplete () const
 
virtual DtAutomotivePSRprocessState () const
 
Acceleration level constants

Standard acceleration values for vehicles. Used for lateral, forward, and braking acceleration. These are absolutes, not based on vehicle performance parameters (except that they are limited by vehicle maximums); they relate to the comfort level of passengers in cars.

0.15 g

virtual double mildAccelerationConstant () const
 
virtual double standardAccelerationConstant () const
 
virtual double hardAccelerationConstant () const
 
virtual double maxAccelerationConstant () const
 
virtual double currentAccelerationToUse () const
 
Port Functions
virtual bool createAutomotiveControlPortGroup ()
 
virtual bool createThrottlePort ()
 
virtual bool createSteeringPort ()
 
virtual bool createBrakePort ()
 
virtual bool createGearPort ()
 
virtual bool createParkingBrakePort ()
 
virtual
DtConstrainedAnalogOutputPort
throttlePort ()
 
virtual
DtConstrainedAnalogOutputPort
steeringPort ()
 
virtual
DtConstrainedAnalogOutputPort
brakePort ()
 
virtual
DtConstrainedIntegerOutputPort
gearPort ()
 
virtual DtBooleanOutputPortparkingBrakePort ()
 
virtual void setThrottleFromAcceleration (const double signedAccel)
 
- Public Member Functions inherited from DtSingleTaskControllerComponent
 DtSingleTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtSingleTaskControllerComponent () override
 
virtual void postTick () override
 
virtual bool beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState) override
 
virtual void taskNotify (const DtSimTask &task) override
 
virtual void taskComplete (bool success=true)
 
virtual void suspendTask ()
 
virtual int sendSubtask (DtSimTask &task)
 
virtual void clearSubtask (int subtaskId)
 
virtual void addPendingSubtaskId (int subtaskId)
 
virtual bool findPendingSubtaskId (int subtaskId)
 
virtual bool isSubtasked () const
 
virtual void removePendingSubtaskId (int subtaskId)
 
virtual void removeAllPendingSubtaskIds ()
 
virtual std::vector< intcurrentPendingSubstaskIds () const
 
virtual DtSubtaskStatusEntrysubtaskStatus (int subtaskId)
 
virtual void clearCurrentTaskMessage ()
 
virtual DtTaskMessagecurrentTaskMessage () const
 
virtual DtSimTaskStatePtr currentTaskState () const
 
virtual void giveUpTask ()
 
virtual bool taskActive (int taskId) const override
 
virtual bool clearTopLevelTasks () override
 
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType) override
 
virtual void clearTasksByType (const DtSimTaskMessageType &taskType) override
 
virtual void clearTaskById (int taskId) override
 
virtual DtSuspendedTaskInfosuspendTaskById (int taskId) override
 
virtual DtSuspendedTaskInfosuspendSubtaskById (int taskId, int subtaskId) override
 
virtual std::list
< DtTaskMessage * > 
currentTaskMessages () const override
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const override
 
virtual void disable () override
 
virtual void updateImgui () override
 
virtual void initializeTaskInformationStateProperty (const DtSimTaskMessageType &taskType)
 
virtual void updateCurrentTaskInformationStatusProperty (const DtString &status)
 
virtual DtString taskInformationStatusPropertyValue (const DtSimTaskMessageType &taskType) const
 
virtual DtString currentTaskInformationStatusPropertyValue () const
 
virtual DtRwPropertiesStructuretaskInformationProperty (const DtSimTaskMessageType &taskType)
 
virtual DtRwPropertiesStructurecurrentTaskInformationProperty ()
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtTaskControllerComponent () override
 
virtual AcceptLevel acceptTask (const DtTaskMessage &task)
 
virtual bool showCurrentTaskInGui () const
 
virtual void setRadio (DtSimRadio *radio) override
 
virtual void registerTaskMsgCallbacks ()
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void enable () override
 
virtual void sendTaskCanceled (DtTaskMessage *taskMsg)
 
virtual bool taskVisualizationsActive () const override
 
virtual void setTasked (bool tasked)
 
virtual bool tasked () const
 
- Public Member Functions inherited from DtControllerComponent
 DtControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtControllerComponent () override
 
virtual DtSimRadioradio ()
 
virtual void enableTaskTypes ()
 
virtual void enableScriptedTask (const DtString &scriptId)
 
virtual void disableTaskTypes ()
 
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSimComponent () override
 
virtual void setParentSystem (DtComponentSystem *system)
 
DtComponentSystemparentSystem () const
 
virtual void registerAttributeFunctions ()
 
virtual void preFirstTickInit ()
 
virtual void tick ()
 
virtual void timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod, double minTickPeriodVariance)
 
virtual void setupFirstTickTime ()
 
virtual void setEntity (DtLocalObject *entity)
 
virtual DtSimComponentnextComponent ()
 
virtual DtSimComponentprevComponent ()
 
virtual void setListItem (DtListItem *item)
 
virtual DtListItem * listItem ()
 
virtual void putData (std::string &fp, int indentLevel=0) override
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override
 
virtual void addInputPort (DtInputPort *port)
 
virtual void removeInputPort (DtInputPort *port)
 
virtual DtInputPortlookupInputPort (const DtString &portName)
 
virtual DtList inputPortList () const
 
virtual void addOutputPort (DtOutputPort *port)
 
virtual void removeOutputPort (DtOutputPort *port)
 
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 
virtual DtList outputPortList () const
 
virtual void addInputPortGroup (DtInputPortGroup *group)
 
virtual void removeInputPortGroup (DtInputPortGroup *group)
 
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 
virtual DtList inputPortGroupList () const
 
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
 
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 
virtual DtList outputPortGroupList () const
 
virtual int priority () const
 
virtual void setPriority (int priority)
 
double dT () const
 
virtual void setDT (double deltaT)
 
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 
virtual const
DtComponentDescriptor
componentDescriptor () const
 
virtual bool tickWhileDestroyed () const
 
DtVrfProcessStateRepositoryManagerpsrManager ()
 
virtual const DtSymbolStringcomponentFullName () const
 
DtPhysicalWorldphysicalWorld ()
 
const DtPhysicalWorldphysicalWorld () const
 
const DtAttachedTerrainterrainAttachedTo () const
 
DtLocalObjectentity ()
 
const DtLocalObjectentity () const
 
DtSimulationServicessimulationServices ()
 
const DtSimulationServicessimulationServices () const
 
const Coordinate_SystemcoordinateSystem () const
 
virtual void isClutterChanged ()
 
virtual bool taskVisualizationsEnabled () const
 
makVrf::DtTaskVisualizationMaptaskVisualizations ()
 
virtual bool debugActive () const
 
virtual bool isEnabled ()
 
virtual void setIsEnabled (bool yesNo)
 
virtual DtOutputStream & objectConsoleDebug (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleVerbose (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleInfo (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleWarn (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleError (const DtString &channel="") const
 
virtual int notifyLevel () const
 
virtual DtSimResourceManagerresourceManager ()
 
virtual const
DtSimResourceManager
resourceManager () const
 
VRF4API_METHOD const
DtSimulationServices
simManager () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs) const
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual void reset ()
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charreaderWriterType () const
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Protected Member Functions

virtual bool createPorts () override
 
virtual bool createPortGroups () override
 
virtual void lookupAndCacheProcessSR ()
 
virtual bool postAddComponentsInit () override
 
virtual const DtSoilFactorscurrentSoilFactors () const
 
virtual bool decideToGiveUpTask () const override
 
- Protected Member Functions inherited from DtSingleTaskControllerComponent
virtual void clearPendingSubtasks ()
 
virtual void clearSubtasksByType (const DtSimTaskMessageType &taskType)
 
virtual void cleanupInactiveSubtaskStatus ()
 
- Protected Member Functions inherited from DtTaskControllerComponent
virtual void suspendSubtasksOfTask (int taskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual void suspendSubtaskOfTask (int taskId, int subtaskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual DtSimTaskMessageType remapScriptId (const DtSimTaskMessageType &) const
 
- Protected Member Functions inherited from DtControllerComponent
 DtControllerComponent ()
 
 DtControllerComponent (const DtControllerComponent &orig)
 
const DtControllerComponentoperator= (const DtControllerComponent &orig)
 
virtual void onRestore () override
 
virtual void initializeTargetingControlTableFromDescriptor (const DtReaderWriter *)
 
virtual void sendCapableSetsAndTasks ()
 
- Protected Member Functions inherited from DtSimComponent
virtual void setupTimedTickLogic (double minTickPeriod, double minTickPeriodVariance)
 
virtual double computeCurrentTime ()
 
bool testInvariant () const
 
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 
virtual void updateTaskVisualizations ()
 
virtual void destroyTaskVisualizations ()
 
virtual void destroyTaskVisualization (const DtString &name)
 
virtual
makVrf::DtPointTaskVisualizationPtr 
pointTaskVisualization (const DtString &name)
 
virtual
makVrf::DtLineTaskVisualizationPtr 
lineTaskVisualization (const DtString &name)
 
virtual
makVrf::DtAreaTaskVisualizationPtr 
areaTaskVisualization (const DtString &name)
 
virtual
makVrf::DtTextTaskVisualizationPtr 
textTaskVisualization (const DtString &name)
 
double calculateNextTaskVisTickTime () const
 
DtVrfObjectStateRepositorylocalStateRepository ()
 
const DtVrfObjectStateRepositorylocalStateRepository () const
 
DtPropertyInterfacecachedNextFrameStateProperty (DtPropertyInterface **prop, const DtString &propName)
 
template<typename ValType >
void setCachedNextFrameStatePropertyValue (DtPropertyInterface **prop, const DtString &propName, ValType value)
 
const DtPropertyInterfacecachedCurrentFrameStateProperty (const DtPropertyInterface **prop, const DtString &propName) const
 
template<typename ValType >
bool getCachedCurrentFrameStatePropertyValue (const DtPropertyInterface **prop, const DtString &propName, ValType &value) const
 
void addSimObjectPredicateCallback (DtSimObjectReference, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void removeSimObjectPredicateCallback (const DtSimObject *, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void invokeSimObjectPredicateCallbacks ()
 
virtual void clearPredicateCallbacks ()
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

DtGroundVehicleStateRepositorymyGroundVehicleState
 
DtAutomotivePSRmyProcessState
 
double mySpeedLastTick
 
double myAccumulatedSpeedError
 
double mySpeedForFastestTurn
 
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
 
bool myHaveWarnedAboutNoPivotSpeed
 
Ports and Port Groups
DtConstrainedAnalogOutputPortmyThrottlePort
 
DtConstrainedAnalogOutputPortmySteeringPort
 
DtConstrainedAnalogOutputPortmyBrakePort
 
DtConstrainedIntegerOutputPortmyGearPort
 
DtBooleanOutputPortmyParkingBrakePort
 
DtOutputPortGroupmyAutomotiveControlPortGroup
 
- Protected Attributes inherited from DtTaskControllerComponent
DtTaskCallbackMap myTaskCallbackMap
 
std::list
< DtTaskProcessorCallbackInfo * > 
myTaskProcessorCallbackInfoList
 
bool myTaskIsRunning
 
- Protected Attributes inherited from DtControllerComponent
DtSimRadiomyRadio
 
bool myTaskTypesEnabled
 
bool myInitialized
 
- Protected Attributes inherited from DtSimComponent
DtLocalObjectmyEntity
 
DtComponentSystemmySystem
 
DtListItem * myListItem
 
DtInputPortMap myInputPortList
 
DtOutputPortMap myOutputPortList
 
DtInputPortGroupMap myInputPortGroupList
 
DtOutputPortGroupMap myOutputPortGroupList
 
int myPriority
 
double myLastTickSimTime
 
std::unique_ptr< DtTimedTickLogicmyTimedTickLogic
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManagermyPredicateCallbackManager
 
boost::signals2::scoped_connection myIsClutterChangedConnection
 
bool myLocalDebug
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Private Member Functions

 DtGroundAutoControllerComponent ()
 
 DtGroundAutoControllerComponent (const DtGroundAutoControllerComponent &orig)
 
const
DtGroundAutoControllerComponent
operator= (const DtGroundAutoControllerComponent &orig)
 
virtual void processSetSpeed (DtSimMessage *msg)
 
static void setSpeedCallback (DtSimMessage *msg, void *usrData)
 

Additional Inherited Members

- Public Types inherited from DtTaskControllerComponent
enum  AcceptLevel { AcceptLevel_Accept = 0, AcceptLevel_Partial = 1, AcceptLevel_Error = 2, AcceptLevel_NoAccept = 99 }
 
- 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::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 
- Static Public Member Functions inherited from DtTaskControllerComponent
static void deprecatedTaskProcessorCallbackAdapter (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
 
- Static Public Member Functions inherited from DtSimComponent
static DtSimComponentFactoryfactory ()
 
static void setFactory (DtSimComponentFactory *factory)
 
static DtSimComponentcreateComponent (const DtString &name, const DtString &type, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentSystem *parentSystem, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
static void addSimComponentCreatorFcn (const DtString &type, DtSimComponentCreatorFcn fcn)
 
static VRF4API_METHOD
DtSimComponent
MarkThreadSafe (DtSimComponent *comp)
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 
- Public Attributes inherited from DtSingleTaskControllerComponent
const DtString TaskStatusRunning = "TaskRunning"
 
const DtString TaskStatusNotActive = "TaskNotActive"
 
- Protected Types inherited from DtTaskControllerComponent
typedef std::pair
< DtTaskMessageCallbackFcn,
void * > 
DtTaskCallbackMapPair
 
typedef std::map
< DtSimTaskMessageType,
DtTaskCallbackMapPair
DtTaskCallbackMap
 
- 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
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Constructor & Destructor Documentation

DtGroundAutoControllerComponent::DtGroundAutoControllerComponent ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject 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).
virtual DtGroundAutoControllerComponent::~DtGroundAutoControllerComponent ( )
overridevirtual

destructor

DtGroundAutoControllerComponent::DtGroundAutoControllerComponent ( )
private

default constructor; not implemented

DtGroundAutoControllerComponent::DtGroundAutoControllerComponent ( const DtGroundAutoControllerComponent orig)
private

copy constructor; not implemented

Member Function Documentation

virtual bool DtGroundAutoControllerComponent::init ( )
overridevirtual
virtual const char* DtGroundAutoControllerComponent::type ( ) const
overridevirtual

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. Warning: this function should always return the same pointer and it should be valid forever. This means the data should be static.

Returns
DtGroundAutoMovementControllerType

Implements DtTaskControllerComponent.

Reimplemented in DtGroundMoveToDestinationControllerComponent, DtGroundManeuverInFormationControllerComponent, DtRetreatController, DtGroundMoveToControllerComponent, DtGroundFollowEntityController, DtGroundStopMovingControllerComponent, DtGroundFollowInFormationControllerComponent, DtGroundPatrolRouteController, DtGroundTurnToControllerComponent, DtGroundMoveAlongControllerComponent, DtGroundLeadFormationControllerComponent, and DtGroundJoyMoveController.

virtual void DtGroundAutoControllerComponent::clearTask ( )
overridevirtual
virtual double DtGroundAutoControllerComponent::mildAccelerationConstant ( ) const
virtual

0.35 g

virtual double DtGroundAutoControllerComponent::standardAccelerationConstant ( ) const
virtual

0.35 g

virtual double DtGroundAutoControllerComponent::hardAccelerationConstant ( ) const
virtual

0.7 g

virtual double DtGroundAutoControllerComponent::maxAccelerationConstant ( ) const
virtual

Limited only by vehicle parameters.

virtual double DtGroundAutoControllerComponent::currentAccelerationToUse ( ) const
virtual

Returns the acceleration for maneuver control planning that corresponds to the level set in the PSR. If an acceleration level has not been set, this defaults to standardAccelerationConstant.

virtual double DtGroundAutoControllerComponent::computeSpeedForFastestTurn ( const double  latAccelLimit = 0.0) const
virtual

The turn rate of a vehicle, i.e. rotation rate, increases with increasing speed and decreasing turn radius: w = accel(lateral) / v. Therefore the maximum turn rate is achieved at minimal speed and turn radius. However, steering vehicles have a minimum turn radius, so the highest turn rate is achieved using this turn radius at the highest speed that maximum lateral acceleration allows. This function computes the maximum speed the vehicle can drive given its maximum lateral acceleration and minimum turn radius.
If the entity can pivot, and/or the minimum turn radius is less than the half-width of the entity, then this controller will assume that the entity pivots, i.e. skid-steers, and use the max pivot rate as the turn rate. If the max pivot rate is less than the turn rate when r = halfWidth, then the speed computed here is for r = halfWidth.
This function is used at the beginning of the tick to set mySpeedForFastestTurn. This value is used in approximateThrottle() when the heading error is >= headingErrorRequiringMinTurnRadius().

Parameters
latAccelLimitThe lateral acceleration limit to use for the calculation. If <= 0.0, then the entity maximum lateral acceleration parameter is used.
virtual double DtGroundAutoControllerComponent::speedForFastestTurn ( ) const
virtual

Accesses mySpeedForFastestTurn. This value is computed in the tick function using the compute function, and thus is available for other functions during the tick through this accessor.

virtual void DtGroundAutoControllerComponent::setSpeedForFastestTurn ( double  speed)
virtual
virtual double DtGroundAutoControllerComponent::approximateThrottle ( double  desiredSpeed,
double  headingError = 0.0 
)
virtual

ApproximateThrottle computes a value between -1 and 1 that represents the desired, normalized acceleration. The calling function should treat negative values as (positive) brake output.
This control function gets the current gear setting, the current forward speed, current throttle setting, the speed last tick, and dT as further input. If the gear is Reverse, then the desiredSpeed and currentSpeed are negated so that the throttle value computed will end up being positive to move the vehicle. The function then considers two cases:

  • Desired speed is 0 or in the opposite direction from the current drive direction: throttle is full brake (-1)
  • Otherwise, use proportional-derivative control using speed error and delta speed error/dt as inputs.
    Calls speedConstraintForLargeHeadingError to produce a behavior where speed is limited below desiredSpeed if necessary in order to use a higher turning rate (i.e., smaller radius of turn).
    Parameters
    desiredSpeedIf negative, this means that the vehicle wants to travel in reverse.
    headingErrorIn radians.
    Returns
    Throttle value between -1 and 1. Note that PID state is updated.

Reimplemented in DtGroundMoveToDestinationControllerComponent.

double DtGroundAutoControllerComponent::speedConstraintForHeadingError ( const double  headingError,
const double  maxAccel = 0.0 
) const

Computes a speed constraint due to the heading error, with the aim of producing a higher turn rate (rad/s) if the heading error is high. A higher turn rate is achieved with a small turn radius, so this speed constraint allows the vehicle to use a minimum turn radius given its maximum lateral acceleration parameter. This function uses headingErrorRequiringMinTurnRadius() to determine when the minimum turn radius should be used.

Parameters
headingErrorThe magnitude of the heading error (desired - current) in radians.
maxAccelThe maximum lateral acceleration to use in turning to change heading. If <= 0.0, the entity maximum lateral acceleration parameter is used.
Returns
The maximum speed magnitude in m/s.
virtual double DtGroundAutoControllerComponent::headingErrorRequiringMinTurnRadius ( ) const
inlinevirtual
virtual double DtGroundAutoControllerComponent::calculateSteering ( double  currentHeading,
double  desiredHeading 
) const
virtual

Computes a steering output [-1, 1] to steer from the current heading to the desired heading. The steering output is maximum (1 or -1) when the desired turning radius is the minimum turning radius for the vehicle.
The vehicle will attempt to use the minimum turning radius unless that would exceed the maxLateralAcceleration for the vehicle at its current speed. In that case, the vehicle steers the smallest radius it can at maxLateralAcceleration.

virtual double DtGroundAutoControllerComponent::calculateCurrentBrakingDistance ( ) const
virtual
virtual bool DtGroundAutoControllerComponent::createAutomotiveControlPortGroup ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual bool DtGroundAutoControllerComponent::createThrottlePort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual bool DtGroundAutoControllerComponent::createSteeringPort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual bool DtGroundAutoControllerComponent::createBrakePort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual bool DtGroundAutoControllerComponent::createGearPort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual bool DtGroundAutoControllerComponent::createParkingBrakePort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::throttlePort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::steeringPort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::brakePort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual DtConstrainedIntegerOutputPort* DtGroundAutoControllerComponent::gearPort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual DtBooleanOutputPort* DtGroundAutoControllerComponent::parkingBrakePort ( )
virtual

These are called in init to create the ports used to communicate with the actuator.

virtual void DtGroundAutoControllerComponent::setThrottleFromAcceleration ( const double  signedAccel)
virtual

Sets the the throttle AND brake port values from a single signed acceleration value. Ie if signedAccel is negative, throttle will be 0 and brake will be between 0 and 1.

virtual double DtGroundAutoControllerComponent::decelerationSoilFactor ( ) const
virtual
virtual double DtGroundAutoControllerComponent::tractionFactorFromSoilAndWeather ( ) const
virtual

Gets the soil type from current location, then looks up the stopping (traction) factor. Then looks up weather and makes some guesses as to the effects (does not replicate the computation that is used for the actuator; that would be more perfect, but maybe not realistic. And it should be put in a common place like the SR then, not the actuator). This information is useful in setting speed targets etc., considering how fast the vehicle can decelerate.

virtual double DtGroundAutoControllerComponent::calcSteeringForTurnInPlace ( )
virtual

calcSteering() calculates steering values for executing either a pivot or a (reverse) k turn. An outside automotive controller could use this function in conjunction with calcThrottle() and calcGear() to effect turns as part of some other maneuver. An outside caller can ignore the last 2 arguments if it knows the entity is pivot-capable.

virtual double DtGroundAutoControllerComponent::calcThrottleForTurnInPlace ( )
virtual

calcThrottle() calculates throttle values for executing either a pivot or a (reverse) k turn. An outside caller can ignore the last argument if it knows the entity is pivot-capable.

virtual double DtGroundAutoControllerComponent::calcBrakeForTurnInPlace ( )
virtual

If the vehicle can pivot, 0.0 is returned and otherwise a call to calcBrakeForKTurn() is returned.

virtual int DtGroundAutoControllerComponent::calcGearForTurnInPlace ( )
virtual

calcGear() determines the correct gear setting for executing either a pivot or (reverse) k turn. So that it may be used from outside the controller, a writable flag is passed to indicate whether, in the case of a k turn being executed, the first part of the maneuver has been completed. The tick() method calls this routine using the myProcessState->myKTurnReverseComplete member, but outside callers should maintain this value across simulation frames.

virtual double DtGroundAutoControllerComponent::calcSteeringForPivot ( )
virtual

calcSteeringForPivot() determines an appropriate steering value for executing a pivot turn. This is called by calcSteering() for pivot-capable entities

virtual double DtGroundAutoControllerComponent::calcThrottleForPivot ( )
virtual

calcThrottleForPivot() determines an appropriate throttle value for executing a pivot turn. This is called by calcThrottle() for pivot-capable entities

virtual double DtGroundAutoControllerComponent::calcSteeringForKTurn ( )
virtual

If the entity can not pivot, then this method can be used to calculate a steering value for a (reverse) k turn. It is called by calcSteering() for non-pivot capable entities.

virtual double DtGroundAutoControllerComponent::calcThrottleForKTurn ( )
virtual

If the entity can not pivot, then this method can be used to calculate a throttle value for a (reverse) k turn. It is called by calcThrottle() for non-pivot capable entities.

virtual double DtGroundAutoControllerComponent::calcBrakeForKTurn ( )
virtual

If kTurnReverseComplete() returns true but the entity is still moving backwards, this function sets the brakes to 1.0 until the entity comes to a complete stop.

virtual double DtGroundAutoControllerComponent::findSpeedForKTurn ( )
virtual

If the entity is in the reverse phase of the k turn, the maximum reverse speed of the vehicle is returned. If the entity has turned far enough in reverse and needs to begin braking, 0.0 is returned. Otherwise if the entity has completed the reverse phase, the ordered speed of the entity is returned.

virtual double DtGroundAutoControllerComponent::findHeadingForKTurn ( )
virtual

If the entity is in the reverse phase of the k turn, kTurnReverseGoalHeading() is returned, otherwise headingToTurnTo() is returned.

virtual void DtGroundAutoControllerComponent::setHeadingToTurnTo ( double  headingToTurnTo)
virtual

Get/Set the heading we the entity has been tasked to turn to.

virtual double DtGroundAutoControllerComponent::headingToTurnTo ( ) const
virtual
virtual double DtGroundAutoControllerComponent::calculateHeadingToTurnTo ( )
virtual

The heading to turn to given the current turn mode and heaading to turn to.

virtual void DtGroundAutoControllerComponent::setTurnToMode ( int  headingToTurnTo)
virtual

Get/Set the heading turn to mode (see setHeadingRequest.h for modes)

virtual int DtGroundAutoControllerComponent::turnToMode ( ) const
virtual
virtual void DtGroundAutoControllerComponent::setKTurnReverseGoalHeading ( double  kTurnReverseGoalHeading)
virtual

Get/Set the heading that is halfway between the original heading and the heading to turn to. This is only used fore entities that are not pivot capable.

virtual double DtGroundAutoControllerComponent::kTurnReverseGoalHeading ( ) const
virtual
virtual void DtGroundAutoControllerComponent::setKTurnReverseComplete ( bool  kTurnReverseComplete)
virtual

Get/set the flag that indicates whether or not the entity has completed first half of the turn maneuver (backing up until at kTurnReverseGoalHeading())

virtual bool DtGroundAutoControllerComponent::kTurnReverseComplete ( ) const
virtual
static void DtGroundAutoControllerComponent::setSpeedCallback ( DtSimMessage msg,
void *  usrData 
)
static

If set ordered speed is received by this vehicle, revert the PSR to setUseTaskSpeed(false)

virtual void DtGroundAutoControllerComponent::processSetSpeed ( DtSimMessage msg)
virtual

If set ordered speed is received by this vehicle, revert the PSR to setUseTaskSpeed(false)

virtual DtAutomotivePSR* DtGroundAutoControllerComponent::processState ( ) const
virtual
virtual bool DtGroundAutoControllerComponent::createPorts ( )
overrideprotectedvirtual

Overridden to create the automotive ports.

Reimplemented from DtSimComponent.

Reimplemented in DtGroundMoveToDestinationControllerComponent, DtGroundMoveAlongControllerComponent, and DtGroundFollowEntityController.

virtual bool DtGroundAutoControllerComponent::createPortGroups ( )
overrideprotectedvirtual

Overridden to create myAutomotiveControlPortGroup.

Reimplemented from DtSimComponent.

Reimplemented in DtGroundMoveToDestinationControllerComponent.

virtual void DtGroundAutoControllerComponent::lookupAndCacheProcessSR ( )
protectedvirtual

This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in myProcessState. The name (if it exists) is given in the component descriptor (DtComponentDescriptor::processStateRepositoryName). If the name does not exist, it uses the appropriate default name defined in psrTypes.h. Another component is responsible for creating and destroying the process state repository.

virtual bool DtGroundAutoControllerComponent::postAddComponentsInit ( )
overrideprotectedvirtual

Calls lookupAndCacheProcessSR(), to look up our process state repository after all of the components have been created and loaded.

Reimplemented from DtControllerComponent.

Reimplemented in DtGroundManeuverInFormationControllerComponent.

virtual const DtSoilFactors* DtGroundAutoControllerComponent::currentSoilFactors ( ) const
protectedvirtual
virtual bool DtGroundAutoControllerComponent::decideToGiveUpTask ( ) const
overrideprotectedvirtual

If the entity is attached and the target of the current task is not, give up on the task.

Reimplemented from DtSingleTaskControllerComponent.

Reimplemented in DtGroundMoveToDestinationControllerComponent, DtGroundMoveAlongControllerComponent, and DerivedMoveAlongController.

const DtGroundAutoControllerComponent& DtGroundAutoControllerComponent::operator= ( const DtGroundAutoControllerComponent orig)
private

assignment operator; not implemented

Member Data Documentation

DtGroundVehicleStateRepository* DtGroundAutoControllerComponent::myGroundVehicleState
protected
DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::myThrottlePort
protected

Output Port Name: throttle
Output Port Description:
Output Port Range: 0. to 1.
Output Port Default Value:
Output Group Parent: automotive-control.

DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::mySteeringPort
protected

Output Port Name: steering
Output Port Description:
Output Port Range: -1.0 to 1.0
Output Port Default Value:
Output Group Parent: automotive-control.

DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::myBrakePort
protected

Output Port Name: brake
Output Port Description:
Output Port Range: 0. to 1.
Output Port Default Value:
Output Group Parent: automotive-control.

DtConstrainedIntegerOutputPort* DtGroundAutoControllerComponent::myGearPort
protected

Output Port Name: gear
Output Port Description:
Output Port Range:
Output Port Default Value:
Output Group Parent: automotive-control.

DtBooleanOutputPort* DtGroundAutoControllerComponent::myParkingBrakePort
protected

Output Port Name: parking-brake
Output Port Description:
Output Port Default Value: True
Output Group Parent: automotive-control.

DtOutputPortGroup* DtGroundAutoControllerComponent::myAutomotiveControlPortGroup
protected

Output Port Group Name: automotive-control
Output Port Group Description: Collection of control output for automotive entity movement controllers.

DtAutomotivePSR* DtGroundAutoControllerComponent::myProcessState
protected

Pointer to a process state repository used to store state data associated with this component. This process state repository is shared with other components. Another component is responsible for creating and destroying the process state repository. This state is saved and restored as part of a scenario (or checkpoint).

Referenced by DtGroundMoveAlongControllerComponent::getPSR().

double DtGroundAutoControllerComponent::mySpeedLastTick
protected

For derivative control in approximateThrottle. Note–not added to process state; on scenario reload, it will be initialized to 0, which may cause a tiny blip in the control output.

double DtGroundAutoControllerComponent::myAccumulatedSpeedError
protected

For integral speed control.

double DtGroundAutoControllerComponent::mySpeedForFastestTurn
protected

Caches the value computed in init() with computeSpeedForFastestTurn.

DtPlatformLocalObjectFacade DtGroundAutoControllerComponent::myPlatformLocalObjectFacade
protected
bool DtGroundAutoControllerComponent::myHaveWarnedAboutNoPivotSpeed
mutableprotected

Flag to make sure a warning is printed only the first time. Mutable so it can be modified in otherwise const methods.


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

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)