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

DtHumanFollowController is a controller that models following behavior for humans.

Developer Description: Each simulation frame the destination to which the entity moves is recalculated to be in the right place with respect to the followed entity.

Uses Descriptor Type: DtHumanFollowControllerDescriptor

Inheritance diagram for DtHumanFollowController:
Inheritance graph
[legend]

Public Member Functions

 DtHumanFollowController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtHumanFollowController ()
 
virtual const chartype () const
 
virtual bool init ()
 
virtual bool createPSR ()
 
virtual void tick ()
 
virtual void processFollowEntityTask (DtSimMessage *msg)
 
virtual DtUUID entityToFollow ()
 
virtual void setEntityToFollow (const DtUUID &entity)
 
virtual const DtVectoroffsetVector () const
 
virtual void setOffsetVector (const DtVector &offsets)
 
virtual void registerTaskMsgCallbacks ()
 
virtual bool setupDestination ()
 
virtual bool passedDestination ()
 
virtual double findDesiredSpeed ()
 
virtual double findDesiredHeading ()
 
virtual void stop ()
 
virtual void clearTask ()
 
- Public Member Functions inherited from DtSingleTaskControllerComponent
 DtSingleTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSingleTaskControllerComponent ()
 
virtual void postTick ()
 
virtual bool beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState)
 
virtual void taskNotify (const DtSimTask &task)
 
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 void clearCurrentTaskMessage ()
 
virtual DtTaskMessagecurrentTaskMessage () const
 
virtual DtSimTaskStatePtr currentTaskState () const
 
virtual bool decideToGiveUpTask () const
 
virtual void giveUpTask ()
 
virtual bool taskActive (int taskId) const
 
virtual bool clearTopLevelTasks ()
 
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType)
 
virtual void clearTasksByType (const DtSimTaskMessageType &taskType)
 
virtual void clearTaskById (int taskId)
 
virtual DtSuspendedTaskInfosuspendTaskById (int taskId)
 
virtual DtSuspendedTaskInfosuspendSubtaskById (int taskId, int subtaskId)
 
virtual std::list
< DtTaskMessage * > 
currentTaskMessages () const
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const
 
virtual void disable ()
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtTaskControllerComponent ()
 
virtual bool showCurrentTaskInGui () const
 
virtual void setRadio (DtSimRadio *radio)
 
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 ()
 
virtual void sendTaskCanceled (DtTaskMessage *taskMsg)
 
virtual bool taskVisualizationsActive () const
 
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 bool postAddComponentsInit ()
 
virtual DtSimRadioradio ()
 
virtual void enableTaskTypes ()
 
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 timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod)
 
virtual double minTickPeriod () const
 
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 
virtual double minTickPeriodVariance () const
 
virtual void setNextTickTime (double nextTickTime)
 
virtual double nextTickTime () const
 
virtual double calculateNextTickTime () const
 
virtual double calculateFirstTickTime () const
 
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 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)
 
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 wasUpdatedSince (DtTime t) 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)
 

Static Public Member Functions

static void followEntityCallback (DtSimMessage *msg, void *usrData)
 
static DtSimComponentcreator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
- 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 Member Functions

 DtHumanFollowController (const DtHumanFollowController &orig)
 
const DtHumanFollowControlleroperator= (const DtHumanFollowController &orig)
 
virtual void setSmoother (const DtVector &location)
 
virtual DtVector smoothedLocation ()
 
virtual DtVector constrainedStation (const DtSimObject *leaderState, const DtVector &position)
 
virtual bool nearDestination ()
 
virtual double distanceToDestination () const
 
virtual DtVector localDestination () const
 
virtual bool getDestination (DtVector &destination) const
 
virtual bool atDestination ()
 
virtual void doMoving ()
 
virtual bool destinationIsInsideObstruction (const DtVector &localDestination) const
 
virtual bool createPortGroups ()
 
virtual bool createPorts ()
 
virtual void moveToDestination ()
 
virtual void computeTopoVectors ()
 
virtual bool usingNavBot ()
 
virtual void moveUsingNavData ()
 
virtual void processNavAreaChanged ()
 
virtual bool needToUpdateNavInterfaceDestination (const DtVector &newLocalDestination)
 
