VR-Forces 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 class DtCollision;
29 
40 {
41 public:
42 
46  DtLocalObject* owner,
47  DtSimulationServices* simManager,
48  DtComponentDescriptor* desc = 0,
49  DtReaderWriterRegistry* parentRegistry = 0);
50 
53 
55  virtual bool init();
56 
62  virtual void tick();
63 
66  virtual const char* type() const;
67 
69  static void setLocationCallback(DtSimMessage* msg, void* usr);
72  virtual void processSetLocation(DtSimMessage* msg);
73 
75  static void modifyVrfObjectCallback(DtSimMessage* msg, void* usr);
79  virtual void processModifyVrfObject(DtSimMessage* msg);
80 
84  static DtSimComponent * creator(const DtString& name,
85  DtLocalObject* owner,
86  DtSimulationServices* simManager,
87  DtComponentDescriptor* desc = 0,
88  DtReaderWriterRegistry* parentRegistry = 0);
89 
91  virtual void registerTaskMsgCallbacks();
92 
94  virtual void clearTask();
95 
104  virtual bool getDestination(DtVector & destination);
105 
110  virtual const DtVector& destinationVector();
111 
118  virtual double findDesiredSpeed();
119 
128  virtual double findDesiredHeading();
129 
136  virtual DtAutoTransmissionGearEnum determineGearSetting(const double desiredSpeed);
137 
156  virtual double headingForNavPath(const DtVector& entityPosition,
157  const double entityHeading,
158  const double entitySize,
159  const double navTargetHeading,
160  const DtVector& pathSegStartPosition,
161  const DtVector& pathSegEndPosition);
162 
173  virtual bool nearDestination();
174 
183  virtual bool atDestination();
184 
194  virtual bool passedDestination();
195 
201  virtual double approximateThrottle(double desiredSpeed, double headingError = 0.0);
202 
203 
205  virtual void stop(bool success = true);
206 
209  virtual void doMoving();
210 
211  virtual void updateTaskVisualizations();
212 
213 protected:
217  virtual bool setupDestination();
218 
227  virtual void setupDestinationVector();
228 
230  virtual void invalidateDestinationVector() const;
231 
233  virtual void moveToDestination();
234  virtual double distanceSqToDestination() const;
235 
239  virtual bool decideToGiveUpTask() const;
240 
241  virtual bool createPortGroups();
242  virtual bool createPorts();
243 
246  virtual void setDestinationIsInsideObstruction(bool yesNo);
247 
250  virtual bool destinationIsInsideObstruction() const;
251 
258  virtual double obstacleLimitedSpeed(const DtCollision* obstacle,
259  const DtVector& position, const DtVector& velocity,
260  const double deceleration, const double dT, const bool isMovingForward);
261 
263  virtual bool usingNavBot();
264 
266  virtual void useNavBotData();
267 
268  virtual void updateNavBotDestination();
269 
272  virtual unsigned maxNumFailedPathAttempts() const;
273 
276  virtual bool findAlternateDestination();
277 
278  static void navAreaChangedCallback(void* usr);
279  virtual void processNavAreaChanged();
280 
281  DtVector localDestination() const;
282 
283  virtual void processNavigationInterfaceChanged();
284 
286  virtual void processEstimatedTotCalculation();
287 
289  virtual void processGroundVehicleLocationChanged();
290 
291 private:
295 
298 
302 
303 protected:
304 
306 
309 
313 
316 
318 
322 
324 
326 
329 
336 
340 
347 
349 
352 
360 
363 
365 
367  const double DtEstimatedTotCalcInterval = 5.0;
368 
378 };
379 
380 
double myObstacleLimitedSpeed
Limit on speed this tick when near destination and there is an obstacle blocking the destination...
Definition: groundMoveToDestinationControllerComponent.h:359
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
double myTargetHeading
For task visualization:
Definition: groundMoveToDestinationControllerComponent.h:362
DtVector myLocalDestination
Definition: groundMoveToDestinationControllerComponent.h:307
double myNearDistanceSquared
Definition: groundMoveToDestinationControllerComponent.h:323
DtVector myDestinationVector
Definition: groundMoveToDestinationControllerComponent.h:314
bool myHasIntermediateDestination
Definition: groundMoveToDestinationControllerComponent.h:310
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:351
virtual void registerTaskMsgCallbacks()
bool myDestinationVectorIsValid
Definition: groundMoveToDestinationControllerComponent.h:315
DtVector myEstimatedTotTextPos
tot text position
Definition: groundMoveToDestinationControllerComponent.h:376
bool myDestinationIsInsideObstruction
Definition: groundMoveToDestinationControllerComponent.h:353
double myCurrentSpeed
Definition: groundMoveToDestinationControllerComponent.h:317
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:308
Definition: readerWriterRegistry.h:39
DtInputPortGroup * myCollisionAvoidancePortGroup
Input Port Group Name: collision-avoidance-control Input Port Group Description:
Definition: groundMoveToDestinationControllerComponent.h:339
const DtGroundAutoControllerComponent & operator=(const DtGroundAutoControllerComponent &orig)
assignment operator; not implemented
DtCollision * myCollisionObject
Valid for the tick:
Definition: groundMoveToDestinationControllerComponent.h:355
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:312
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:437
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:350
DtGroundMoveToDestinationControllerComponent is a controller that provides a kinematics-based model o...
Definition: groundMoveToDestinationControllerComponent.h:39
const DtGroundMoveToDescriptor * myMoveToDescriptor
Definition: groundMoveToDestinationControllerComponent.h:325
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:364
bool myEstimatedTotCalcEnabled
enabled flag for the tot calculations
Definition: groundMoveToDestinationControllerComponent.h:370
bool myAtDestination
Definition: groundMoveToDestinationControllerComponent.h:319
DtVector myIntermediateWorldDestination
Definition: groundMoveToDestinationControllerComponent.h:311
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:346
Definition: collision.h:25
Definition: rangeAndDirectionNetworkSegmentMetric.h:21
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:25
bool myChangedLocation
Definition: groundMoveToDestinationControllerComponent.h:377
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:335
double myDistanceSquared
Definition: groundMoveToDestinationControllerComponent.h:305
bool myNearDestination
Definition: groundMoveToDestinationControllerComponent.h:320
bool myPassedDestination
Definition: groundMoveToDestinationControllerComponent.h:321
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
double myEstimatedTotLastCalcTime
used for tot calculation intervals
Definition: groundMoveToDestinationControllerComponent.h:374
virtual double approximateThrottle(double desiredSpeed, double headingError=0.0)
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:
virtual bool createPorts()
Overridden to create the automotive ports.
double myEstimatedTotValue
the tot value
Definition: groundMoveToDestinationControllerComponent.h:372
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 Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)