VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
surfaceEntityMoveAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 #pragma once
12 
16 
17 class DtString;
19 class DtRouteState;
20 class DtSimMessage;
21 class DtVectorOutputPort;
22 class DtMoveAlongTask;
23 
38 
41 {
42 
43 public:
44 
48  DtLocalObject* owner,
49  DtSimulationServices* simManager,
50  DtComponentDescriptor* desc = 0,
51  DtReaderWriterRegistry* parentRegistry = 0);
52 
57  virtual ~DtSurfaceEntityMoveAlongController() override;
58 
61  virtual const char* type() const override;
62 
64  virtual bool init() override;
65 
69  virtual void preFirstTickInit() override;
70 
71  virtual void clearTask() override;
72 
80  static void moveAlongCallback(DtSimMessage* msg, void* usr);
81 
94  virtual void processMoveAlongTask(DtSimMessage * msg);
95 
104  static DtReaderWriter* provideCurrentMinTurnRadius(void* controller);
105 
113  static DtReaderWriter* provideTurnRadiusForOrderedSpeed(void* controller);
114 
116  static DtReaderWriter* provideNextRoutePointIndex(void* controller);
118 
126  virtual void processRouteChanged();
127 
136  virtual bool atGoal() override;
137 
146  virtual bool passedGoal() override;
147 
148 
150 
158  virtual bool targetNextVertex();
159 
163  static DtSimComponent * creator(const DtString& name,
164  DtLocalObject* owner,
165  DtSimulationServices* simManager,
166  DtComponentDescriptor* desc = 0,
167  DtReaderWriterRegistry* parentRegistry = 0);
168 
169  virtual void tick() override;
170  virtual void taskComplete(bool success = true) override;
171 
172 protected:
175 
179 
181  const DtSurfaceEntityMoveAlongController& operator=
183 
204  virtual bool getNextRoutePoint(int & index,
205  DtVector * & point);
206 
210  virtual DtVector previousRoutePoint();
211 
219  virtual void setStateForCurrentPoint();
220 
225  virtual bool setupControlPoint() override;
226 
235  virtual void controlMovement() override;
236 
240  virtual void moveToMiddleOrFinalPoint();
241 
254  virtual bool shouldMoveToRouteSegment(double& distanceToSegment);
255 
259  virtual void controlMovementToRouteSegment(double distanceToSegment);
260 
269  virtual DtReal computeStartTurnDistance2();
270 
273  virtual DtReal minTurnRadiusForSpeed(double speed) const;
274 
276  virtual DtVrfMovingObjectStateRepository* getSR() override { return myEntityState;}
281 
285  virtual void registerTaskMsgCallbacks() override;
286 
289  virtual void emptyVertexList();
290 
304  virtual double integralControl() const;
307  virtual double integratedErrorDecayRate() const { return 0.9; }
308 
312  virtual double integralControlGain() const { return 0.002; }
314 
315  virtual void processEstimatedTotCalculation() override;
316 
317  virtual bool createPorts() override;
318 
319  virtual void processMoveAlongTask(DtMoveAlongTask* moveAlong);
320 
321 protected:
326 
332 
339 
341 
343 };
virtual bool passedGoal()
Determines if the entity has passed the goal. This is true for move-to-loc if the vector from the goa...
virtual double integralControlGain() const
Returns radian offset per accumulated normalized error. Positive because positive error is to left...
Definition: surfaceEntityMoveAlongController.h:312
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtSurfaceEntityMoveToController is a controller that models the movement of a surface entity to a spe...
Definition: surfaceEntityMoveToController.h:29
DtSurfaceEntityMoveAlongController is a controller that models movement of a ship along a route...
Definition: surfaceEntityMoveAlongController.h:39
Definition: surfaceEntityParameters.h:20
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: surfaceEntityMoveAlongController.h:338
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:31
virtual const DtSurfaceEntityParameters * getParams()
Gets the entity parameters for the purposes of providing attributes.
Definition: surfaceEntityMoveAlongController.h:280
DtVrfMovingObjectStateRepository * myEntityState
Definition: surfaceEntityPilotController.h:279
virtual void clearTask() override
Calls down to the base class and then calls allowDeactivation() on mySurfaceControlPortGroup.
Definition: surfaceMovementPSR.h:59
virtual void registerTaskMsgCallbacks() override
Registers interest in move to tasks by calling addTaskProcessorCallback with moveToCallback as the fu...
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
virtual void controlMovement()
Executes the control function for the task, to produce control port outputs.
Definition: readerWriter.h:85
bool myReprocessTask
Definition: surfaceEntityMoveAlongController.h:342
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 void taskComplete(bool success=true)
If we are currently tasked, this will cause us to notify the entity that we're done and delete the ta...
DtSimObjectReference myRoute
Definition: surfaceEntityMoveAlongController.h:340
virtual DtVrfMovingObjectStateRepository * getSR() override
Gets the entity state repository for purposes of providing attributes.
Definition: surfaceEntityMoveAlongController.h:276
virtual double integratedErrorDecayRate() const
The reduction factor in the accumulated error, per second. Must be < 1.0.
Definition: surfaceEntityMoveAlongController.h:307
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
const DtSurfaceEntityParameters * myParameters
Cache a pointer to the entity parameters.
Definition: surfaceEntityPilotController.h:283
File: simMsg.h.
Definition: simMessage.h:35
virtual bool createPorts() override
Overridden to call createThrottlePort() and createRudderPort().
DtMoveAlongTask represents a Move Along Route task for an entity to perform. It inherits read/writabl...
Definition: moveAlongTasks.h:46
virtual DtSurfaceMovementPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: surfaceEntityMoveAlongController.h:278
virtual bool init() override
Calls down to the base class and then caches a pointer to the state repository in mySurfaceEntityStat...
virtual void tick() override
Overridden to check for valid myProcessState pointer. If it is null a warning is printed to the objec...
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
virtual void processEstimatedTotCalculation()
calculate estimated tot
double myIntegratedAlignmentError
This is the accumulated error of normalized distance from the route segment line. This value is used ...
Definition: surfaceEntityMoveAlongController.h:331
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
double myMinManeuverDistance2
Caches a threshold distance inside of which the entity will not consider moving to the route line...
Definition: surfaceEntityMoveAlongController.h:325
DtSurfaceMovementPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: surfaceEntityPilotController.h:290
virtual bool atGoal()
Determines when the entity is at the goal. Uses the stoppingDistance parameter.
virtual bool setupControlPoint()
Looks up the control point based on the control object name stored in the process state repository...
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)