VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aggregatedMovementActuator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
15 
17 #include "features/featureSet.h"
18 #include "features/proj.h"
19 
20 #include <boost/ptr_container/ptr_vector.hpp>
21 
22 class DtInputPortGroup;
23 class DtAnalogInputPort;
27 class DtTerrainInterface;
28 class DtSetDataManager;
29 class DtBooleanInputPort;
30 class DtVectorInputPort;
32 
35 #define ALTITUDE_CHANGE_INCREMENT 304.8
36 
37 namespace MAKVRinTerra
38 {
39  class DtFeatureGeometry;
40 }
41 
48 {
49 
50 public:
51 
54  DtSimulationServices* simManager, DtComponentDescriptor* compDescriptor,
55  DtReaderWriterRegistry* parentRegistry = 0);
56 
58  virtual ~DtAggregatedMovementActuator() override;
59 
61  virtual bool init() override;
62 
64  virtual bool createPSR();
65 
67  virtual const char* type() const override;
68 
70  virtual void tick() override;
71 
78  virtual void setOrderedAltitude(double altitude, bool aboveGroundLevel = false);
79 
80 public:
81 
84  static DtSimComponent* creator(const DtString& name, DtLocalObject* object,
85  DtSimulationServices* simManager, DtComponentDescriptor* compDescriptor,
86  DtReaderWriterRegistry* parentRegistry);
87 
93  static bool setHaltMovementForObstacles(void* controller, DtReaderWriter* value);
94 
98  static bool setObstacleQueryName(void* controller, DtReaderWriter* value);
99 
103  static DtReaderWriter* isHalted(void* controller);
104 
108  static DtReaderWriter* blockingObstacle(void* controller);
109 
113  static DtReaderWriter* timeHalted(void* controller);
115 
116 protected:
117  virtual DtVector calculateProjectedLocation(
118  const DtVector& oldLocalPosition, const DtVector& newBodyVelocity,
119  double newHeading);
120 
122  virtual std::string calculateOrientationAndPosition(
123  const DtVector& newLocalProjectedLocation, double newHeading,
124  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
125 
128  virtual void calculateFuelUsage(
129  double distanceTraveled,
130  double velocity,
131  double altitude);
132 
134  virtual std::string adjustToTerrain(
135  double heading, const DtVector& location, DtVector& newNormal);
136 
137  virtual void updateRepository(const DtVector & position,
138  const DtVector & velocity, const DtVector & acceleration,
139  const DtTaitBryan & localOrientation, const DtVector& rotationalVelocity);
140 
143  virtual bool isObstructedByObstacles(const MAKVRinTerra::DtFeatureGeometry& location);
144 
146  static void setObstacleToIgnore(DtSimMessage* msg, void* usr);
147 
150  virtual void processObstacleToIgnore(DtSimMessage* msg);
151 
152 protected:
154  virtual bool createPorts() override;
155 
157  virtual bool createPortGroups() override;
158 
159  class ErrorStream;
163  virtual bool haveSupplies(ErrorStream &errorStream) const;
164 
169  virtual double scriptModifier() const;
170 
173  virtual double scriptAdjustment() const;
174 
178  virtual double maximumSpeedModifierFromFeatures(const MAKVRinTerra::DtFeatureGeometry&,
179  double& slope) const;
180 
182  virtual double retrogradeMovementModifier() const;
183 
186 
189 
193  virtual bool checkPassedDestination(const DtVector& currentPosition, DtVector& newLocalProjectedPosition);
194 
197  virtual bool setHaltMovementForObstacles(DtReaderWriter* value);
198 
202  virtual bool setObstacleQueryName(DtReaderWriter* value);
203 
211  virtual void setAircraftAirborne(const DtVector& location);
212 
216  virtual DtReaderWriter* isHalted();
217 
220  virtual DtReaderWriter* blockingObstacle();
221 
224  virtual DtReaderWriter* timeHalted();
225 
226 protected:
227 
237  boost::optional<double> myPrep_desiredAltitude;
239 
242 
250 
257 
262 
269 
277 
282 
288 
291 
294 
297 
299  class MobilityArea : boost::noncopyable
300  {
301  public:
302  typedef boost::ptr_vector<MobilityArea> Vector;
303 
305 
306  const MobilityEntry& entry() const;
307  const FeatureSet& featureSet() const;
308 
309  private:
311  std::unique_ptr<FeatureSet> myFeatureSet;
312  };
313 
316 
317 
320  {
321  public:
322  ErrorStream() : myEmptyFlag(true) { }
323 
324  template <typename T>
325  ErrorStream& operator<< (const T& value)
326  {
327  myEmptyFlag = false;
328  myStream << value;
329  return *this;
330  }
331  std::string str() const
332  {
333  return myStream.str();
334  }
335  bool empty() const
336  {
337  return myEmptyFlag;
338  }
339 
340  private:
341  std::stringstream myStream;
343  };
344 
348 
350  std::unique_ptr<FeatureSet> myEngineeringObjFeatureSet;
351 
354  std::unique_ptr<FeatureSet> myEngineeringObjObstacleFeatureSet;
355 
357 
361 
364 };
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:105
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
std::string str() const
Definition: aggregatedMovementActuator.h:331
MAKVRinTerra::DtFeatureSet FeatureSet
Feature set type.
Definition: aggregatedMovementActuator.h:293
DtAnalogInputPort * myAltitudeInputPort
Input Port Name: desired-altitude Input Port Description: Desired altitude to move towards (MSL)...
Definition: aggregatedMovementActuator.h:268
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:31
Definition: aggregatedMovementActuatorPSR.h:24
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
DtSetDataManager * mySetDataManager
Ref to set data manager.
Definition: aggregatedMovementActuator.h:290
End User Description: Actuator for moving aggregated aggregates along the ground. This actuator place...
Definition: aggregatedMovementActuator.h:47
A convenience for recording error messages during a tick.
Definition: aggregatedMovementActuator.h:319
End User Description: DtActuatorComponentDescriptor contains parameters common to all actuator compon...
Definition: actuatorComponentDescriptor.h:47
const MobilityEntry & myEntry
Definition: aggregatedMovementActuator.h:310
bool myErrorCondition
Set to true once the error stream message is displayed, so we don&#39;t display over and over...
Definition: aggregatedMovementActuator.h:347
bool empty() const
Definition: aggregatedMovementActuator.h:335
Definition: readerWriter.h:85
const DtActuatorComponentDescriptor * myBaseActuatorDescriptor
Convenience pointers to our descriptors.
Definition: aggregatedMovementActuator.h:285
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
std::unique_ptr< FeatureSet > myEngineeringObjFeatureSet
Set of engineering object features that can affect mobility.
Definition: aggregatedMovementActuator.h:350
DT_DLL_features std::ostream & operator<<(std::ostream &, const DtFeatureTransform &)
std::ostream output.
Definition: readerWriterRegistry.h:39
End User Description: DtActuator is the base class for all actuator model components. Developer Description: The DtActuator base class caches a pointer to the entity&#39;s radio for convenience. Derived classes may have articulated parts that are configured from the DtActuatorComponentDescriptor&#39;s DtSimArtPartDescriptorList. For each articulated part in the list a DtArticulatedPartStateRepository will be created to store the data for the part such as it&#39;s location, rotation and so forth. These are created in the entity&#39;s DtVrfObjectStateRepository createParts() function. This call creates all the attached parts for all the actuators. These articulated state repositories are managed by the DtAttachmentManager. They are cached by their partType which is the DIS Enumeration describing the part from the disEnums.h file and was specified in the actuator&#39;s DtActuatorComponentDescriptor as descriped above. The partType is used as the category of the DtEntityType used to look up articulated parts in the DtAttachementManager. When an actuator needs access to a particular articulated part it looks it up by the part&#39;s object type.
Definition: actuatorComponent.h:47
const DtAggregatedMovementDescriptor * myActuatorDescriptor
Convenience pointers to our descriptors.
Definition: aggregatedMovementActuator.h:286
DtVrfMovingObjectStateRepository * myMovingObjectStateRep
Convenience pointers to our state repository.
Definition: aggregatedMovementActuator.h:280
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
boost::optional< double > myPrep_desiredAltitude
Definition: aggregatedMovementActuator.h:237
Object which hold the mobility entry and the feature set which represents it.
Definition: aggregatedMovementActuator.h:299
DtVector myPrep_newBodyRotationalVelocity
Definition: aggregatedMovementActuator.h:235
std::stringstream myStream
Definition: aggregatedMovementActuator.h:341
DtAggregateLocalObjectFacade myAggregateLocalObjectFacade
Member to allow for access to aggregate specific data.
Definition: aggregatedMovementActuator.h:363
DtBooleanInputPort * myRetrogradeInputPort
Definition: aggregatedMovementActuator.h:356
File: simMsg.h.
Definition: simMessage.h:35
virtual bool init() override
Overridden to cache a pointer to the entity&#39;s radio in this class.
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtAnalogInputPort * myMovementDirectionInputPort
Input Port Name: desired-movement-direction Input Port Description: Desired movement direction of the...
Definition: aggregatedMovementActuator.h:249
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtAggregatedMovementDescriptor is the descriptor for DtAggregatedMovementActuator.
Definition: aggregatedMovementDescriptor.h:20
DtTerrainInterface allows access to common terrain calls without having to know the terrain implement...
Definition: terrainInterface.h:93
DtVector myPrep_oldBodyVelocity
Definition: aggregatedMovementActuator.h:232
DtAnalogInputPort * mySpeedInputPort
Input Port Name: desired-speed Input Port Description: Desired speed of the entity in m/s...
Definition: aggregatedMovementActuator.h:256
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtTaitBryan myPrep_newLocalOrientationTb
Definition: aggregatedMovementActuator.h:236
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
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
std::unique_ptr< FeatureSet > myEngineeringObjObstacleFeatureSet
Set of engineering object features that should be considered obstacles for which we should halt...
Definition: aggregatedMovementActuator.h:354
DtVectorInputPort * myDestinationInputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: aggregatedMovementActuator.h:275
This class manages the distribution of DtSetDataRequests within a single DtLocalObject. Components of the object, or other parts of the code, register interested in particular types of set data messages and when such a message is processed by the DtSetDataManager, each of the registered parties is notified.
Definition: setDataManager.h:48
ReaderWriter class which represents one terrain mobility entry.
Definition: aggregatedMovementDescriptor.h:24
MobilityArea::Vector myMobilityAreas
List of mobility areas.
Definition: aggregatedMovementActuator.h:315
DtTaitBryan myPrep_oldLocalOrientationTb
Definition: aggregatedMovementActuator.h:231
DtVector myPrep_oldLocalPosition
Values preprocessed for use in tick /////////////////////!
Definition: aggregatedMovementActuator.h:229
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
Contains class declarations for DtAnalogInputPort, DtAnalogOutputPort, and DtAnalogPortData.
Definition: analogIOPort.h:25
bool myEmptyFlag
Definition: aggregatedMovementActuator.h:342
DtAggregatedMovementActuatorPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: aggregatedMovementActuator.h:360
DtVector myPrep_newLocalPosition
Definition: aggregatedMovementActuator.h:233
ErrorStream()
Definition: aggregatedMovementActuator.h:322
std::unique_ptr< FeatureSet > myFeatureSet
Definition: aggregatedMovementActuator.h:311
Definition: vrfAggregateStateRepository.h:21
boost::ptr_vector< MobilityArea > Vector
Definition: aggregatedMovementActuator.h:302
DtAggregatedMovementDescriptor::MobilityEntry MobilityEntry
Type which contains info on one type of mobility area.
Definition: aggregatedMovementActuator.h:296
Represents a feature geometry.
Definition: featureGeometry.h:40
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtVector myPrep_newRelativeVelocity
Definition: aggregatedMovementActuator.h:234
A locally simulated VRF object.
Definition: localObject.h:98
DtInputPortGroup * myMovementControlPortGroupInputPortGroup
Input Port Group Name: movement-control Input Port Group Description: Collection of inputs specifying...
Definition: aggregatedMovementActuator.h:261
DtVector myPrep_oldLocalVelocity
Definition: aggregatedMovementActuator.h:230

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)