VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
groundFollowInFormationController.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;
15 
22 #include "matrix/coordTransform.h"
31 
33 {
34 
35 public:
36 
40  DtLocalObject* owner,
41  DtSimulationServices* simManager,
42  DtComponentDescriptor* desc = 0,
43  DtReaderWriterRegistry* parentRegistry = 0);
44 
47 
50  virtual const char* type() const override;
51 
55  virtual void tick() override;
56 
58  virtual void registerTaskMsgCallbacks() override;
59 
61  static void followInFormationCallback(DtSimMessage * msg, void * usr);
62 
66  static DtSimComponent * creator(const DtString& name,
67  DtLocalObject* owner,
68  DtSimulationServices* simManager,
69  DtComponentDescriptor* desc = 0,
70  DtReaderWriterRegistry* parentRegistry = 0);
71 protected:
72 
74  void cleanFollowInFormation();
75 
77  virtual void endFollowInFormation(bool taskSuccess = true);
78 
80  virtual void clearTask() override;
81 
96  virtual int adjustStartPoint(const std::vector<DtVector>& routeVertices,
97  const DtVector& entityLocation);
98 
99 
106  virtual void doMoving();
107 
110  virtual bool checkTaskEndCondition();
111 
113  virtual bool isLeaderCapable() const;
114 
115 
117  virtual double horizDistBetweenPoints(DtVector, DtVector);
121  virtual double horizDistBetweenPoints(DtPoint loc1, DtPoint loc2);
123 
130  virtual int findClosestSegmentIndex(DtVector testPoint, std::vector<DtVector> testRoute,
131  DtPoint& closestSegmentLoc, double& distanceToSegment, int indexSegmentFloor = 0);
132 
136  virtual double findDesiredAcceleration(double targetSpeed, double targetHeading,
137  double currentHeading, double disToTarget);
138 
144  virtual bool createFollowerOffsetRoute(const std::vector<DtVector>& localPoints,
145  float rightOffset, float forwardOffset, DtUUID& routeUUID);
146 
148  virtual void processFollowInFormation(const DtTaskMessage& msg);
149 
151  virtual void updateTaskVisualizations() override;
152 
155  virtual bool publishFormationRoutes() const;
156 
169  virtual double distanceBehind(const DtVector topoRefPos,
170  const DtVector leaderDir, const DtVector topoCurrentPosition);
171  virtual bool isPastDestination(const int currentIndex);
172 
173 private:
174 
177 
181 
185 
186 protected:
189 
193  std::vector<DtVector> myTopoOffsetRoute;
194  DtCoordTransform myLocalToTopoTransform;
195 
207  double myAtDistance;
228 };
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
DtSimObjectReference myLeadersRoute
Task parameter, unit route to base the working route on.
Definition: groundFollowInFormationController.h:216
DtSimObjectReference myRoute
Working route follower travels along.
Definition: groundFollowInFormationController.h:188
DtMovementLocalObjectFacade myMovementLocalObjectFacade
Definition: groundFollowInFormationController.h:227
virtual void registerTaskMsgCallbacks()
File: lclVecIter.h.
Definition: localVectorIterator.h:25
virtual void clearTask() override
Overridden to deactivate the port group when this controller completes a task.
bool myHasProcessed
Flag that signals when the task msg has been processed.
Definition: groundFollowInFormationController.h:199
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 myClosestSegmentPt1
Segment of route the follower is currently in. Used for task visualization.
Definition: groundFollowInFormationController.h:222
DtVector myLeaderLongitudinalOffsetPoint
For task visualization.
Definition: groundFollowInFormationController.h:226
Definition: readerWriterRegistry.h:39
const DtGroundAutoControllerComponent & operator=(const DtGroundAutoControllerComponent &orig)
assignment operator; not implemented
(deprecated 5.2 see DtGroundManeuverInFormationControllerComponent) DtGroundFollowInFormationControll...
Definition: groundFollowInFormationController.h:32
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:443
DtMovementSimObjectFacade myLeaderMovementSimObjectFacade
Definition: groundFollowInFormationController.h:214
double myAtDistance
Descriptor parameter, used to end task.
Definition: groundFollowInFormationController.h:207
double myDisToTarget
Distance to myLocalDestination.
Definition: groundFollowInFormationController.h:201
bool myIsOnRoute
Flag that signals when we should return to the route.
Definition: groundFollowInFormationController.h:197
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
std::vector< DtVector > myTopoOffsetRoute
After the offset route myRoute is computed, this holds the topo coordinates of the route...
Definition: groundFollowInFormationController.h:193
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtVector myClosestSegmentPt2
Segment of route the follower is currently in. Used for task visualization.
Definition: groundFollowInFormationController.h:223
double myNearDistance
Descriptor parameter, used to keep on route.
Definition: groundFollowInFormationController.h:205
DtSimObjectReference myLeader
Task parameter, leader to follow.
Definition: groundFollowInFormationController.h:213
DtCoordTransform myLocalToTopoTransform
Definition: groundFollowInFormationController.h:194
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 myBackwardsOffset
Task parameter, follow offset from leader.
Definition: groundFollowInFormationController.h:203
double myApproachSpeed
Descriptor parameter, used to limit turning speed.
Definition: groundFollowInFormationController.h:209
DtVector myLocalDestination
Location on route follower tries to reach. Based on leaders location and myBackwardsOffset.
Definition: groundFollowInFormationController.h:219
int myIndexDriven
Current route vertex index. Ratchet used to avoid repeating a looping segment.
Definition: groundFollowInFormationController.h:211
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
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)