VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
groundFollowEntityController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
15 
16 #include <vlutil/vlString.h>
17 #include <matrix/vlVector.h>
18 #include <vlpi/trigonometricSmoother.h>
19 
21 class DtSimMessage;
22 class DtStringOutputPort;
24 
35 {
36 
37 public:
38 
42  DtLocalObject* owner,
43  DtSimulationServices* simManager,
44  DtComponentDescriptor* desc = 0,
45  DtReaderWriterRegistry* parentRegistry = 0);
46 
48  virtual ~DtGroundFollowEntityController() override;
49 
52  virtual const char* type() const override;
53 
54 
58  static void followEntityCallback(DtSimMessage* msg, void* usrData);
59 
60  virtual void processFollowEntityTask(DtSimMessage* msg);
61 
62  virtual DtVector predictedDestination();
63 
68  virtual DtUUID entityToFollow();
69  virtual void setEntityToFollow(const DtUUID& entity);
70 
73  virtual const DtVector& offsetVector() const;
74  virtual void setOffsetVector(const DtVector& offsets);
75 
79  static DtSimComponent * creator(const DtString& name,
80  DtLocalObject* owner,
81  DtSimulationServices* simManager,
82  DtComponentDescriptor* desc = 0,
83  DtReaderWriterRegistry* parentRegistry = 0);
84 
86  virtual void registerTaskMsgCallbacks() override;
87 
91  virtual bool setupDestination() override;
92 
95  virtual bool passedDestination() override;
96 
99  virtual double findDesiredSpeed(const double maxAcceleration = 0.0) override;
100 
104  virtual double findDesiredHeading() override;
105 
111  virtual void setupDestinationVector() override;
112 
116  virtual void stop(bool success) override;
117 
119  virtual void tick() override;
120 
122  virtual bool usingNavBot(){return false;}
123 
125  virtual void updateNavBotDestination();
126 
128  virtual bool needToUpdateNavInterfaceDestination(const DtVector& newLocalDestination);
129 
130 protected:
134 
137  orig);
138 
142 
143  virtual bool createPorts() override;
144 
145 protected:
146 
148 
151 
153 
154  DtTrigonometricSmoother* myLeaderSmoother;
155 
157 
159 
161 
164 };
165 
virtual void stop(bool success=true)
Set port values for stopping, and mark the task complete.
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
Instances of DtStringOutputPort are output ports through which data producers can send a DtString obj...
Definition: stringIOPort.h:52
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...
DtTrigonometricSmoother * myLeaderSmoother
Definition: groundFollowEntityController.h:154
virtual void tick() override
Looks at the value on #myCollisionAvoidancePort, and if there is a value and the destination point is...
DtVector myNavInterfaceCurrentDestination
Definition: groundFollowEntityController.h:160
virtual void setupDestinationVector()
Sets up a vector from the current destination location to the entity&#39;s location to use in determining...
DtSimObjectReference myLeaderPointer
Set fresh each frame by setupDestination()
Definition: groundFollowEntityController.h:150
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
A DtGroundMoveToDescriptor that has the speed ratios to use when at, near, or past the desired locati...
Definition: groundFollowEntityDescriptor.h:30
DtGroundFollowEntityDescriptor * myComponentDescriptor
Definition: groundFollowEntityController.h:147
DtGroundMoveToDestinationControllerComponent is a controller that provides a kinematics-based model o...
Definition: groundMoveToDestinationControllerComponent.h:40
DtPlatformSimObjectFacade myLeaderPointerSimObjectFacade
Definition: groundFollowEntityController.h:163
const DtGroundMoveToDestinationControllerComponent & operator=(const DtGroundMoveToDestinationControllerComponent &orig)
assignment operator; see comments on copy constructor!
File: simMsg.h.
Definition: simMessage.h:35
double myNavInterfaceDestinationSetTime
Definition: groundFollowEntityController.h:158
DtStringOutputPort * myFollowEntityOutputPort
Definition: groundFollowEntityController.h:152
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
bool myWarnedOnceDestroyed
Definition: groundFollowEntityController.h:162
virtual void registerTaskMsgCallbacks() override
Overridden to register interest in move to and set location commands.
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
virtual bool setupDestination()
= &quot;BlockedByWall&quot;;
virtual bool passedDestination()
Determines if the entity will pass the destination to which it is moving this frame if it continues a...
virtual double findDesiredHeading()
Determines the desired heading in the following manner: If the myNearDestination member variable is t...
DtVector myPredictedDestination
Definition: groundFollowEntityController.h:156
virtual bool usingNavBot()
Definition: groundFollowEntityController.h:122
DtGroundFollowEntityController is a controller that models following behavior for ground vehicles...
Definition: groundFollowEntityController.h:34
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)