VR-Forces 5.0.1 Developer's Guide
 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  DtLocalObject* owner,
35  DtSimulationServices* 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 DtSimObject* obj, void * usr);
66  virtual void processRouteChanged(const DtSimObject* obj);
67 
69  virtual void registerTaskMsgCallbacks();
70 
72  static DtReaderWriter* provideNextRoutePointIndex(void* c);
73 
76 
80  static DtSimComponent * creator(const DtString& name,
81  DtLocalObject* owner,
82  DtSimulationServices* 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(bool success = true) override;
140 
141 protected:
142  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
143 
146 
150 
154 
158  virtual void buildLocalRoute();
159 
162  virtual void emptyVertexList();
163 
166  virtual void clearTask();
167 
168  virtual bool decideToGiveUpTask() const;
169 
170  virtual void updateTaskVisualizations();
171 
172  virtual void processEstimatedTotCalculation();
173 
174  virtual bool createPorts();
175 
176 protected:
177 
181 
186 
189 
196 
198 };
bool myWaitingForDiscovery
Definition: groundMoveAlongControllerComponent.h:197
virtual void stop(bool success=true)
Set port values for stopping, and mark the task complete.
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
DtSimObjectReference myRoute
This is looked up once per tick - assumed unchanging while we have control.
Definition: groundMoveAlongControllerComponent.h:180
virtual void registerTaskMsgCallbacks()
Overridden to register interest in move to and set location commands.
DtAutomotivePSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: groundAutoControllerComponent.h:298
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
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
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:49
Definition: readerWriterRegistry.h:39
virtual double findDesiredSpeed()
Determines how fast we should go. If the myNearDestination member variable is true (set by nearDestin...
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual bool init()
Initializes modifyVrfObjectCallback.
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: groundMoveAlongControllerComponent.h:195
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
bool myNeedsDestinationSetupOnNextTick
Definition: groundMoveAlongControllerComponent.h:188
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
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:187
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual DtSimTaskStatePtr currentTaskState() const
bool myResetVertex
Definition: groundMoveAlongControllerComponent.h:185
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:24
virtual bool decideToGiveUpTask() const
Checks to see if destination is inside an obstruction. If it is, returns true. Otherwise it returns t...
virtual bool setupDestination()
This function ensures that the destination stored in the process state matches the member function...
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:184
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
virtual void processEstimatedTotCalculation()
calculate estimated tot
virtual void clearTask()
Releases the nav interface and then calls the parent clearTask().
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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)