16 #include <matrix/vlVector.h>
43 #define DT_RAIL_SEGMENT_MERGE_ERROR_BOUND 0.3
84 virtual const char*
type()
const;
103 virtual void clear();
128 static void moveAlongCallback(
DtSimMessage * msg,
void * usr);
130 static void setConvoyFollowCallback(
DtSimMessage * msg,
void * usrData);
133 static void settingsObjectConsumerCallback(
const DtSettingsObject* settingsObject,
void* usr);
150 myRoadConstants = rc;
156 myRoadPathFunctions = pf;
167 return myRoadObstructionFinder;
172 myRoadObstructionFinder = of;
190 {
return myProcessState; }
192 {
return myObjectParams; }
198 virtual bool drivingOnLeftEnabled()
const;
207 virtual double frontOffset()
const;
208 virtual void setFrontOffset(
const double o);
213 virtual double rearAxleOffset()
const;
214 virtual void setRearAxleOffset(
const double o);
238 virtual bool findPointOnTerrain(
const DtVector& worldLocation,
DtVector& worldLocationOnTerrain);
243 return myObstacleLocations;
249 return myObstacleBoxes;
255 virtual const double followSpeedFactor()
const;
257 virtual double getDistanceBehindConvoyTarget(
const DtSimObject* convoyTgt)
const;
283 virtual bool createPSR();
286 virtual bool createUpdater();
287 virtual bool createPathFunctions();
290 virtual bool createRoadObstructionFinder();
292 virtual bool createDrivingLogic();
301 virtual void processSetConvoyFollowCallback(
DtSimMessage * msg);
319 virtual int entryLanePosition(
double heading,
unsigned int numLanes);
326 virtual void clearPath();
331 virtual void initiateLaneChange(
const int newLaneNum);
335 virtual void checkPathEnd();
346 virtual void manageRoadSegmentElevationLookup();
348 virtual void setLastSegmentWithElevation(
DtRoadSegment* seg);
350 static void scriptedSetCallback(
DtSimMessage *msg,
void * usrData);
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtRailMovementState
Used to keep the current state of an entity as it travels along a route using the rail system...
Definition: railMovementControllerPSR.h:33
bool myNotInitialized
Definition: roadMovementController.h:404
DtRoadSegmentList myRoadPath
This path is computed, and includes the lane connections and the geometry of the paths connecting the...
Definition: roadMovementController.h:394
virtual std::vector< std::vector< DtVector > > & debugBoxes()
Accessor for the array of 4-point arrays representing areas where the controller is looking for obsta...
Definition: roadMovementController.h:247
std::vector< std::vector< DtVector > > myObstacleBoxes
A set of polygons representing bounding volumes of the lanes to search for obstacle vehicles...
Definition: roadMovementController.h:472
DtRoadDrivingLogic * myDrivingLogic
Class to hold functions defining the driving logic.
Definition: roadMovementController.h:377
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:31
Definition: boolSetting.h:30
DtRoadObstructionFinder * myRoadObstructionFinder
Class to hold functions that find obstructions (vehicles) along the entity's current lane and adjacen...
Definition: roadMovementController.h:381
DtRoadMovementUpdater * myRoadUpdater
Class to hold functions that perform the kinematic update and compute the resulting position...
Definition: roadMovementController.h:387
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:197
virtual DtRailMovementControllerPSR * psr()
Definition: roadMovementController.h:189
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtRoadSegment * myCurrentRoadSegment
Definition: roadMovementController.h:395
double myRearAxleOffset
Offset in x from entity center to the center of the rear axle. When turning, the turn circle center i...
Definition: roadMovementController.h:422
virtual void setDrivingLogic(DtRoadDrivingLogic *dl)
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:160
DtRoadSegmentPart myRoadSegmentPart
Keeps track of what part of the road segment the vehicle currently occupies (entry curve...
Definition: roadMovementController.h:426
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtRailSegment are segments entities can follow when using the rail movement system.
Definition: railSegment.h:23
Instances of DtRailMovementControllerPSR are used to hold the shared/checkpointable data for a rail m...
Definition: railMovementControllerPSR.h:48
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
virtual DtRoadMovementUpdater * movementUpdater()
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:175
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
virtual const DtRoadConstants * roadConstants()
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:143
int myLastNumObstaclePoints
The number of obstacles last tick.
Definition: roadMovementController.h:467
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
bool myRoadAltitudesSet
Definition: roadMovementController.h:406
A container for constants that define the path of a vehicle on the road in terms of design-vehicles a...
Definition: roadConstants.h:21
Definition: roadPathFunctions.h:19
Definition: readerWriterRegistry.h:39
const DtRoadConstants * myRoadConstants
The following members hold classes that define key functions of the driving controller. By setting them to derived classes, these functions can be modified.
Definition: roadMovementController.h:368
double myFrontOffset
Distance from entity center to front. This is computed as boundingVolume->halfLength + boundingVolume...
Definition: roadMovementController.h:411
DtRoadMovementController is a movement controller that models an entity's movement along a road path...
Definition: roadMovementController.h:65
Definition: settingsObject.h:27
std::list< DtRoadSegment * > DtRoadSegmentList
Definition: roadSegment.h:377
virtual DtRoadPathFunctions * pathFunctions()
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:153
const DtRoadMovementDescriptor * myRoadMoveDescriptor
Definition: roadMovementController.h:356
virtual const DtMovingObjectParameters * objectParameters()
Definition: roadMovementController.h:191
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:437
virtual bool init() override
Calls setRadio()
std::vector< DtVector > myObstacleLocations
These visualizations are updated every tick.Location of obstacle vehicles that constrain movement...
Definition: roadMovementController.h:464
DtRailSegmentList myPath
This is the input path to the controller.
Definition: roadMovementController.h:391
bool myHaveCreatedDebugVis
Several visualizations are created once and never updated. They are created only if the entity notify...
Definition: roadMovementController.h:453
virtual void setRoadConstants(const DtRoadConstants *rc)
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:148
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: roadMovementController.h:480
std::vector< DtVector > myTaskVisPath
For debug visualizationThe path of the road segments. Holds world (geoc) coordinates. Computed once.
Definition: roadMovementController.h:432
Models an entity moving along a generated road path. Provides a kinematics-based model of an entity m...
Definition: roadMovementUpdater.h:42
const DtMovingObjectParameters * myObjectParams
Definition: roadMovementController.h:358
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
virtual std::vector< DtVector > & debugPoints()
Accessor for the individual points representing obstacle vehicles.
Definition: roadMovementController.h:241
virtual bool tickWhileDestroyed() const
If the component returns true here, it will be ticked regardless of the destroyed state of the host e...
The moving-object-param parameter type is used for objects that are capable of movement, such as individual entities and aggregates. DtMovingObjectParameters; holds all of the configurable parameters for the DtVrfMovingObjectStateRepository class. Parameters include support points, maximum speed, maximum reverse speed, turning radius, maximum slope, ordered speed, maximum acceleration, maximum deceleration, and fuel efficiency. Aggregates are moving objects and have this parameter type. All of the platform-specific parameter types derive from this one. .
Definition: movingObjectParameters.h:32
std::map< DtRoadSegment *, unsigned > myRoadSegmentTaskVisMap
Maps road segments to the index of the task vis path points that make up this segment.
Definition: roadMovementController.h:441
DtRoadPathFunctions * myRoadPathFunctions
Class to hold functions that process lists of road segments, i.e. a road path. These functions create...
Definition: roadMovementController.h:374
const DtRailSegmentList * path() const
Definition: roadMovementController.h:264
DtRailMovementControllerPSR * myProcessState
Definition: roadMovementController.h:355
DtRoadSegmentPart
This enumeration is a convenience for indicating what part of the lane geometry a point is on...
Definition: roadSegment.h:381
std::vector< DtVector > myOriginalPath
Holds the start (local) locations of the original rail path segments.
Definition: roadMovementController.h:456
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:88
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtRoadSegment * myLastSegmentWithElevation
The last road segment that the controller has successfully obtained terrain elevation for...
Definition: roadMovementController.h:399
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
File: railMoveAlongTask.h.
Definition: railMoveAlongTask.h:50
bool myWarnedAboutMissingConvoyLeaderOnce
Definition: roadMovementController.h:405
std::vector< DtVector > myCurrentTaskVisPath
The currently displayed task vis path. Only a portion of myTaskVisPath is shown at any given time to ...
Definition: roadMovementController.h:437
DtVrfMovingObjectStateRepository * myMovingStateRep
Definition: roadMovementController.h:357
Description of one segment of a road.
Definition: roadSegment.h:394
bool myDrivingOnLeft
Definition: roadMovementController.h:403
An object containing functions to find obstructions in road segments in a road path; part of a DtRoad...
Definition: roadObstructionFinder.h:30
virtual void setPathFunctions(DtRoadPathFunctions *pf)
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:154
virtual void setObstructionFinder(DtRoadObstructionFinder *of)
After creating a new obstFinder, call init() on it.
Definition: roadMovementController.h:170
virtual DtRoadDrivingLogic * drivingLogic()
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:159
int myLastSegmentIndex
For debugging output.
Definition: roadMovementController.h:401
Definition: railSplineCalculator.h:25
virtual void setMovementUpdater(DtRoadMovementUpdater *u)
After creating a new updater, call init(), setEntityState(), and setPSR() on the new updater...
Definition: roadMovementController.h:179
Definition: roadDrivingLogic.h:18
unsigned myCurrentTaskVisPathPtIndex
The current starting point index of the displayed task vis path.
Definition: roadMovementController.h:444
virtual DtRoadObstructionFinder * obstructionFinder()
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:165
DtBoost::shared_ptr< DtRailObstruction > DtRailObstructionPtr
Definition: railObstructionInfo.h:78
int myLastNumBoxes
The number of boxes last tick.
Definition: roadMovementController.h:475
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 DtComponentDescriptor that has parameters that indicate how an entity should move along a rail segm...
Definition: roadMovementDescriptor.h:24