virtual DtVector predictedDestination ()
 
virtual void updateTaskVisualizations ()
 
virtual void processNavigationInterfaceChanged ()
 
- 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 double computeCurrentTime ()
 
bool testInvariant () const
 
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 
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
 
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)
 

Static Protected Member Functions

static void navAreaChangedCallback (void *usr)
 

Protected Attributes

DtSimObjectReference myEntityToFollow
 
DtHumanStateRepositorymyHumanStateRepository
 
DtHumanFollowPSRmyProcessState
 
DtVector myLocalDestination
 
DtVector myWorldDestination
 
DtVector myLocalDestinationMove
 
DtVector myTopoDestinationMoveUnit2D
 
DtVector myTopoDestinationToEntity2D
 
DtVector mySmoothedStationLocation
 
DtVector myStationLocationWithRayToCenterline
 
DtVector myStationLocation
 
DtVector myLookAheadStationLocation
 
double myAtDistanceSquared
 
double myNearDistanceSquared
 
double myFarCatchUpFactor
 
bool myIgnoreNavData
 
DtVector myTransitionPoint
 
DtActiveBotNavInterfacemyNavInterface
 
DtVector myNavInterfaceCurrentDestination
 
double myNavInterfaceDestinationSetTime
 
DtHumanFollowControllerDescriptormyComponentDescriptor
 
DtTrigonometricSmoother * myLeaderSmoother
 
bool myWarnedOnceDestroyed
 
DtStringOutputPortmyFollowTargetOutputPort
 
bool myCanMoveDirect
 
DtPlatformSimObjectFacade myEntityToFollowSimObjectFacade
 
Ports and Port Groups
DtCollisionInputPortmyCollisionAvoidancePort
 
DtInputPortGroupmyCollisionAvoidancePortGroup
 
DtHumanMovementControlOutputPortGroupmyHumanMovementControlOutputPortGroup
 
DtVectorOutputPortmyDestinationOutputPort
 
DtBooleanOutputPortmyIsMovingPort
 
DtBooleanOutputPortmyUseCollisionAvoidancePort
 
bool myNearDestination
 
bool myPassedDestination
 
bool myAtDestination
 
double myDistanceSquared
 
bool myDestinationIsInsideObstruction
 
double myCurrentSpeed
 
- 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 myMinTickPeriod
 
double myMinTickPeriodVariance
 
double myNextTickTime
 
double myLastTickSimTime
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
bool myTickEveryFrame
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManager myPredicateCallbackManager
 
- 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
 

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::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 
- 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

DtHumanFollowController::DtHumanFollowController ( 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 DtHumanFollowController::~DtHumanFollowController ( )
virtual

destructor

DtHumanFollowController::DtHumanFollowController ( const DtHumanFollowController orig)
protected

copy constructor; shallow; does not copy the ports.

Member Function Documentation

virtual const char* DtHumanFollowController::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
DtHumanFollowControllerType

Implements DtTaskControllerComponent.

virtual bool DtHumanFollowController::init ( )
virtual

Init. Call immediately after construction.

Reimplemented from DtControllerComponent.

virtual bool DtHumanFollowController::createPSR ( )
virtual

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 void DtHumanFollowController::tick ( )
virtual

Calculate new control values.

Reimplemented from DtSimComponent.

static void DtHumanFollowController::followEntityCallback ( DtSimMessage msg,
void *  usrData 
)
static

Instances of this component will register this callback with their own 'this' pointer as user data with the msg executive requesting notification of move-to tasks.

virtual void DtHumanFollowController::processFollowEntityTask ( DtSimMessage msg)
virtual
virtual DtUUID DtHumanFollowController::entityToFollow ( )
virtual

What entity are we following? This accessor has the side effect of setting myProcessState->myEntityToFollow to DtString::nullString(), if the entity is not tasked and myEntityToFollow is not already the null string.

virtual void DtHumanFollowController::setEntityToFollow ( const DtUUID entity)
virtual
virtual const DtVector& DtHumanFollowController::offsetVector ( ) const
virtual

The offset from the entity's position to follow at, in entity coordinates. This comes from the follow task message.

virtual void DtHumanFollowController::setOffsetVector ( const DtVector offsets)
virtual
static DtSimComponent* DtHumanFollowController::creator ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
static

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).
Returns
New instance of this class.
virtual void DtHumanFollowController::registerTaskMsgCallbacks ( )
virtual

