VR-Forces 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 
124 #if 0
125  virtual DtAutoTransmissionGearEnum determineGearSetting(const double desiredSpeed);
132 #endif
133 
135  virtual double findCosTurnAngle();
136 
142  virtual void stop(bool success = true) override;
143 
144 protected:
145  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
146 
147  static void setLocationCallback(DtSimMessage* msg, void* usr);
148  virtual void processSetLocation(DtSimMessage* msg);
149 
152 
156 
160 
164  virtual void buildLocalRoute();
165 
168  virtual void emptyVertexList();
169 
172  virtual void clearTask();
173 
174  virtual bool decideToGiveUpTask() const;
175 
176  virtual void updateTaskVisualizations();
177 
178  virtual void processEstimatedTotCalculation();
179 
180  virtual bool createPorts();
181 
182 protected:
183 
187 
192 
195 
202 
204 };
bool myWaitingForDiscovery
Definition: groundMoveAlongControllerComponent.h:203
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:186
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:316
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:201
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
virtual DtAutoTransmissionGearEnum determineGearSetting(const double desiredSpeed)
Sets myProcessState-&gt;myCurrentGear to DtAutoGearReverse or DtAutoGearForward based on sign of ordered...
bool myNeedsDestinationSetupOnNextTick
Definition: groundMoveAlongControllerComponent.h:194
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:37
DtGroundMoveToDestinationControllerComponent is a controller that provides a kinematics-based model o...
Definition: groundMoveToDestinationControllerComponent.h:39
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
virtual void processSetLocation(DtSimMessage *msg)
Resets the destination vector when the location of the entity to which this controller is attached is...
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:193
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:191
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:95
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
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:88
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:25
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...
static void setLocationCallback(DtSimMessage *msg, void *usr)
Calls processSetLocation.
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:190
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 Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)