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 ()
 
virtual bool init ()
 
virtual const chartype () const
 
virtual void clearTask ()
 
virtual double computeSpeedForFastestTurn ()
 
virtual double approximateThrottle (double desiredSpeed, double headingError=0.0)
 
virtual double headingErrorRequiringMinTurnRadius ()
 
virtual double calculateSteering (double currentHeading, double desiredHeading) const
 
virtual double calculateCurrentBrakingDistance () const
 
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 double decelerationSoilFactor () 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
 
- Public Member Functions inherited from DtSingleTaskControllerComponent
 DtSingleTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtSingleTaskControllerComponent ()
 
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
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const override
 
virtual void disable () override
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtTaskControllerComponent ()
 
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 ()
 
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 ()
 
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)
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
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 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 ()
 
virtual bool createPortGroups ()
 
virtual void lookupAndCacheProcessSR ()
 
virtual bool postAddComponentsInit ()
 
virtual const DtSoilFactorscurrentSoilFactors () const
 
virtual bool decideToGiveUpTask () const
 
- 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 ()
 
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
 
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
 
- 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)
 
- 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 ( )
virtual

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 ( )
virtual
virtual const char* DtGroundAutoControllerComponent::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. 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 DtGroundCollisionAvoidanceController, DtGroundMoveToDestinationControllerComponent, DtRetreatController, DtGroundMoveToControllerComponent, DtGroundFollowEntityController, DtGroundStopMovingControllerComponent, DtGroundFollowInFormationControllerComponent, DtGroundPatrolBetweenController, DtGroundPatrolRouteController, DtGroundTurnToControllerComponent, DtGroundMoveAlongControllerComponent, DtGroundLeadFormationControllerComponent, DtGroundMoveToLocationControllerComponent, and DtGroundJoyMoveController.

virtual void DtGroundAutoControllerComponent::clearTask ( )
virtual
virtual double DtGroundAutoControllerComponent::computeSpeedForFastestTurn ( )
virtual

In general, the fastest turn–i.e. rotation rate–given a maximum lateral acceleration limit, is achieved at minimum turn radius. Lateral acceleration also limits the turn radius, so a slower speed increases the turn rate:
rotation rate = lateral acceleration / speed
This function provides this speed for the entity, given the lateral acceleration limit and the minimum turn radius.
However, 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 in init() to set mySpeedForFastestTurn. This value is used in approximateThrottle() when the heading error is >= headingErrorRequiringMinTurnRadius().

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 forward speed, current throttle setting, the speed last tick, and dT as further input. It considers several cases:

  • Desired speed 0 or in the opposite direction from the current drive direction: full brake (-1)
  • Otherwise, use proportional-derivative control using speed error and delta speed error/dt as inputs.
    headingError limits the desiredSpeed such that if fabs(headingError) > E, desiredSpeed is no bigger than sqrt(max lateral acceleration * min turn radius). This constraint is applied gradually as headingError increases from 0 to E.
    E is given by the function headingErrorRequiringMinTurnRadius.
    The throttle value (positive) is constrained by an acceleration limit that is determined by

Reimplemented in DtGroundMoveToDestinationControllerComponent.

virtual double DtGroundAutoControllerComponent::headingErrorRequiringMinTurnRadius ( )
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
virtual bool DtGroundAutoControllerComponent::createSteeringPort ( )
virtual
virtual bool DtGroundAutoControllerComponent::createBrakePort ( )
virtual
virtual bool DtGroundAutoControllerComponent::createGearPort ( )
virtual
virtual bool DtGroundAutoControllerComponent::createParkingBrakePort ( )
virtual
virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::throttlePort ( )
virtual
virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::steeringPort ( )
virtual
virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::brakePort ( )
virtual
virtual DtConstrainedIntegerOutputPort* DtGroundAutoControllerComponent::gearPort ( )
virtual
virtual DtBooleanOutputPort* DtGroundAutoControllerComponent::parkingBrakePort ( )
virtual
virtual double DtGroundAutoControllerComponent::decelerationSoilFactor ( ) const
virtual
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 bool DtGroundAutoControllerComponent::createPorts ( )
protectedvirtual
virtual bool DtGroundAutoControllerComponent::createPortGroups ( )
protectedvirtual

Overridden to create myAutomotiveControlPortGroup.

Reimplemented from DtSimComponent.

Reimplemented in DtGroundMoveToDestinationControllerComponent, and DtGroundCollisionAvoidanceController.

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 procSRTypes.h. Another component is responsible for creating and destroying the process state repository.

virtual bool DtGroundAutoControllerComponent::postAddComponentsInit ( )
protectedvirtual

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

Reimplemented from DtControllerComponent.

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

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 DerivedMoveToController.

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

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

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)