VR-Forces 4.10 Class Documentation
 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 
14 #include "vrfutil/scriptGeometry.h"
15 
16 class DtSimManager;
17 class DtSimMessage;
18 class DtString;
19 class DtSimManager;
20 class DtAnalogOutputPort;
26 class DtTaskMessage;
28 
30 typedef enum
31 {
43 
47 {
48 
49 public:
50 
54  DtVrfObject* owner,
55  DtSimManager* simManager,
56  DtComponentDescriptor* desc = 0,
57  DtReaderWriterRegistry* parentRegistry = 0);
58 
63 
66  virtual const char* type() const;
67 
70  virtual bool init();
71 
80  static void followEntityCallback(DtSimMessage* msg, void* usrData);
81 
88  virtual void processFollowEntityTask(DtSimMessage* msg);
89 
93  virtual void registerTaskMsgCallbacks();
94 
95  virtual void tick();
96 
99  virtual void clearTask();
101  virtual bool createSurfaceControlPortGroup();
102 
103 protected:
110  virtual bool setupControlPoint();
111 
135  virtual void controlMovement();
136 
142  virtual void moveTowardProjectedStationPosition(double distanceToStation,
144  double approachDistance);
145 
153  virtual void moveBackToApproachPoint(bool onLeftSide, double approachDistance,
155  double turnRadius);
156 
163  virtual void turnToProjectedStationLine(
164  bool isOnLeft, double radius, double distanceToSegment);
165 
170  virtual void accelToCatchUp(double stationSpeed, double entitySpeed,
171  double distanceBehindStation);
172 
183  virtual void accelToDropBack(double stationSpeed,
184  double entitySpeed, double distanceAheadOfStation,
185  double distanceFromLine);
186 
192  virtual void turnAtSpeed(double desiredHeading,
193  double desiredSpeed);
194 
201  virtual bool willOverrunPoint(double distanceAhead, double distanceFromLine,
202  double entitySpeed, double turnRadius, double pointSpeed, double maxWaitTime);
203 
207  virtual double calculateAcceleration(double desiredSpeed);
208 
212  virtual double limitAcceleration(double desiredAcceleration,
213  double desiredSpeed);
214 
216  virtual bool createPortGroups();
217 
219  virtual bool createPorts();
220 
228  virtual void lookupAndCacheProcessSR();
229 
233  virtual bool postAddComponentsInit();
234 
238  virtual bool decideToGiveUpTask() const;
239 
240 public:
244  static DtSimComponent* creator(const DtString& name,
245  DtVrfObject* owner,
246  DtSimManager* simManager,
247  DtComponentDescriptor* desc = 0,
248  DtReaderWriterRegistry* parentRegistry = 0);
249 
250 protected:
253 
257 
261 
262 protected:
265 
268 
275 
276 
288 
294 
295 
301 
304 //? DtVector2D myNEVelocity;
305 
311 
317 
324 
327 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:146
Definition: surfaceEntityParameters.h:24
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtAnalogOutputPort * myTurnRatePort
Rotation rate in radians/sec. Positive is to the right.
Definition: surfaceEntityFollowEntityController.h:285
double myStationSpeed
Definition: surfaceEntityFollowEntityController.h:308
DtVector2D myNEStationToEntity
Definition: surfaceEntityFollowEntityController.h:303
DtSurfFollowState
For tracking debug print messages:
Definition: surfaceEntityFollowEntityController.h:30
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:29
DtSurfaceEntityFollowEntityController is a controller that models station keeping behavior for surfac...
Definition: surfaceEntityFollowEntityController.h:45
bool myIgnoreApproach
This is set when the station is moving more than a couple knots.
Definition: surfaceEntityFollowEntityController.h:323
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:287
DtAnalogOutputPort * myClampSpeedPort
The goal speed; used by the actuator to prevent accelerating past the desired speed if dT is much lon...
Definition: surfaceEntityFollowEntityController.h:283
Definition: surfaceMovementPSR.h:58
virtual void registerTaskMsgCallbacks()
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
Definition: surfaceEntityFollowEntityController.h:32
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
Definition: surfaceEntityFollowEntityController.h:35
DtLocation3D myGeodStationPosition
Definition: surfaceEntityFollowEntityController.h:306
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
DtOutputPortGroup is a data port group of a data provider.
Definition: outputPortGroup.h:30
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtVector2D myUnitNEStationDirection
Definition: surfaceEntityFollowEntityController.h:307
DtSurfaceMovementPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: surfaceEntityFollowEntityController.h:274
DtSurfaceEntityPilotControllerDescriptor * myDescriptor
Definition: surfaceEntityFollowEntityController.h:264
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:302
Definition: surfaceEntityFollowEntityController.h:37
const DtSurfaceEntityParameters * myParameters
Cache a pointer to the entity parameters.
Definition: surfaceEntityFollowEntityController.h:267
DtReal myApproachSpeed
DtVector2D myNEStationVelocity;.
Definition: surfaceEntityFollowEntityController.h:316
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
Definition: surfaceEntityFollowEntityController.h:33
Definition: surfaceEntityFollowEntityController.h:38
virtual bool createPorts()
Called by init.
! DtVector2D is a vector in earth-relative coordinates, e.g.
Definition: scriptGeometry.h:285
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:326
DtAnalogOutputPort * myAccelerationPort
Definition: surfaceEntityFollowEntityController.h:280
virtual bool createPortGroups()
Called by init.
Definition: surfaceEntityFollowEntityController.h:34
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
const DtVrfObject * myLeaderPointer
Set fresh each frame by setupControlPoint.
Definition: surfaceEntityFollowEntityController.h:298
Contains class declaration for DtSurfaceEntityPilotControllerDescriptor; descriptor for the DtSurface...
Definition: surfaceEntityPilotControllerDescriptor.h:25
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
DtVrfMovingObjectStateRepository * myEntityState
Definition: surfaceEntityFollowEntityController.h:263
Definition: surfaceEntityFollowEntityController.h:36
DtOutputPortGroup * mySurfaceControlPortGroup
Output Port Group Name: surface-control Output Port Group Description: acceleration, clamp speed, turn rate, and final heading ports.
Definition: surfaceEntityFollowEntityController.h:292
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)