VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
surfaceEntityPilotController.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 
15 
17 #define REDUCED_ACCELERATION_FACTOR 0.5
18 #define PROPORTIONAL_SPEED_CONTROL 1.0
20 #define DIRECT_HEADING_CONTROL_ANGLE 0.5
25 #define HEADING_GOAL_EPSILON 0.001
31 class DtString;
33 class DtAnalogOutputPort;
39 class DtTaskMessage;
41 
76 
80 {
81 
82 public:
83 
90  DtLocalObject* owner,
91  DtSimulationServices* simManager,
92  DtComponentDescriptor* desc = 0,
93  DtReaderWriterRegistry* parentRegistry = 0);
94 
99 
102  virtual const char* type() const;
103 
106  virtual bool init();
107 
110  virtual void tick();
111 
114  virtual void clearTask();
116  virtual bool createSurfaceControlPortGroup();
117 
119  virtual DtVrfMovingObjectStateRepository* getSR() {return myEntityState;}
120 
126  static DtReaderWriter* provideOrderedSpeed(void* controller);
128 
129 protected:
134  virtual void moveToWithFinalSpeed(const DtVector& localDestination,
135  const double cruiseSpeed, const double finalSpeed);
138  virtual void moveToWithFinalSpeed(const double goalHeading,
139  const double cruiseSpeed, const double finalSpeed);
140 
145  virtual void turn(double desiredRate);
146 
152  virtual void turn(double desiredRate, double desiredHeading);
153 
156  virtual void immediateNormalStop();
157 
158 protected:
169  virtual double calculateControlForTurn(double yawAngle,
170  double desiredRate);
171 
191  virtual double calculateNormalAcceleration(double cruiseSpeed,
192  double distance, double turnAngle, double finalSpeed);
193 
198  virtual double calculateNormalAcceleration(double desiredSpeed);
199 
208  virtual double limitedAcceleration(double desiredAcceleration,
209  double desiredSpeed);
210 
218  virtual double followerAcceleration(double dT,
219  double distance, double maxDeceleration,
220  double followerSpeed, double leaderSpeed);
221 
222 public:
226  static DtSimComponent * creator(const DtString& name,
227  DtLocalObject* owner,
228  DtSimulationServices* simManager,
229  DtComponentDescriptor* desc = 0,
230  DtReaderWriterRegistry* parentRegistry = 0);
231 
232 protected:
233 
235  virtual bool createPortGroups();
236 
238  virtual bool createPorts();
239 
247  virtual void lookupAndCacheProcessSR();
248 
252  virtual bool postAddComponentsInit();
253 
257  virtual bool decideToGiveUpTask() const;
258 
260  {
261  return myPlatformLocalObjectFacade;
262  }
263 
264 protected:
265 
268 
271  const DtSurfaceEntityPilotController & orig);
272 
275  const DtSurfaceEntityPilotController & orig);
276 
277 protected:
278 
281 
284 
291 
292 
304 
310 
314 
317 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Definition: surfaceEntityParameters.h:24
DtSurfaceEntityPilotControllerDescriptor * myDescriptor
Definition: surfaceEntityPilotController.h:280
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:31
DtVrfMovingObjectStateRepository * myEntityState
Definition: surfaceEntityPilotController.h:279
DtOutputPortGroup * mySurfaceControlPortGroup
Output Port Group Name: surface-control Output Port Group Description: acceleration, clamp speed, turn rate, and final heading ports.
Definition: surfaceEntityPilotController.h:308
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
Definition: surfaceMovementPSR.h:58
DtAnalogOutputPort * myTurnRatePort
Rotation rate in radians/sec. Positive is to the right.
Definition: surfaceEntityPilotController.h:301
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
Definition: readerWriter.h:85
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
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtAnalogOutputPort * myFinalHeadingPort
A clamp heading, similar to clamp speed.
Definition: surfaceEntityPilotController.h:303
DtAnalogOutputPort * myAccelerationPort
The goal speed; used by the actuator to prevent accelerating past the desired speed if dT is much lon...
Definition: surfaceEntityPilotController.h:296
Provides a simple, kinematics-based model for surface vessels.
Definition: surfaceEntityActuator.h:46
double myDistanceSquared
A controller-global value that several functions test. Not needed between ticks.
Definition: surfaceEntityPilotController.h:313
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
virtual DtVrfMovingObjectStateRepository * getSR()
Gets the entity state repository for purposes of providing attributes.
Definition: surfaceEntityPilotController.h:119
const DtSurfaceEntityParameters * myParameters
Cache a pointer to the entity parameters.
Definition: surfaceEntityPilotController.h:283
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: surfaceEntityPilotController.h:316
DtPlatformLocalObjectFacade & platformLocalObjectFacade()
Definition: surfaceEntityPilotController.h:259
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
virtual bool decideToGiveUpTask() const
This function is used to determine if the controller should give up trying to execute the current tas...
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:89
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Contains class declaration for DtSurfaceEntityPilotControllerDescriptor; descriptor for the DtSurface...
Definition: surfaceEntityPilotControllerDescriptor.h:25
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
The DtSurfaceEntityPilotController provides basic movement capabilities for surface entities and crea...
Definition: surfaceEntityPilotController.h:78
DtAnalogOutputPort * myClampSpeedPort
The goal speed; used by the actuator to prevent accelerating past the desired speed if dT is much lon...
Definition: surfaceEntityPilotController.h:299
DtSurfaceMovementPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: surfaceEntityPilotController.h:290
virtual bool postAddComponentsInit()
Calls enableTaskTypes()
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
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)