VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
groundManeuverInFormationController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 
10 
11 #pragma once
12 
14 class DtVectorOutputPort;
18 
24 #include "matrix/coordTransform.h"
33 #include <features/featureSet.h>
34 #include <features/areaFeature.h>
36 
38 {
39 
40 public:
41 
45  DtLocalObject* owner,
46  DtSimulationServices* simManager,
47  DtComponentDescriptor* desc = 0,
48  DtReaderWriterRegistry* parentRegistry = 0);
49 
52 
58  virtual bool init() override;
59 
61  virtual bool isRunningSubtask();
62 
64  virtual void onRestore() override;
65 
67  virtual void sendNextMovementTask();
68 
71  virtual const char* type() const override;
72 
76  virtual void tick() override;
77 
79  virtual void registerTaskMsgCallbacks() override;
80 
82  static void maneuverInFormationCallback(DtSimMessage * msg, void * usr);
83 
87  static DtSimComponent * creator(const DtString& name,
88  DtLocalObject* owner,
89  DtSimulationServices* simManager,
90  DtComponentDescriptor* desc = 0,
91  DtReaderWriterRegistry* parentRegistry = 0);
92 
93 protected:
94 
96  void cleanFollowInFormation();
97 
99  virtual void endFollowInFormation(bool taskSuccess = true);
100 
102  virtual void clearTask() override;
103 
118  virtual int adjustStartPoint(const std::vector<DtVector>& routeVertices,
119  const DtVector& entityLocation);
120 
121 
129  virtual void doFollowerMoving();
130  virtual void doLeaderMoving();
132 
135  virtual bool checkTaskEndCondition();
136 
138  virtual double headingTo(DtVector localDestination);
139 
141  virtual bool isLeader() const;
142 
144  virtual bool isLeaderCapable() const;
145 
147  virtual double horizDistBetweenPoints(DtVector, DtVector);
151  virtual double horizDistBetweenPoints(DtPoint loc1, DtPoint loc2);
153 
160  virtual int findClosestSegmentIndex(DtVector testPoint, std::vector<DtVector> testRoute,
161  DtPoint& closestSegmentLoc, double& distanceToSegment, int indexSegmentFloor = 0);
162 
166  virtual double findDesiredAcceleration(double targetSpeed, double targetHeading,
167  double currentHeading, double disToTarget);
168 
174  virtual bool createFollowerOffsetRoute(const std::vector<DtVector>& localPoints,
175  float rightOffset, float forwardOffset, DtUUID& routeUUID);
176 
178  virtual bool postAddComponentsInit() override;
179 
181  virtual void processManeuverInFormation(const DtTaskMessage& msg);
182 
191  virtual bool makeTopographicVertices();
192 
194  virtual double taskSpeedOrOrderedSpeed() const;
195 
197  virtual void updateTaskVisualizations() override;
198 
202  virtual bool getValidDestinationFor(const DtVector& localPositionIn, DtVector& localPositionOut);
203 
206  virtual bool publishFormationRoutes() const;
207 
220  virtual double distanceBehind(const DtVector topoRefPos,
221  const DtVector leaderDir, const DtVector topoCurrentPosition);
222  virtual bool isPastDestination(const int currentIndex);
223 
225  virtual void reinitializeTemporaryVariables();
226 
231  virtual DtVector shiftLocationAlongRoute(double shiftDistance,
232  std::vector<DtVector> testRoute, DtVector initalLoc, int segmentIndex);
233 
236  virtual void startObstacleSearch(const DtVector& localPosition, double radius);
237 
238  static void taskCompleteReportCallback(DtSimMessage* msg, void* usr);
239  virtual void processTaskCompleteReport(DtSimMessage* msg);
240 
241 private:
242 
245 
249 
253 
254 protected:
255 
258 
261 
266 
272 
276  std::vector<DtVector> myTopoOffsetRoute;
277  DtCoordTransform myLocalToTopoTransform;
278 
280  std::unique_ptr<MAKVRinTerra::DtAreaFeatureSet> myFeatureSet;
281 
284 
288  double myAtDistance;
293 
297 
300 
303 };
double myAtDistance
Descriptor parameter, used to end task.
Definition: groundManeuverInFormationController.h:288
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
bool myHasProcessed
Flag that signals when the task msg has been processed.
Definition: groundManeuverInFormationController.h:283
virtual bool init() override
Initializes myGroundVehicleState.
std::unique_ptr< MAKVRinTerra::DtAreaFeatureSet > myFeatureSet
Query of obstacles, used for planning valid destinations.
Definition: groundManeuverInFormationController.h:280
virtual void registerTaskMsgCallbacks()
File: lclVecIter.h.
Definition: localVectorIterator.h:25
Instances of DtRailMovementControllerPSR are used to hold the shared/checkpointable data for a rail m...
Definition: railMovementControllerPSR.h:48
virtual void clearTask() override
Overridden to deactivate the port group when this controller completes a task.
DtSimObjectReference myMajorRoute
Working route follower travels along.
Definition: groundManeuverInFormationController.h:260
DtSimObjectReference myLeader
Task parameter, leader to follow.
Definition: groundManeuverInFormationController.h:295
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Supplementary PSR for DtGroundManuverAlongInFormationControllerComponent. The primary purpose is to m...
Definition: groundManeuverInFormationPSR.h:31
DtGroundManeuverInFormationControllerComponent is a controller that models movement of a ground entit...
Definition: groundManeuverInFormationController.h:37
Definition: readerWriterRegistry.h:39
const DtGroundAutoControllerComponent & operator=(const DtGroundAutoControllerComponent &orig)
assignment operator; not implemented
DtMovementSimObjectFacade myLeaderMovementSimObjectFacade
Definition: groundManeuverInFormationController.h:296
DtRailMovementControllerPSR * pMyRailMovementPSR
DtVrfGroundManeuverAlongInFormationProcessStateRepositoryType This is a third PSR for this controller...
Definition: groundManeuverInFormationController.h:271
DtMovementLocalObjectFacade myMovementLocalObjectFacade
For task visualization.
Definition: groundManeuverInFormationController.h:302
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:443
virtual bool postAddComponentsInit() override
Calls lookupAndCacheProcessSR(), to look up our process state repository after all of the components ...
DtSimObjectReferenceList myFollowers
followers if leading
Definition: groundManeuverInFormationController.h:257
virtual void onRestore() override
Override to iterate over the descriptor to see if there are any targeting control tables...
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
File: simMsg.h.
Definition: simMessage.h:35
double myNearDistance
Descriptor parameter, used to keep on route.
Definition: groundManeuverInFormationController.h:286
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtCoordTransform myLocalToTopoTransform
Definition: groundManeuverInFormationController.h:277
This is a convenience list that will add DtSimObjectReference objects and modify the list as objects ...
Definition: simObjectReferenceList.h:25
DtSimObjectReference myUnitRoute
Task parameter, unit route to base the working route on.
Definition: groundManeuverInFormationController.h:299
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 myApproachSpeed
Descriptor parameter, used to limit turning speed.
Definition: groundManeuverInFormationController.h:290
std::vector< DtVector > myTopoOffsetRoute
After the offset route myRoute is computed, this holds the topo coordinates of the route...
Definition: groundManeuverInFormationController.h:276
DtGroundManeuverInFormationPSR * pMyManuverInFormationPSR
DtVrfGroundManeuverAlongInFormationProcessStateRepositoryType This is a second PSR for this controlle...
Definition: groundManeuverInFormationController.h:265
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
Definition: point.h:34
DtGroundAutoControllerComponent is a base controller that holds capabilitites common to all automotiv...
Definition: groundAutoControllerComponent.h:34
double myObstacleBufferMeters
Descriptor parameter, buffer distance to avoid obstacle features.
Definition: groundManeuverInFormationController.h:292
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)