Overrides this so it can register its interest in followEntity commands.

Reimplemented from DtTaskControllerComponent.

virtual bool DtHumanFollowController::setupDestination ( )
virtual

Sets the world destination in the process state repository to the location of the entity we're following plus the indicated offset and then calls down to the base class.
Creates a smoother if one does not exist.
Also computes myLookAheadStationLocation by adding leader velocity * destinationSmoothingPeriod (from the descriptor) to the station position, i.e. myLocalDestination; then calls setSmoother().
If the station location (myLocalDestination) has changed since last tick, sets myPredictedDestination by calling predictedDestination(), then checks to see if the nav (path planning) interface should be given a new destination by calling needToUpdateNavInterfaceDestination(). If so,.

virtual bool DtHumanFollowController::passedDestination ( )
virtual

Overrides to force the entity to be near the destination as well as across the 'destination' line to be considered past the destination.

virtual double DtHumanFollowController::findDesiredSpeed ( )
virtual

Overrides so we can speed up when falling behind and slow down if we get past the position we're supposed to be in.

virtual double DtHumanFollowController::findDesiredHeading ( )
virtual

Overrides so the entity won't turn toward the destination point when it is close to or past the destination; rather, in these cases, it assumes the heading of the lead entity.

virtual void DtHumanFollowController::stop ( )
virtual

Overrides so we don't complete the task when we're at the right location with regard to the followed entity. Simply calls DtGroundMoveToControllerComponent::doMoving().

virtual void DtHumanFollowController::clearTask ( )
virtual

If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false, and calls clearCurrentTaskMesage() to clear out the current task message.

Reimplemented from DtSingleTaskControllerComponent.

const DtHumanFollowController& DtHumanFollowController::operator= ( const DtHumanFollowController orig)
protected

assignment operator; see comments on copy constructor!

virtual void DtHumanFollowController::setSmoother ( const DtVector location)
protectedvirtual

Sets the current location, velocity and acceleration in the smoother. In this implementation, the location argument is used as the location, and the leader velocity and acceleration are used for those parameters. "Current" time is sim time. The smoother used is DtTrigonometricSmoother myLeaderSmoother.
Called from setupDestination().

virtual DtVector DtHumanFollowController::smoothedLocation ( )
protectedvirtual

Gets the smoothed location from the smoother at the current time (sim time). If the leader speed is below a threshold (0.1 m/s), then the station location is used.
In this implementation, the smoother used is DtTrigonometricSmoother myLeaderSmoother. This function can be overridden if another smoothing approach is desired.

virtual DtVector DtHumanFollowController::constrainedStation ( const DtSimObject leaderState,
const DtVector position 
)
protectedvirtual

Assumes the nav bot is being used.

virtual bool DtHumanFollowController::nearDestination ( )
protectedvirtual

Determines if the entity is close enough to the destination that it should start slowing down (see findDesiredSpeed()). If the distance to the destination is less than the near distance in the descriptor, myNearDestination is set true. myNearDestination is also the return value.

virtual double DtHumanFollowController::distanceToDestination ( ) const
protectedvirtual

This is the distance to the station, i.e. leader position + offset. The value returned is the SQUARE of the 2D distance (horizontal in topo coordinates).

virtual DtVector DtHumanFollowController::localDestination ( ) const
protectedvirtual

This is the station (leader + offset) in local coordinates, run through the smoother; unless using the nav interface and there is a valid transition point (see DtActiveBotNavInterface), in which case that is the local destination.

virtual bool DtHumanFollowController::getDestination ( DtVector destination) const
protectedvirtual

getDestination()

Parameters
destination(Output) The position this object is trying to drive to in local coordinates. Calls localDestination().
Returns
true always.
virtual bool DtHumanFollowController::atDestination ( )
protectedvirtual

Are we within the at-distance parameter to the destination? If the myDistanceSquared member calculated in tick() is less than or equal to the square of the value provided in the at-distance parameter of the DtGroundMoveToDescriptor, atDestination() sets myAtDestination to true. If the myDistanceSquared !<= at-distance, atDestination() sets myAtDestination to false. myAtDestination is returned to the calling function.

