VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
shipClutterMovementController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include "vrfutil/aisTrack.h"
12 #include "vrfutil/scriptGeometry.h"
13 
15 
16 
17 
18 class DtAnalogOutputPort;
23 class DtSimMessage;
24 class DtTaskMessage;
25 
26 
29 {
30 
31 public:
32 
36  DtLocalObject* owner,
37  DtSimulationServices* simManager,
38  DtComponentDescriptor* desc = 0,
39  DtReaderWriterRegistry* parentRegistry = 0);
40 
43 
46  virtual const char* type() const override;
47 
49  virtual bool init() override;
50 
52  virtual void tick() override;
53 
56  virtual void clearTask() override;
57 
61  static DtSimComponent * creator(const DtString& name,
62  DtLocalObject* owner,
63  DtSimulationServices* simManager,
64  DtComponentDescriptor* desc = 0,
65  DtReaderWriterRegistry* parentRegistry = 0);
66 
68  static void clutterMoveCallback(DtSimMessage* msg, void* usr);
69 
71  static void taskCompleteCallback(DtSimMessage* msg, void* usr);
72 
73 protected:
74 
77 
79  virtual bool createPortGroups() override;
80 
82  //virtual bool createSurfaceControlPortGroup();
83 
85  virtual bool createUpdateRepositoryPortGroup();
86 
88  //virtual bool createPorts();
89 
97  virtual void lookupAndCacheProcessSR();
98 
99  virtual void registerTaskMsgCallbacks() override;
100 
110  virtual bool getInitialAisInformation();
111 
113  void processClutterMove(const DtTaskMessage* msg);
114 
115  virtual void processTaskComplete(DtSimMessage* msg);
117 
123  virtual bool setUpNextPathPoint();
124 
130  virtual bool setUpMoveToCurrentPoint();
131 
137  virtual bool canTurnToTarget(const DtLocation3D& currentPosition,
138  const DtLocation3D& targetPosition);
139 
142  virtual double currentTurnRadius(const double speed);
143 
145  virtual void isClutterChanged() override;
146 
147  virtual void updateTaskVisualizations() override;
148 
149  typedef
150  enum
151  {
154  moveModeAnimate
155  } MoveModeEnum;
156 
157 protected:
158 
161 
164  const DtShipClutterMovementController & orig);
165 
168  const DtShipClutterMovementController & orig);
169 
170 protected:
171 
175  //DtAnalogOutputPort *myAccelerationPort;
178  //DtAnalogOutputPort *myClampSpeedPort;
180  //DtAnalogOutputPort *myTurnRatePort;
182  //DtAnalogOutputPort *myFinalHeadingPort;
183 
187  //DtOutputPortGroup* mySurfaceControlPortGroup;
188 
194 
197 
200 
203 
207 
210 
212  int myMmsi;
213 
216 
219 
227 
229 
233 };
double myMoveEndTime
Definition: shipClutterMovementController.h:221
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Definition: surfaceEntityParameters.h:24
const DtAisTrack * myAisTrack
Convenient pointer to AIS track.
Definition: shipClutterMovementController.h:209
int myMmsi
MMSI passed from the task.
Definition: shipClutterMovementController.h:212
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
const DtSurfaceEntityParameters * myParameters
Definition: shipClutterMovementController.h:202
The DtShipClutterMovementController provides low-fidelity movement for clutter entities.
Definition: shipClutterMovementController.h:28
Abstract interface class to the AIS data service. This service provides access to Automatic Identific...
Definition: aisDataServiceInterface.h:28
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryPortGroup
A standard port group with ports already defined in it. For output to the updateRepository actuator i...
Definition: shipClutterMovementController.h:192
virtual void registerTaskMsgCallbacks()
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
double myMoveStartTime
Definition: shipClutterMovementController.h:220
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: shipClutterMovementController.h:196
Definition: readerWriterRegistry.h:39
DtVector myLocalVelocityToTarget
Definition: shipClutterMovementController.h:223
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:437
MoveModeEnum
Definition: shipClutterMovementController.h:149
virtual bool init() override
Calls setRadio()
DtVector myLocalStartPosition
Definition: shipClutterMovementController.h:222
DtAisDataServiceInterface * myAisService
Convenience pointer to AIS Data Service.
Definition: shipClutterMovementController.h:199
DtSurfaceEntityStateRepository * mySurfaceEntityState
Definition: shipClutterMovementController.h:201
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
double myStartHeading
Definition: shipClutterMovementController.h:224
Definition: shipClutterMovementController.h:152
File: simMsg.h.
Definition: simMessage.h:35
Class definition for one track created from AIS messages, i.e. the identifying information and time-s...
Definition: aisTrack.h:60
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
This repository holds all information that is common to all the forms of local surface entities withi...
Definition: surfaceEntityStateRepository.h:26
int myWarningsGiven
Indicates that a warning message about initialization has been printed already. Counts failures...
Definition: shipClutterMovementController.h:232
MoveModeEnum myMoveMode
Indicates what movement mode the controller is using to get the ship to the next point.
Definition: shipClutterMovementController.h:206
virtual void isClutterChanged()
Called when the is-clutter setting changes.
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:95
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
std::map< double, DtPathPoint >::const_iterator DtPathPointIter
Definition: aisDataServiceInterface.h:36
double myHeadingChangeRate
Definition: shipClutterMovementController.h:225
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtAisDataServiceInterface::DtPathPointIter myCurrentPointIter
Point the ship is moving toward currently.
Definition: shipClutterMovementController.h:215
Definition: shipClutterMovementController.h:153
double myTargetHeading
Definition: shipClutterMovementController.h:226
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:31
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
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)