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 
40  virtual ~DtGroundMoveAlongControllerComponent() override;
41 
43  virtual bool init() override;
44 
47  virtual const char* type() const override;
48 
53  virtual void preFirstTickInit() override;
54 
58  virtual void tick() override;
59 
60  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
61 
62  virtual DtSimTaskStatePtr currentTaskState() const override;
63 
65  static void routeChangedCallback(const DtSimObject* obj, void * usr);
66  virtual void processRouteChanged(const DtSimObject* obj);
67 
69  virtual void registerTaskMsgCallbacks() override;
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 
92  virtual bool setupRoute();
93 
96  virtual bool setupDestination() override;
97 
101  virtual void setupDestinationVector() override;
102 
106  virtual double findDesiredSpeed(const double maxAcceleration = 0.0) override;
107 
114  virtual double destinationSpeed(const double cruiseSpeed) const override;
115 
116  virtual double nextVertexSpeedForDownstreamRoute(const double maxVertexSpeed, const double maxLatAccel, const double maxDecel, const double cruiseSpeed) const;
117 
119  virtual double nextTurnAngle() const;
120 
126  virtual void stop(bool success = true) override;
127 
128 protected:
129  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
130 
131  static void setLocationCallback(DtSimMessage* msg, void* usr);
132  virtual void processSetLocation(DtSimMessage* msg) override;
133 
134  virtual bool beginProcessingTask(const DtTaskMessage& task, DtSimTaskStatePtr taskState) override;
135 
138 
142 
146 
150  virtual void buildLocalRoute();
151 
154  virtual void emptyVertexList();
155 
158  virtual void clearTask() override;
159 
160  virtual bool decideToGiveUpTask() const override;
161 
162  virtual void updateTaskVisualizations() override;
163 
164  virtual void processEstimatedTotCalculation() override;
165 
166  virtual bool createPorts() override;
167 
174  virtual int findClosestSegment(
175  const DtLocalVertexList& vertexList,
176  const DtVector& testPoint, double& closestDistance,
177  double& segmentDistance);
178 
179 protected:
180 
185 
187 
194 
197 };
bool myWaitingForDiscovery
Definition: groundMoveAlongControllerComponent.h:195
virtual void stop(bool success=true)
Set port values for stopping, and mark the task complete.
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
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 double findDesiredSpeed(const DtVector &localDestination, const double stoppingAcceleration=0.0)
Determines how fast we should go. Considers ordered speed and task speed. Gets the final speed desire...
DtAutomotivePSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: groundAutoControllerComponent.h:388
virtual void tick() override
Looks at the value on #myCollisionAvoidancePort, and if there is a value and the destination point is...
File: lclVecIter.h.
Definition: localVectorIterator.h:25
virtual void setupDestinationVector()
Sets up a vector from the current destination location to the entity's location to use in determining...
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
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
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
virtual void clearTask() override
Releases the nav interface and then calls the parent clearTask().
virtual bool beginProcessingTask(const DtTaskMessage &task, DtSimTaskStatePtr taskState) override
Called by the task manager when this controller should start executing the specified task...
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: groundMoveAlongControllerComponent.h:193
double myTimeStartedWaiting
Definition: groundMoveAlongControllerComponent.h:196
DT_DLL_vrfutil const DtRailSegment * findClosestSegment(const DtVector &pos, const DtRailSegmentList *rails, const Coordinate_System &coordinateSystem, double &distanceSqAlongClosest)
virtual bool init() override
Initializes modifyVrfObjectCallback.
Instances of DtAutomotivePSR are used to hold the shared/checkpointable data for an automotive system...
Definition: automotivePSR.h:45
DtGroundMoveToDestinationControllerComponent is a controller that provides a kinematics-based model o...
Definition: groundMoveToDestinationControllerComponent.h:40
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:186
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual bool decideToGiveUpTask() const override
Checks to see if destination is inside an obstruction. If it is, returns true. Otherwise it returns t...
virtual void registerTaskMsgCallbacks() override
Overridden to register interest in move to and set location commands.
virtual DtSimTaskStatePtr currentTaskState() const
bool myResetVertex
Definition: groundMoveAlongControllerComponent.h:184
virtual double destinationSpeed(const double cruiseSpeed) const
Determines the appropriate final speed at the destination. Considers whether the continueFlag has bee...
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
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:80
virtual bool setupDestination()
= &quot;BlockedByWall&quot;;
static void setLocationCallback(DtSimMessage *msg, void *usr)
Calls processSetLocation.
bool myRouteHasChanged
This gets set to true when a modifyRoute message for the route we&#39;re following is received...
Definition: groundMoveAlongControllerComponent.h:183
class DtLocalVertexList:
Definition: localVertexList.h:20
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 updateTaskVisualizations() override
Draw task visualizations. By default, the following are drawn:
virtual bool createPorts() override
Overridden to create the automotive ports.
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)