VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
groundMoveToDestinationControllerComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2004 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 
13 #pragma once
14 
15 
17 #include <matrix/vlVector.h>
19 
20 class DtString;
22 class DtSimMessage;
26 class DtInputPortGroup;
28 
39 {
40 public:
41 
45  DtLocalObject* owner,
46  DtSimulationServices* simManager,
47  DtComponentDescriptor* desc = 0,
48  DtReaderWriterRegistry* parentRegistry = 0);
49 
52 
54  virtual bool init();
55 
58  virtual void setComponentDescriptor(DtComponentDescriptor *componentDescriptor);
59 
65  virtual void tick();
66 
69  virtual const char* type() const;
70 
72  static void setLocationCallback(DtSimMessage* msg, void* usr);
75  virtual void processSetLocation(DtSimMessage* msg);
76 
78  static void modifyVrfObjectCallback(DtSimMessage* msg, void* usr);
82  virtual void processModifyVrfObject(DtSimMessage* msg);
83 
87  static DtSimComponent * creator(const DtString& name,
88  DtLocalObject* owner,
89  DtSimulationServices* simManager,
90  DtComponentDescriptor* desc = 0,
91  DtReaderWriterRegistry* parentRegistry = 0);
92 
94  virtual void registerTaskMsgCallbacks();
95 
97  virtual void clearTask();
98 
107  virtual bool getDestination(DtVector & destination);
108 
113  virtual const DtVector& destinationVector() const;
114 
121  virtual double findDesiredSpeed();
122 
131  virtual double findDesiredHeading();
132 
139  virtual DtAutoTransmissionGearEnum determineGearSetting();
140 
151  virtual bool nearDestination();
152 
161  virtual bool atDestination();
162 
172  virtual bool passedDestination();
173 
175  virtual void stop(bool success = true);
176 
179  virtual void doMoving();
180 
181  virtual void updateTaskVisualizations();
182 
183 protected:
187  virtual bool setupDestination();
188 
197  virtual void setupDestinationVector() const;
198 
200  virtual void invalidateDestinationVector() const;
201 
203  virtual double desiredHeadingFromDestination(const DtDcm& localToTopoDcm);
204 
206  virtual void moveToDestination();
207  virtual double distanceToDestination() const;
208 
212  virtual bool decideToGiveUpTask() const;
213 
214  virtual bool createPortGroups();
215  virtual bool createPorts();
216 
219  virtual void setDestinationIsInsideObstruction(bool yesNo);
220 
223  virtual bool destinationIsInsideObstruction() const;
224 
226  virtual bool usingNavBot();
227 
229  virtual void useNavBotData();
230 
231  virtual void updateNavBotDestination();
232 
235  virtual unsigned maxNumFailedPathAttempts() const;
236 
239  virtual bool findAlternateDestination();
240 
241  static void navAreaChangedCallback(void* usr);
242  virtual void processNavAreaChanged();
243 
244  DtVector localDestination() const;
245 
246  virtual void processNavigationInterfaceChanged();
247 
249  virtual void processEstimatedTotCalculation();
250 
252  virtual void processGroundVehicleLocationChanged();
253 
254 private:
258 
261 
265 
266 protected:
267 
269 
272 
276 
279 
281 
285 
287 
290 
297 
301 
308 
310 
313 
315 
317 
319  const double DtEstimatedTotCalcInterval = 5.0;
320 
330 };
331 
332 
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVector myLocalDestination
Definition: groundMoveToDestinationControllerComponent.h:270
DtVector myDestinationVector
Definition: groundMoveToDestinationControllerComponent.h:277
bool myHasIntermediateDestination
Definition: groundMoveToDestinationControllerComponent.h:273
virtual bool init()
Initializes myGroundVehicleState.
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
A DtComponentDescriptor that has parameters that indicate the distances at which the entity is consid...
Definition: groundMoveToDescriptor.h:30
bool myIgnoreNavData
Definition: groundMoveToDestinationControllerComponent.h:312
virtual void registerTaskMsgCallbacks()
bool myDestinationVectorIsValid
Definition: groundMoveToDestinationControllerComponent.h:278
DtVector myEstimatedTotTextPos
tot text position
Definition: groundMoveToDestinationControllerComponent.h:328
bool myDestinationIsInsideObstruction
Definition: groundMoveToDestinationControllerComponent.h:314
double myCurrentSpeed
Definition: groundMoveToDestinationControllerComponent.h:280
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtVector myWorldDestination
Definition: groundMoveToDestinationControllerComponent.h:271
Definition: readerWriterRegistry.h:39
DtInputPortGroup * myCollisionAvoidancePortGroup
Input Port Group Name: collision-avoidance-control Input Port Group Description:
Definition: groundMoveToDestinationControllerComponent.h:300
const DtGroundAutoControllerComponent & operator=(const DtGroundAutoControllerComponent &orig)
assignment operator; not implemented
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtVector myIntermediateLocalDestination
Definition: groundMoveToDestinationControllerComponent.h:275
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:436
virtual bool decideToGiveUpTask() const
If the entity is attached and the target of the current task is not, give up on the task...
DtActiveBotNavInterface * myNavInterface
Definition: groundMoveToDestinationControllerComponent.h:311
DtGroundMoveToDestinationControllerComponent is a controller that provides a kinematics-based model o...
Definition: groundMoveToDestinationControllerComponent.h:38
const DtGroundMoveToDescriptor * myMoveToDescriptor
Definition: groundMoveToDestinationControllerComponent.h:286
virtual void setComponentDescriptor(DtComponentDescriptor *componentDescriptor)
The component descriptor specified in the order of battle file or parameter file that was used to cre...
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
unsigned myNumFailedPathAttempts
Definition: groundMoveToDestinationControllerComponent.h:316
bool myEstimatedTotCalcEnabled
enabled flag for the tot calculations
Definition: groundMoveToDestinationControllerComponent.h:322
bool myAtDestination
Definition: groundMoveToDestinationControllerComponent.h:282
DtVector myIntermediateWorldDestination
Definition: groundMoveToDestinationControllerComponent.h:274
virtual void clearTask()
Overridden to deactivate the port group when this controller completes a task.
DtBooleanOutputPort * myClampToNavDataPort
Output Port Name: clamp-to-nav-data Output Port Description: When there is a failure to path plan due...
Definition: groundMoveToDestinationControllerComponent.h:307
Definition: rangeAndDirectionNetworkSegmentMetric.h:21
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
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:24
bool myChangedLocation
Definition: groundMoveToDestinationControllerComponent.h:329
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
DtCollisionInputPort * myCollisionAvoidancePort
Input Port Name: potential-collision-info Input Port Description: Input Port Range: Input Port Defa...
Definition: groundMoveToDestinationControllerComponent.h:296
double myDistanceSquared
Definition: groundMoveToDestinationControllerComponent.h:268
bool myNearDestination
Definition: groundMoveToDestinationControllerComponent.h:283
bool myPassedDestination
Definition: groundMoveToDestinationControllerComponent.h:284
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
double myEstimatedTotLastCalcTime
used for tot calculation intervals
Definition: groundMoveToDestinationControllerComponent.h:326
virtual bool createPorts()
Overridden to create the automotive ports.
double myEstimatedTotValue
the tot value
Definition: groundMoveToDestinationControllerComponent.h:324
DtGroundAutoControllerComponent is a base controller that holds capabilitites common to all automotiv...
Definition: groundAutoControllerComponent.h:34
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
virtual bool createPortGroups()
Overridden to create myAutomotiveControlPortGroup.

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)