VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanFollowController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2003 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
16 #include <vlpi/trigonometricSmoother.h>
17 
19 class DtHumanFollowPSR;
20 class DtInputPortGroup;
23 class DtVectorOutputPort;
28 
38 {
39 
40 public:
41 
44  DtHumanFollowController(const DtString& name,
45  DtVrfObject* owner,
46  DtSimManager* simManager,
47  DtComponentDescriptor* desc = 0,
48  DtReaderWriterRegistry* parentRegistry = 0);
49 
51  virtual ~DtHumanFollowController();
52 
55  virtual const char* type() const;
56 
58  virtual bool init();
59 
65  virtual bool createPSR();
66 
68  virtual void tick();
69 
73  static void followEntityCallback(DtSimMessage* msg, void* usrData);
74 
75  virtual void processFollowEntityTask(DtSimMessage* msg);
76 
81  virtual const DtUUID& entityToFollow();
82  virtual void setEntityToFollow(const DtUUID& entity);
83 
86  virtual const DtVector& offsetVector() const;
87  virtual void setOffsetVector(const DtVector& offsets);
88 
92  static DtSimComponent * creator(const DtString& name,
93  DtVrfObject* owner,
94  DtSimManager* simManager,
95  DtComponentDescriptor* desc = 0,
96  DtReaderWriterRegistry* parentRegistry = 0);
97 
99  virtual void registerTaskMsgCallbacks();
100 
113  virtual bool setupDestination();
114 
117  virtual bool passedDestination();
118 
121  virtual double findDesiredSpeed();
122 
126  virtual double findDesiredHeading();
127 
131  virtual void stop();
132 
133  virtual void clearTask();
134 
135 protected:
136 
139  orig);
140 
142  const DtHumanFollowController & operator=(const
143  DtHumanFollowController & orig);
144 
151  virtual void setSmoother(const DtVector& location);
152 
159  virtual DtVector smoothedLocation();
160 
162  virtual DtVector constrainedStation(DtVrfObjectStateRepository* leaderState, const DtVector& position);
163 
169  virtual bool nearDestination();
170 
174  virtual double distanceToDestination() const;
175 
181  virtual DtVector localDestination() const;
182 
187  virtual bool getDestination(DtVector & destination) const;
188 
189 
198  virtual bool atDestination();
199 
202  virtual void doMoving();
203 
205  virtual bool destinationIsInsideObstruction(
206  const DtVector& localDestination) const;
207 
209  virtual bool createPortGroups();
210 
212  virtual bool createPorts();
213 
215  virtual void moveToDestination();
216 
220  virtual void computeTopoVectors();
221 
223  virtual bool usingNavBot();
224 
227  virtual void moveUsingNavData();
228 
229  static void navAreaChangedCallback(void* usr);
230  virtual void processNavAreaChanged();
231 
234  virtual bool needToUpdateNavInterfaceDestination(const DtVector& newLocalDestination);
235 
241  virtual DtVector predictedDestination();
242 
243  virtual void updateTaskVisualizations();
244 
245  static void navigationInterfaceChanged(const DtVrfObject*, void* usr);
246  virtual void processNavigationInterfaceChanged(const DtVrfObject*);
247 
248 protected:
249 
252 
255 
259 
262 
269 
273 
276 
283 
290 
297 
299 
304 
308 
314 
317 
323 
329 
334 
339 
350 
355 
360 
368 
380 
382 
386 
388 
389  DtTrigonometricSmoother* myLeaderSmoother;
391 
393 
397 };
398 
399 
bool myAtDestination
Definition: humanFollowController.h:345
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
const DtVrfObject * myEntityToFollow
Set fresh each frame in setupDestination().
Definition: humanFollowController.h:251
DtObjectIdOutputPort * myFollowTargetOutputPort
Definition: humanFollowController.h:392
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVector myStationLocationWithRayToCenterline
If using nav areas, this is the smoothedStationLocation, but pulled in to the center line directly be...
Definition: humanFollowController.h:328
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtCollisionInputPort * myCollisionAvoidancePort
Input Port Name: potential-collision-info Input Port Description: Input Port Range: Input Port Defa...
Definition: humanFollowController.h:268
DtVector myTopoDestinationToEntity2D
Vector from myLocalDestination to entity, in topo coordinates.
Definition: humanFollowController.h:316
bool myIgnoreNavData
Used to force the navigation interface to be ignored.
Definition: humanFollowController.h:379
Description: This repository holds all information that is common to all the forms of humans within t...
Definition: humanStateRepository.h:32
bool myCanMoveDirect
This indicates whether the bot can move directly to the station, or requires a path to be planned...
Definition: humanFollowController.h:396
This is the DtVrfObjectNavInterface subclass for objects which are actively querying the navigation s...
Definition: activeBotNavInterface.h:26
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
DtVector myLocalDestination
The Destination is the location of the station (leader + offset), either raw (if using the nav interf...
Definition: humanFollowController.h:303
virtual void registerTaskMsgCallbacks()
bool myNearDestination
These members refer to the entity position relative to myLocalDestination.
Definition: humanFollowController.h:343
DtVector myLocalDestinationMove
The direction of movement of myLocalDestination from the last tick to the present.
Definition: humanFollowController.h:311
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
DtActiveBotNavInterface * myNavInterface
Definition: humanFollowController.h:383
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
Description: This repository holds all information that is common to all the forms of all entity/aggr...
Definition: vrfObjectStateRepository.h:87
virtual bool init()
Calls setRadio()
DtVector myTransitionPoint
Definition: humanFollowController.h:381
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:485
DtBooleanOutputPort * myUseCollisionAvoidancePort
Output Port Name: use-collision-avoidance Output Port Description: Indicates whether or not this cont...
Definition: humanFollowController.h:296
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
double myCurrentSpeed
Definition: humanFollowController.h:348
double myAtDistanceSquared
Square of distance we&#39;re considered to be &#39;at&#39; our destination (within 1/4 meter).
Definition: humanFollowController.h:354
File: simMsg.h.
Definition: simMessage.h:35
DtHumanFollowController is a controller that models following behavior for humans.
Definition: humanFollowController.h:37
DtHumanFollowControllerDescriptor * myComponentDescriptor
Definition: humanFollowController.h:387
double myNearDistanceSquared
Square of distance we&#39;re considered to be &#39;near&#39; our destination (within 3 meters).
Definition: humanFollowController.h:359
virtual void tick()
This gives the thread of control to the component.
DtHumanFollowControllerDescriptor; descriptor for the DtHumanMoveAlongController component.
Definition: humanFollowControllerDescriptor.h:20
double myNavInterfaceDestinationSetTime
Definition: humanFollowController.h:385
class DtHumanFollowPSR:
Definition: humanFollowPSR.h:26
DtVector myStationLocation
The location of the station (i.e.
Definition: humanFollowController.h:333
virtual bool createPorts()
Called by init.
DtVector mySmoothedStationLocation
This is the smoothed movement target position.
Definition: humanFollowController.h:322
bool myPassedDestination
Definition: humanFollowController.h:344
Instances of DtObjectIdOutputPort are output ports through which data producers can send DtEntityIden...
Definition: objectIdIOPort.h:47
double myFarCatchUpFactor
Multiplicative factor used to compute the appropriate speed when we need to catch up to the entity we...
Definition: humanFollowController.h:367
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtVector myWorldDestination
The geoc version of the above, for output to the Destination output port.
Definition: humanFollowController.h:307
bool myDestinationIsInsideObstruction
Definition: humanFollowController.h:347
bool myWarnedOnceDestroyed
Definition: humanFollowController.h:390
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtTrigonometricSmoother * myLeaderSmoother
Definition: humanFollowController.h:389
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: humanFollowController.h:282
double myDistanceSquared
Definition: humanFollowController.h:346
DtHumanStateRepository * myHumanStateRepository
Cache pointer to our specific type of state repository.
Definition: humanFollowController.h:254
DtVector myNavInterfaceCurrentDestination
Definition: humanFollowController.h:384
DtInputPortGroup is a data port group of a data consumer.
Definition: inputPortGroup.h:32
Instances of DtCollisionInputPort are input ports through which data consumers can receive informatio...
Definition: collisionIOPort.h:29
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
An output port group that contains the ports necessary to control the movement of a human using the D...
Definition: humanMovementControlOutputPortGroup.h:22
DtHumanMovementControlOutputPortGroup * myHumanMovementControlOutputPortGroup
Output Group Name: movement-control .
Definition: humanFollowController.h:275
DtVector myLookAheadStationLocation
The location of the station at a time targetLookAheadTime in the future.
Definition: humanFollowController.h:338
DtHumanFollowPSR * myProcessState
Container for state data associated with this component.
Definition: humanFollowController.h:258
DtInputPortGroup * myCollisionAvoidancePortGroup
Input Port Group Name: collision-avoidance-control Input Port Group Description:
Definition: humanFollowController.h:272
DtVector myTopoDestinationMoveUnit2D
Unit vector for the above, in topo coordinates.
Definition: humanFollowController.h:313
DtBooleanOutputPort * myIsMovingPort
Output Port Name: is-moving Output Port Description: Indicates the entity is being actively moved by ...
Definition: humanFollowController.h:289

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)