VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
surfaceEntityFollowEntityController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 #pragma once
12 
17 #include "vrfutil/scriptGeometry.h"
18 
20 class DtSimMessage;
21 class DtString;
23 class DtAnalogOutputPort;
29 class DtTaskMessage;
31 
33 typedef enum
34 {
43 
49 {
50 
51 public:
52 
56  DtLocalObject* owner,
57  DtSimulationServices* simManager,
58  DtComponentDescriptor* desc = 0,
59  DtReaderWriterRegistry* parentRegistry = 0);
60 
64  virtual ~DtSurfaceEntityFollowEntityController() override;
65 
68  virtual const char* type() const override;
69 
72  virtual bool init() override;
73 
82  static void followEntityCallback(DtSimMessage* msg, void* usrData);
83 
90  virtual void processFollowEntityTask(DtSimMessage* msg);
91 
95  virtual void registerTaskMsgCallbacks() override;
96 
97  virtual void tick() override;
98 
101  virtual void clearTask() override;
103  virtual bool createSurfaceControlPortGroup();
104 
105 protected:
112  virtual bool setupControlPoint();
113 
137  virtual void controlMovement();
138 
144  virtual void moveTowardProjectedStationPosition(double distanceToStation,
146  double approachDistance);
147 
155  virtual void moveBackToApproachPoint(bool onLeftSide, double approachDistance,
157  double turnRadius);
158 
165  virtual void turnToProjectedStationLine(
166  bool isOnLeft, double radius, double distanceToSegment);
167 
172  virtual void accelToCatchUp(double stationSpeed, double entitySpeed,
173  double distanceBehindStation);
174 
185  virtual void accelToDropBack(double stationSpeed,
186  double entitySpeed, double distanceAheadOfStation,
187  double distanceFromLine);
188 
194  virtual void turnAtSpeed(double desiredHeading,
195  double desiredSpeed);
196 
203  virtual bool willOverrunPoint(double distanceAhead, double distanceFromLine,
204  double entitySpeed, double turnRadius, double pointSpeed, double maxWaitTime);
205 
209  virtual double calculateAcceleration(double desiredSpeed);
210 
214  virtual double limitAcceleration(double desiredAcceleration,
215  double desiredSpeed);
216 
218  virtual bool createPortGroups() override;
219 
221  virtual bool createPorts() override;
222 
230  virtual void lookupAndCacheProcessSR();
231 
235  virtual bool postAddComponentsInit() override;
236 
240  virtual bool decideToGiveUpTask() const override;
241 
242  virtual void preFirstTickInit() override;
243 
244 public:
248  static DtSimComponent* creator(const DtString& name,
249  DtLocalObject* owner,
250  DtSimulationServices* simManager,
251  DtComponentDescriptor* desc = 0,
252  DtReaderWriterRegistry* parentRegistry = 0);
253 
254 protected:
257 
261 
265 
266 protected:
269 
272 
279 
280 
292 
298 
299 
305 
308 //? DtVector2D myNEVelocity;
309 
315 
321 
328 
333 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Definition: surfaceEntityParameters.h:20
DtAnalogOutputPort * myTurnRatePort
Rotation rate in radians/sec. Positive is to the right.
Definition: surfaceEntityFollowEntityController.h:289
double myStationSpeed
Set fresh each frame by setupControlPoint.
Definition: surfaceEntityFollowEntityController.h:312
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: surfaceEntityFollowEntityController.h:332
DtVector2D myNEStationToEntity
Set fresh each frame by setupControlPoint.
Definition: surfaceEntityFollowEntityController.h:307
DtSurfFollowState
For tracking debug print messages:
Definition: surfaceEntityFollowEntityController.h:33
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:31
DtSurfaceEntityFollowEntityController is a controller that models station keeping behavior for surfac...
Definition: surfaceEntityFollowEntityController.h:47
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
bool myIgnoreApproach
This is set when the station is moving more than a couple knots. It forces the entity to ignore the "...
Definition: surfaceEntityFollowEntityController.h:327
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
DtAnalogOutputPort * myFinalHeadingPort
A clamp heading, similar to clamp speed.
Definition: surfaceEntityFollowEntityController.h:291
DtAnalogOutputPort * myClampSpeedPort
The goal speed; used by the actuator to prevent accelerating past the desired speed if dT is much lon...
Definition: surfaceEntityFollowEntityController.h:287
Definition: surfaceMovementPSR.h:59
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
Definition: surfaceEntityFollowEntityController.h:35
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: surfaceEntityFollowEntityController.h:38
DtLocation3D myGeodStationPosition
Set fresh each frame by setupControlPoint.
Definition: surfaceEntityFollowEntityController.h:310
Definition: readerWriterRegistry.h:39
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
DtVector2D myUnitNEStationDirection
Set fresh each frame by setupControlPoint.
Definition: surfaceEntityFollowEntityController.h:311
DtSurfaceMovementPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: surfaceEntityFollowEntityController.h:278
virtual bool init() override
Calls setRadio()
DtSurfaceEntityPilotControllerDescriptor * myDescriptor
Definition: surfaceEntityFollowEntityController.h:268
Provides a simple, kinematics-based model for surface vessels.
Definition: surfaceEntityActuator.h:46
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
DtLocation3D myGeodCurrentPosition
DtVector myLocalStationPosition; // local coordinates DtVector myLocalStationVelocity; // local coord...
Definition: surfaceEntityFollowEntityController.h:306
Definition: surfaceEntityFollowEntityController.h:40
const DtSurfaceEntityParameters * myParameters
Cache a pointer to the entity parameters.
Definition: surfaceEntityFollowEntityController.h:271
DtReal myApproachSpeed
Definition: surfaceEntityFollowEntityController.h:320
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 ...
Definition: surfaceEntityFollowEntityController.h:36
Definition: surfaceEntityFollowEntityController.h:41
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtVector2D is a vector in earth-relative coordinates, e.g. east-north. Its direction in space depends...
Definition: scriptGeometry.h:289
virtual bool decideToGiveUpTask() const
This function is used to determine if the controller should give up trying to execute the current tas...
DtSurfFollowState myFollowState
For debugging.
Definition: surfaceEntityFollowEntityController.h:330
DtAnalogOutputPort * myAccelerationPort
The goal speed; used by the actuator to prevent accelerating past the desired speed if dT is much lon...
Definition: surfaceEntityFollowEntityController.h:284
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
Definition: surfaceEntityFollowEntityController.h:37
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
Contains class declaration for DtSurfaceEntityPilotControllerDescriptor; descriptor for the DtSurface...
Definition: surfaceEntityPilotControllerDescriptor.h:25
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtVrfMovingObjectStateRepository * myEntityState
Definition: surfaceEntityFollowEntityController.h:267
DtMovementSimObjectFacade myLeaderPointerSimObjectFacade
Definition: surfaceEntityFollowEntityController.h:331
Definition: surfaceEntityFollowEntityController.h:39
DtOutputPortGroup * mySurfaceControlPortGroup
Output Port Group Name: surface-control Output Port Group Description: acceleration, clamp speed, turn rate, and final heading ports.
Definition: surfaceEntityFollowEntityController.h:296
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
DtSimObjectReference myLeaderPointer
Set fresh each frame by setupControlPoint.
Definition: surfaceEntityFollowEntityController.h:302
A locally simulated VRF object.
Definition: localObject.h:98
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

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)