VR-Forces 5.0.2 Developer's Guide
 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 
17 #include <vlpi/trigonometricSmoother.h>
18 
20 class DtHumanFollowPSR;
21 class DtInputPortGroup;
24 class DtVectorOutputPort;
28 class DtStringOutputPort;
29 
39 {
40 
41 public:
42 
45  DtHumanFollowController(const DtString& name,
46  DtLocalObject* owner,
47  DtSimulationServices* simManager,
48  DtComponentDescriptor* desc = 0,
49  DtReaderWriterRegistry* parentRegistry = 0);
50 
52  virtual ~DtHumanFollowController();
53 
56  virtual const char* type() const;
57 
59  virtual bool init();
60 
66  virtual bool createPSR();
67 
69  virtual void tick();
70 
74  static void followEntityCallback(DtSimMessage* msg, void* usrData);
75 
76  virtual void processFollowEntityTask(DtSimMessage* msg);
77 
82  virtual DtUUID entityToFollow();
83  virtual void setEntityToFollow(const DtUUID& entity);
84 
87  virtual const DtVector& offsetVector() const;
88  virtual void setOffsetVector(const DtVector& offsets);
89 
93  static DtSimComponent * creator(const DtString& name,
94  DtLocalObject* owner,
95  DtSimulationServices* simManager,
96  DtComponentDescriptor* desc = 0,
97  DtReaderWriterRegistry* parentRegistry = 0);
98 
100  virtual void registerTaskMsgCallbacks();
101 
114  virtual bool setupDestination();
115 
118  virtual bool passedDestination();
119 
122  virtual double findDesiredSpeed();
123 
127  virtual double findDesiredHeading();
128 
132  virtual void stop();
133 
134  virtual void clearTask();
135 
136 protected:
137 
140  orig);
141 
143  const DtHumanFollowController & operator=(const
144  DtHumanFollowController & orig);
145 
152  virtual void setSmoother(const DtVector& location);
153 
160  virtual DtVector smoothedLocation();
161 
163  virtual DtVector constrainedStation(const DtSimObject* leaderState, const DtVector& position);
164 
170  virtual bool nearDestination();
171 
175  virtual double distanceToDestination() const;
176 
182  virtual DtVector localDestination() const;
183 
188  virtual bool getDestination(DtVector & destination) const;
189 
190 
199  virtual bool atDestination();
200 
203  virtual void doMoving();
204 
206  virtual bool destinationIsInsideObstruction(
207  const DtVector& localDestination) const;
208 
210  virtual bool createPortGroups();
211 
213  virtual bool createPorts();
214 
216  virtual void moveToDestination();
217 
221  virtual void computeTopoVectors();
222 
224  virtual bool usingNavBot();
225 
228  virtual void moveUsingNavData();
229 
230  static void navAreaChangedCallback(void* usr);
231  virtual void processNavAreaChanged();
232 
235  virtual bool needToUpdateNavInterfaceDestination(const DtVector& newLocalDestination);
236 
242  virtual DtVector predictedDestination();
243 
244  virtual void updateTaskVisualizations();
245 
246  virtual void processNavigationInterfaceChanged();
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 
398 };
399 
400 
bool myAtDestination
These members refer to the entity position relative to myLocalDestination.
Definition: humanFollowController.h:345
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
#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
Instances of DtStringOutputPort are output ports through which data producers can send a DtString obj...
Definition: stringIOPort.h:52
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. This is useful when the nav interface has given...
Definition: humanFollowController.h:379
Description: This repository holds all information that is common to all the forms of humans within t...
Definition: humanStateRepository.h:33
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:27
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
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
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...
DtSimObjectReference myEntityToFollow
Set fresh each frame in setupDestination().
Definition: humanFollowController.h:251
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:436
DtBooleanOutputPort * myUseCollisionAvoidancePort
Output Port Name: use-collision-avoidance Output Port Description: Indicates whether or not this cont...
Definition: humanFollowController.h:296
DtPlatformSimObjectFacade myEntityToFollowSimObjectFacade
Definition: humanFollowController.h:397
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
double myCurrentSpeed
These members refer to the entity position relative to myLocalDestination.
Definition: humanFollowController.h:348
double myAtDistanceSquared
Square of distance we&#39;re considered to be &#39;at&#39; our destination (within 1/4 meter). In meters^2. Default value: 1.0.
Definition: humanFollowController.h:354
File: simMsg.h.
Definition: simMessage.h:35
DtHumanFollowController is a controller that models following behavior for humans.
Definition: humanFollowController.h:38
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). In meters^2. Default value: 9.0.
Definition: humanFollowController.h:359
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtHumanFollowControllerDescriptor; descriptor for the DtHumanMoveAlongController component.
Definition: humanFollowControllerDescriptor.h:20
double myNavInterfaceDestinationSetTime
Definition: humanFollowController.h:385
class DtHumanFollowPSR:
Definition: humanFollowPSR.h:27
DtVector myStationLocation
The location of the station (i.e. the desired offset location from leader location). In local coordinates.
Definition: humanFollowController.h:333
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtVector mySmoothedStationLocation
This is the smoothed movement target position. If not using the nav interface, it is the smoothed sta...
Definition: humanFollowController.h:322
bool myPassedDestination
These members refer to the entity position relative to myLocalDestination.
Definition: humanFollowController.h:344
DtStringOutputPort * myFollowTargetOutputPort
Definition: humanFollowController.h:392
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. Derived classes should override this method to create all their input/output port gro...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
DtVector myWorldDestination
The geoc version of the above, for output to the Destination output port.
Definition: humanFollowController.h:307
bool myDestinationIsInsideObstruction
These members refer to the entity position relative to myLocalDestination.
Definition: humanFollowController.h:347
bool myWarnedOnceDestroyed
Definition: humanFollowController.h:390
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
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
These members refer to the entity position relative to myLocalDestination.
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. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
Instances of DtCollisionInputPort are input ports through which data consumers can receive informatio...
Definition: collisionIOPort.h:29
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. In local coordinates...
Definition: humanFollowController.h:338
DtHumanFollowPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
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
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)