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();
#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:32
bool myNotInitialized
Definition: roadMovementController.h:382
DtRoadSegmentList myRoadPath
This path is computed, and includes the lane connections and the geometry of the paths connecting the...
Definition: roadMovementController.h:378
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:450
DtRoadDrivingLogic * myDrivingLogic
Class to hold functions defining the driving logic.
Definition: roadMovementController.h:361
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:365
DtRoadMovementUpdater * myRoadUpdater
Class to hold functions that perform the kinematic update and compute the resulting position...
Definition: roadMovementController.h:371
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:197
virtual DtRailMovementControllerPSR * psr()
Definition: roadMovementController.h:189
DtRoadSegment * myCurrentRoadSegment
Definition: roadMovementController.h:379
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:400
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:404
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:47
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
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:445
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:384
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:352
double myFrontOffset
Distance from entity center to front. This is computed as boundingVolume->halfLength + boundingVolume...
Definition: roadMovementController.h:389
DtRoadMovementController is a movement controller that models an entity's movement along a road path...
Definition: roadMovementController.h:65
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
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:340
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:436
std::vector< DtVector > myObstacleLocations
These visualizations are updated every tick.Location of obstacle vehicles that constrain movement...
Definition: roadMovementController.h:442
DtRailSegmentList myPath
This is the input path to the controller.
Definition: roadMovementController.h:375
bool myHaveCreatedDebugVis
Several visualizations are created once and never updated. They are created only if the entity notify...
Definition: roadMovementController.h:431
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:458
std::vector< DtVector > myTaskVisPath
For debug visualizationThe path of the road segments. Holds world (geoc) coordinates. Computed once.
Definition: roadMovementController.h:410
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:342
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:419
DtRoadPathFunctions * myRoadPathFunctions
Class to hold functions that process lists of road segments, i.e. a road path. These functions create...
Definition: roadMovementController.h:358
const DtRailSegmentList * path() const
Definition: roadMovementController.h:264
DtRailMovementControllerPSR * myProcessState
Definition: roadMovementController.h:339
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:434
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
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:79
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
File: railMoveAlongTask.h.
Definition: railMoveAlongTask.h:50
bool myWarnedAboutMissingConvoyLeaderOnce
Definition: roadMovementController.h:383
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:415
DtVrfMovingObjectStateRepository * myMovingStateRep
Definition: roadMovementController.h:341
Description of one segment of a road.
Definition: roadSegment.h:394
bool myDrivingOnLeft
Definition: roadMovementController.h:381
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
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:422
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:453
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