VR-Forces 4.10 Class Documentation
 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 
15 
16 class DtString;
17 class DtSimManager;
18 class DtRouteState;
19 class DtSimMessage;
20 class DtVectorOutputPort;
21 
22 
38 
41 {
42 
43 public:
44 
48  DtVrfObject* owner,
49  DtSimManager* simManager,
50  DtComponentDescriptor* desc = 0,
51  DtReaderWriterRegistry* parentRegistry = 0);
52 
58 
61  virtual const char* type() const;
62 
64  virtual bool init();
65 
69  virtual void preFirstTickInit();
70 
71  virtual void clearTask();
72 
80  static void moveAlongCallback(DtSimMessage* msg, void* usr);
81 
94  virtual void processMoveAlongTask(DtSimMessage * msg);
95 
100  static void routeChangedCallback(const DtVrfObject* obj, void* user);
101 
110  static DtReaderWriter* provideCurrentMinTurnRadius(void* controller);
111 
119  static DtReaderWriter* provideTurnRadiusForOrderedSpeed(void* controller);
120 
122  static DtReaderWriter* provideNextRoutePointIndex(void* controller);
124 
132  virtual void processRouteChanged(const DtVrfObject* obj);
133 
142  virtual bool atGoal();
143 
152  virtual bool passedGoal();
153 
154 
156 
164  virtual bool targetNextVertex();
165 
166  static void objectAboutToBeRemovedCallback(const DtVrfObject* obj, void* usr);
167 
171  static DtSimComponent * creator(const DtString& name,
172  DtVrfObject* owner,
173  DtSimManager* simManager,
174  DtComponentDescriptor* desc = 0,
175  DtReaderWriterRegistry* parentRegistry = 0);
176 
177  virtual void tick();
178  virtual void taskComplete(bool success = true);
179 
180 protected:
183 
187 
189  const DtSurfaceEntityMoveAlongController& operator=
191 
212  virtual bool getNextRoutePoint(int & index,
213  DtVector * & point);
214 
218  virtual DtVector previousRoutePoint();
219 
227  virtual void setStateForCurrentPoint();
228 
233  virtual bool setupControlPoint();
234 
243  virtual void controlMovement();
244 
248  virtual void moveToMiddleOrFinalPoint();
249 
262  virtual bool shouldMoveToRouteSegment(double& distanceToSegment);
263 
267  virtual void controlMovementToRouteSegment(double distanceToSegment);
268 
277  virtual DtReal computeStartTurnDistance2();
278 
281  virtual DtReal minTurnRadiusForSpeed(double speed) const;
282 
289 
293  virtual void registerTaskMsgCallbacks();
294 
297  virtual void emptyVertexList();
298 
300  virtual void processObjectAboutToBeRemoved(const DtVrfObject* obj);
301 
315  virtual double integralControl() const;
318  virtual double integratedErrorDecayRate() const { return 0.9; }
319 
323  virtual double integralControlGain() const { return 0.002; }
325 
326  virtual void processEstimatedTotCalculation();
327 
328  virtual bool createPorts();
329 
330 protected:
335 
341 
348 };
virtual double integralControlGain() const
Returns radian offset per accumulated normalized error.
Definition: surfaceEntityMoveAlongController.h:323
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual void tick()
Overridden to check for valid myProcessState pointer.
DtSurfaceEntityMoveAlongController is a controller that models movement of a ship along a route...
Definition: surfaceEntityMoveAlongController.h:39
Definition: surfaceEntityParameters.h:24
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: surfaceEntityMoveAlongController.h:347
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:29
virtual const DtSurfaceEntityParameters * getParams()
Gets the entity parameters for the purposes of providing attributes.
Definition: surfaceEntityMoveAlongController.h:288
virtual void controlMovement()
Executes the control function for the task, to produce control port outputs.
DtVrfMovingObjectStateRepository * myEntityState
Definition: surfaceEntityPilotController.h:274
Definition: surfaceMovementPSR.h:58
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
virtual void clearTask()
Calls down to the base class and then calls allowDeactivation() on mySurfaceControlPortGroup.
Definition: readerWriter.h:85
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 bool passedGoal()
Determines if the entity has passed the goal.
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...
//! DtSurfaceEntityMoveToLocationController is a controller that models the movement of a surface ent...
Definition: surfaceEntityMoveToLocationController.h:28
virtual double integratedErrorDecayRate() const
The reduction factor in the accumulated error, per second.
Definition: surfaceEntityMoveAlongController.h:318
virtual void processEstimatedTotCalculation()
calculate estimated tot
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:278
File: simMsg.h.
Definition: simMessage.h:35
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual DtVrfMovingObjectStateRepository * getSR()
Gets the entity state repository for purposes of providing attributes.
Definition: surfaceEntityMoveAlongController.h:284
virtual DtSurfaceMovementPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: surfaceEntityMoveAlongController.h:286
*array controller(no time code)*/template< class Instance
//!//!//!//!//!//!//!//!//!//!//!//
virtual bool setupControlPoint()
Every tick, this makes sure the destination is taken from current data.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
double myIntegratedAlignmentError
This is the accumulated error of normalized distance from the route segment line. ...
Definition: surfaceEntityMoveAlongController.h:340
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
virtual void registerTaskMsgCallbacks()
Registers interest in move to location tasks by calling addTaskProcessorCallback moveToLocationCallba...
virtual const char * type() const
Returns a string identifies the class type of component.
double myMinManeuverDistance2
Caches a threshold distance inside of which the entity will not consider moving to the route line...
Definition: surfaceEntityMoveAlongController.h:334
virtual bool createPorts()
Overridden to call createThrottlePort() and createRudderPort().
DtSurfaceMovementPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: surfaceEntityPilotController.h:285
virtual bool init()
Calls down to the base class and then caches a pointer to the state repository in mySurfaceEntityStat...
virtual bool atGoal()
Determines when the entity is at the goal. Uses the stoppingDistance parameter.

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)