VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aggregatedMoveAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 
13 class DtCgf;
14 class DtAnalogOutputPort;
15 class DtVectorOutputPort;
20 
26 {
27 
28 private:
36 public:
39  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
40  DtReaderWriterRegistry *parentRegistry=0);
41 
43  virtual ~DtAggregatedMoveAlongController() override;
44 
46  virtual bool init() override;
47 
49  virtual const char* type() const override;
50 
54  virtual void preFirstTickInit() override;
55 
57  virtual void tick() override;
58 
62  virtual void processRouteChanged(DtSimObjectReference obj);
63 
65  virtual void registerTaskMsgCallbacks() override;
66 
67  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
68  static void moveAlongRetrogradeCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
69 
77  virtual bool setupRoute();
78 
85  virtual bool setupDestination();
86 
88  virtual double findDesiredSpeed();
89 
95  virtual void stop();
96 
98  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner,
99  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
100  DtReaderWriterRegistry* parentRegistry=0);
101 
103  virtual bool createPorts() override;
104 
106  virtual bool createPortGroups() override;
107 
113  virtual bool createPSR();
114 
118  virtual void doMoving();
119 
125  virtual double findDesiredHeading(DtVector& dest);
126 
128  //virtual bool destinationIsInsideObstruction(
130 
133  //virtual bool decideToGiveUpTask() const;
134 
135 protected:
136  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
137  virtual void processMoveAlongRetrograde(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
138 
142  //virtual void buildLocalRoute();
143 
146  virtual void emptyVertexList();
147 
150  virtual void clearTask() override;
151 
153  virtual void moveToDestination();
154 
158  virtual double distanceToDestinationSquared() const;
159 
168  virtual bool atDestination();
169 
176  virtual bool passedDestination();
177 
186  virtual bool getDestination(DtVector & destination);
187 
189  virtual DtVector destinationVector() const;
190 
195  virtual double atDistance() const;
196 
202  virtual bool stayOnRoute() const;
203 
208  virtual double minCorrectionDistance() const;
209 
217  virtual double maxCorrectionDistance() const;
218 
222  virtual double correctionAngle(const double distanceFromLine) const;
223 
232  virtual void computePointToSegmentGeometry(
233  const DtVector& localPoint,
234  const DtVector& localLinePt1, const DtVector& localLinePt2,
235  const Coordinate_System& coordinateSystemRef,
236  double& r, bool &leftSide, double &distanceToSegment);
237 
241  virtual bool getCurrentRouteSegment(DtVector& routeSegmentStart, DtVector& routeSegmentEnd) const;
242 
243  virtual DtSimTaskStatePtr currentTaskState() const override;
244 
246  virtual void calculateRadius();
247 
248 protected:
249 
250  const Coordinate_System* localCS() const;
251 
260 
266 
273 
275 
279 
284 
287  double myUnitRadius;
288 
292 };
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: aggregatedMoveAlongController.h:272
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtBooleanOutputPort * myRetrogradeOutputPort
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:290
DtVector myWorldDestination
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:286
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
DtVrfAggregateStateRepository * myTrueAggregateRepository
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:274
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtVector myLocalDestination
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:285
DtAggregatedMoveAlongDescriptor; descriptor for the DtAggregatedMoveAlongDescriptor component...
Definition: aggregatedMoveAlongDescriptor.h:20
Definition: readerWriterRegistry.h:39
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
bool myResetVertex
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:283
virtual bool init() override
Calls setRadio()
bool myNeedsObjectDiscovery
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:291
Definition: coordSystem.h:54
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
class DtAggregatedMoveAlongPSR:
Definition: aggregatedMoveAlongPSR.h:30
DtAnalogOutputPort * myMovementDirectionPort
Output Port Name: desired-movement-direction Output Port Description: Output Port Range: Output Gro...
Definition: aggregatedMoveAlongController.h:265
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtOutputPortGroup * myMovementControlPortGroup
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:254
virtual DtSimTaskStatePtr currentTaskState() const
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
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
double myUnitRadius
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:287
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtAggregatedMoveAlongDescriptor * myAggregatedMoveAlongDescriptor
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:289
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtAnalogOutputPort * mySpeedPort
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:259
Definition: vrfAggregateStateRepository.h:21
The top level class of a VR-Forces Simulation Engine, representing a Computer Generated Forces instan...
Definition: cgf.h:156
DtAggregatedMoveAlongPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: aggregatedMoveAlongController.h:278
bool myRouteHasChanged
This gets set to true when a modifyRoute message for the route we&#39;re following is received...
Definition: aggregatedMoveAlongController.h:282
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
End User Description: Controller for executing DtMoveAlongTask for aggregated aggregates. This moves the aggregate along a route. Uses Descriptor Type: DtComponentDescriptor.
Definition: aggregatedMoveAlongController.h:25
char * dest
Definition: lz4.h:440
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)