VR-Forces 4.8 Class Documentation
 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 
14 
16 #define REDUCED_ACCELERATION_FACTOR 0.5
17 #define PROPORTIONAL_SPEED_CONTROL 1.0
19 #define DIRECT_HEADING_CONTROL_ANGLE 0.5
24 #define HEADING_GOAL_EPSILON 0.001
30 class DtString;
31 class DtSimManager;
32 class DtAnalogOutputPort;
38 class DtTaskMessage;
40 
75 
79 {
80 
81 public:
82 
89  DtVrfObject* owner,
90  DtSimManager* simManager,
91  DtComponentDescriptor* desc = 0,
92  DtReaderWriterRegistry* parentRegistry = 0);
93 
98 
101  virtual const char* type() const;
102 
105  virtual bool init();
106 
109  virtual void tick();
110 
113  virtual void clearTask();
115  virtual bool createSurfaceControlPortGroup();
116 
118  virtual DtVrfMovingObjectStateRepository* getSR() {return myEntityState;}
119 
125  static DtReaderWriter* provideOrderedSpeed(void* controller);
127 
128 protected:
133  virtual void moveToWithFinalSpeed(const DtVector& localDestination,
134  const double cruiseSpeed, const double finalSpeed);
137  virtual void moveToWithFinalSpeed(const double goalHeading,
138  const double cruiseSpeed, const double finalSpeed);
139 
144  virtual void turn(double desiredRate);
145 
151  virtual void turn(double desiredRate, double desiredHeading);
152 
155  virtual void immediateNormalStop();
156 
157 protected:
168  virtual double calculateControlForTurn(double yawAngle,
169  double desiredRate);
170 
190  virtual double calculateNormalAcceleration(double cruiseSpeed,
191  double distance, double turnAngle, double finalSpeed);
192 
197  virtual double calculateNormalAcceleration(double desiredSpeed);
198 
207  virtual double limitedAcceleration(double desiredAcceleration,
208  double desiredSpeed);
209 
217  virtual double followerAcceleration(double dT,
218  double distance, double maxDeceleration,
219  double followerSpeed, double leaderSpeed);
220 
221 public:
225  static DtSimComponent * creator(const DtString& name,
226  DtVrfObject* owner,
227  DtSimManager* simManager,
228  DtComponentDescriptor* desc = 0,
229  DtReaderWriterRegistry* parentRegistry = 0);
230 
231 protected:
232 
234  virtual bool createPortGroups();
235 
237  virtual bool createPorts();
238 
246  virtual void lookupAndCacheProcessSR();
247 
251  virtual bool postAddComponentsInit();
252 
256  virtual bool decideToGiveUpTask() const;
257 
258 protected:
259 
262 
265  const DtSurfaceEntityPilotController & orig);
266 
269  const DtSurfaceEntityPilotController & orig);
270 
271 
272 protected:
273 
276 
279 
286 
287 
299 
305 
309 
310 };
#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:144
Definition: surfaceEntityParameters.h:24
DtSurfaceEntityPilotControllerDescriptor * myDescriptor
Definition: surfaceEntityPilotController.h:275
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:26
DtVrfMovingObjectStateRepository * myEntityState
Definition: surfaceEntityPilotController.h:274
DtOutputPortGroup * mySurfaceControlPortGroup
Output Port Group Name: surface-control Output Port Group Description: acceleration, clamp speed, turn rate, and final heading ports.
Definition: surfaceEntityPilotController.h:303
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:296
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:42
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...
DtAnalogOutputPort * myFinalHeadingPort
A clamp heading, similar to clamp speed.
Definition: surfaceEntityPilotController.h:298
DtAnalogOutputPort * myAccelerationPort
Definition: surfaceEntityPilotController.h:291
Provides a simple, kinematics-based model for surface vessels.
Definition: surfaceEntityActuator.h:46
double myDistanceSquared
A controller-global value that several functions test.
Definition: surfaceEntityPilotController.h:308
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.
virtual DtVrfMovingObjectStateRepository * getSR()
Gets the entity state repository for purposes of providing attributes.
Definition: surfaceEntityPilotController.h:118
const DtSurfaceEntityParameters * myParameters
Cache a pointer to the entity parameters.
Definition: surfaceEntityPilotController.h:278
virtual void tick()
This gives the thread of control to the component.
*array controller(no time code)*/template< class Instance
//!//!//!//!//!//!//!//!//!//!//!//
virtual bool createPorts()
Called by init.
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.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
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:77
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
DtAnalogOutputPort * myClampSpeedPort
The goal speed; used by the actuator to prevent accelerating past the desired speed if dT is much lon...
Definition: surfaceEntityPilotController.h:294
DtSurfaceMovementPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: surfaceEntityPilotController.h:285
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)