virtual void DtHumanFollowController::doMoving ( )
protectedvirtual

Calls determineGearSetting(), findDesiredSpeed() and findDesiredHeading() and then sets port values based on those results.

virtual bool DtHumanFollowController::destinationIsInsideObstruction ( const DtVector localDestination) const
protectedvirtual

Returns whether or not current destination is inside an obstruction.

virtual bool DtHumanFollowController::createPortGroups ( )
protectedvirtual

Creates and initializes port groups.

Reimplemented from DtSimComponent.

virtual bool DtHumanFollowController::createPorts ( )
protectedvirtual

Creates myDestinationOutputPort.

Reimplemented from DtSimComponent.

virtual void DtHumanFollowController::moveToDestination ( )
protectedvirtual

Attempts to move to the destination location. Override to provide movement functionality.

virtual void DtHumanFollowController::computeTopoVectors ( )
protectedvirtual

Computes myTopoDestinationMoveUnit and myTopoDestinationToEntity for use in desiredHeading and desiredSpeed. Uses myLocalDestinationMove and the entity location.

virtual bool DtHumanFollowController::usingNavBot ( )
protectedvirtual
Returns
True if the controller is currently using the navigation system bot to control movement.
virtual void DtHumanFollowController::moveUsingNavData ( )
protectedvirtual

Uses calculations from the navBot to control the entity or end the task. Assumes that myNavInterface is valid and that myIgnoreNavData is false.

static void DtHumanFollowController::navAreaChangedCallback ( void *  usr)
staticprotected
virtual void DtHumanFollowController::processNavAreaChanged ( )
protectedvirtual
virtual bool DtHumanFollowController::needToUpdateNavInterfaceDestination ( const DtVector newLocalDestination)
protectedvirtual

Determine if the navBot (path planning) interface needs to be reset with a new destination.

virtual DtVector DtHumanFollowController::predictedDestination ( )
protectedvirtual

Gets a goal (destination) location to use as the target for moving. If there is a myLeaderSmoother, then this location is obtained from the smoother. Otherwise, the myLocalDestination is used (i.e., the station relative to the leader). Once this location is determined, the ground elevation at that point is found, and that is the (3D) point returned.

virtual void DtHumanFollowController::updateTaskVisualizations ( )
protectedvirtual

Called to update task visualizations after every tick. Implemented by subclasses.

Reimplemented from DtSimComponent.

virtual void DtHumanFollowController::processNavigationInterfaceChanged ( )
protectedvirtual

Member Data Documentation

DtSimObjectReference DtHumanFollowController::myEntityToFollow
protected

Set fresh each frame in setupDestination().

DtHumanStateRepository* DtHumanFollowController::myHumanStateRepository
protected

Cache pointer to our specific type of state repository.

DtHumanFollowPSR* DtHumanFollowController::myProcessState
protected

Container for state data associated with this component. This state is saved and restored as part of a scenario (or checkpoint).

DtCollisionInputPort* DtHumanFollowController::myCollisionAvoidancePort
protected

Input Port Name: potential-collision-info
Input Port Description:
Input Port Range:
Input Port Default Value:
Input Group Parent: collision-avoidance-control.

DtInputPortGroup* DtHumanFollowController::myCollisionAvoidancePortGroup
protected

Input Port Group Name: collision-avoidance-control
Input Port Group Description:

DtHumanMovementControlOutputPortGroup* DtHumanFollowController::myHumanMovementControlOutputPortGroup
protected

Output Group Name: movement-control
.

DtVectorOutputPort* DtHumanFollowController::myDestinationOutputPort
protected

Output Port Name: destination
Output Port Description: Specifies the current destination of the entity in geocentric coordinates. Output Port Range:
Output Group Parent:
.

DtBooleanOutputPort* DtHumanFollowController::myIsMovingPort
protected

Output Port Name: is-moving
Output Port Description: Indicates the entity is being actively moved by this controller.
Output Port Range:
Output Group Parent:
.

DtBooleanOutputPort* DtHumanFollowController::myUseCollisionAvoidancePort
protected

Output Port Name: use-collision-avoidance
Output Port Description: Indicates whether or not this controller should use the collision avoidance controller.
Output Port Range:
Output Group Parent:
.

