VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
groundMoveAlongControllerComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 
10 
11 #pragma once
12 
14 
16 class DtVectorOutputPort;
17 
27 {
28 
29 public:
30 
34  DtVrfObject* owner,
35  DtSimManager* simManager,
36  DtComponentDescriptor* desc = 0,
37  DtReaderWriterRegistry* parentRegistry = 0);
38 
41 
43  virtual bool init();
44 
47  virtual const char* type() const;
48 
53  virtual void preFirstTickInit();
54 
58  virtual void tick();
59 
60  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
61 
62  virtual DtSimTaskStatePtr currentTaskState() const;
63 
65  static void routeChangedCallback(const DtVrfObject* obj, void * usr);
66  virtual void processRouteChanged(const DtVrfObject* obj);
67 
69  virtual void registerTaskMsgCallbacks();
70 
72  static DtReaderWriter* provideNextRoutePointIndex(void* c);
73 
76 
80  static DtSimComponent * creator(const DtString& name,
81  DtVrfObject* owner,
82  DtSimManager* simManager,
83  DtComponentDescriptor* desc = 0,
84  DtReaderWriterRegistry* parentRegistry = 0);
85 
93  virtual bool setupRoute();
94 
101  virtual bool setupDestination();
102 
121  virtual double findDesiredSpeed();
122 
130 
132  virtual double findCosTurnAngle();
133 
139  virtual void stop();
140 
142  static void objectAddedCb(const DtVrfObject* vrfObject, void * usr);
143 
144  static void objectAboutToBeRemovedCallback(const DtVrfObject* obj, void* usr);
145 
146 protected:
147  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
148 
151 
155 
159 
163  virtual void buildLocalRoute();
164 
167  virtual void emptyVertexList();
168 
172  virtual void processObjectAdded(const DtVrfObject* vrfObject);
173 
176  virtual void clearTask();
177 
178  virtual bool decideToGiveUpTask() const;
179 
180  virtual void processObjectAboutToBeRemoved(const DtVrfObject* obj);
181 
182  virtual void updateTaskVisualizations();
183 
184  virtual void processEstimatedTotCalculation();
185 
186  virtual bool createPorts();
187 
188 protected:
189 
193 
198 
201 
208 };
virtual DtAutomotivePSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: groundMoveAlongControllerComponent.h:75
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual void registerTaskMsgCallbacks()
Overridden to register interest in move to and set location commands.
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtAutomotivePSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: groundAutoControllerComponent.h:291
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual void stop()
Set port values for stopping, and mark the task complete.
File: lclVecIter.h.
Definition: localVectorIterator.h:25
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtGroundMoveAlongControllerComponent is a controller that models movement of a ground entity along a ...
Definition: groundMoveAlongControllerComponent.h:25
virtual void tick()
Looks at the value on myCollisionAvoidancePort, and if there is a value and the destination point is ...
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 double findDesiredSpeed()
Determines how fast we should go.
virtual const char * type() const
Returns a string identifies the class type of component.
virtual bool init()
Initializes modifyVrfObjectCallback.
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: groundMoveAlongControllerComponent.h:207
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
const DtVrfObject * myRoute
This is looked up once per tick - assumed unchanging while we have control.
Definition: groundMoveAlongControllerComponent.h:192
bool myNeedsDestinationSetupOnNextTick
Definition: groundMoveAlongControllerComponent.h:200
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Instances of DtAutomotivePSR are used to hold the shared/checkpointable data for an automotive system...
Definition: automotivePSR.h:36
DtGroundMoveToDestinationControllerComponent is a controller that provides a kinematics-based model o...
Definition: groundMoveToDestinationControllerComponent.h:38
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
const DtGroundMoveToDestinationControllerComponent & operator=(const DtGroundMoveToDestinationControllerComponent &orig)
assignment operator; see comments on copy constructor!
File: simMsg.h.
Definition: simMessage.h:35
int myPreviousVertex
Definition: groundMoveAlongControllerComponent.h:199
virtual DtSimTaskStatePtr currentTaskState() const
bool myResetVertex
Definition: groundMoveAlongControllerComponent.h:197
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:24
virtual bool decideToGiveUpTask() const
Checks to see if destination is inside an obstruction.
virtual bool setupDestination()
This function ensures that the destination stored in the process state matches the member function...
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
virtual DtAutoTransmissionGearEnum determineGearSetting()
Sets myProcessState-&gt;myCurrentGear to DtAutoGearReverse or DtAutoGearForward based on sign of ordered...
virtual bool createPorts()
Overridden to create the automotive ports.
bool myRouteHasChanged
This gets set to true when a modifyRoute message for the route we&#39;re following is received...
Definition: groundMoveAlongControllerComponent.h:196
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19
virtual void processEstimatedTotCalculation()
calculate estimated tot
virtual void clearTask()
Releases the nav interface and then calls the parent clearTask().

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)