DtVector DtHumanFollowController::myLocalDestination
protected

The Destination is the location of the station (leader + offset), either raw (if using the nav interface) or smoothed (if using this location to direct movement directly).

DtVector DtHumanFollowController::myWorldDestination
protected

The geoc version of the above, for output to the Destination output port.

DtVector DtHumanFollowController::myLocalDestinationMove
protected

The direction of movement of myLocalDestination from the last tick to the present.

DtVector DtHumanFollowController::myTopoDestinationMoveUnit2D
protected

Unit vector for the above, in topo coordinates.

DtVector DtHumanFollowController::myTopoDestinationToEntity2D
protected

Vector from myLocalDestination to entity, in topo coordinates.

DtVector DtHumanFollowController::mySmoothedStationLocation
protected

This is the smoothed movement target position. If not using the nav interface, it is the smoothed station location (same as myLocalDestination). If using the nav interface, it is the smoothed lookahead location.

DtVector DtHumanFollowController::myStationLocationWithRayToCenterline
protected

If using nav areas, this is the smoothedStationLocation, but pulled in to the center line directly behind the leader if a ray cannot be traced from the center line laterally to the station so that the entity and the leader can move directly to one another.

DtVector DtHumanFollowController::myStationLocation
protected

The location of the station (i.e. the desired offset location from leader location). In local coordinates.

DtVector DtHumanFollowController::myLookAheadStationLocation
protected

The location of the station at a time targetLookAheadTime in the future. In local coordinates.

bool DtHumanFollowController::myNearDestination
protected

These members refer to the entity position relative to myLocalDestination.

bool DtHumanFollowController::myPassedDestination
protected

These members refer to the entity position relative to myLocalDestination.

bool DtHumanFollowController::myAtDestination
protected

These members refer to the entity position relative to myLocalDestination.

double DtHumanFollowController::myDistanceSquared
protected

These members refer to the entity position relative to myLocalDestination.

bool DtHumanFollowController::myDestinationIsInsideObstruction
protected

These members refer to the entity position relative to myLocalDestination.

double DtHumanFollowController::myCurrentSpeed
protected

These members refer to the entity position relative to myLocalDestination.

double DtHumanFollowController::myAtDistanceSquared
protected

Square of distance we're considered to be 'at' our destination (within 1/4 meter). In meters^2. Default value: 1.0.

double DtHumanFollowController::myNearDistanceSquared
protected

Square of distance we're considered to be 'near' our destination (within 3 meters). In meters^2. Default value: 9.0.

double DtHumanFollowController::myFarCatchUpFactor
protected

Multiplicative factor used to compute the appropriate speed when we need to catch up to the entity we're following and we're far from where we need to be. 'Far' means we're outside of the near distance from our follow position. Our entity's ordered speed is multiplied by this factor to produce our desired speed in this case. Default value: 1.5.

bool DtHumanFollowController::myIgnoreNavData
protected

Used to force the navigation interface to be ignored. This is useful when the nav interface has given us a partial path to the destination (for example, if we're in a nav area but our destination is outside the nav area). This flag is set true when the entity leaves a nav area. Once set, gets reset when any of the following happen:
1) A new task is issued
2) The destination location changes
3) A set location occurs
4) The entity moves to a new navArea.

DtVector DtHumanFollowController::myTransitionPoint
protected
DtActiveBotNavInterface* DtHumanFollowController::myNavInterface
protected
DtVector DtHumanFollowController::myNavInterfaceCurrentDestination
protected
double DtHumanFollowController::myNavInterfaceDestinationSetTime
protected
DtHumanFollowControllerDescriptor* DtHumanFollowController::myComponentDescriptor
protected
DtTrigonometricSmoother* DtHumanFollowController::myLeaderSmoother
protected
bool DtHumanFollowController::myWarnedOnceDestroyed
protected
DtStringOutputPort* DtHumanFollowController::myFollowTargetOutputPort
protected
bool DtHumanFollowController::myCanMoveDirect
protected

This indicates whether the bot can move directly to the station, or requires a path to be planned.

DtPlatformSimObjectFacade DtHumanFollowController::myEntityToFollowSimObjectFacade
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)