16 #include <matrix/vlVector.h>
43 #define DT_RAIL_SEGMENT_MERGE_ERROR_BOUND 0.3
84 virtual const char*
type()
const override;
90 virtual bool init()
override;
103 virtual void tick()
override;
105 virtual void clear();
131 static void moveAlongCallback(
DtSimMessage * msg,
void * usr);
133 static void setConvoyFollowCallback(
DtSimMessage * msg,
void * usrData);
136 static void settingsObjectConsumerCallback(
const DtSettingsObject* settingsObject,
void* usr);
153 myRoadConstants = rc;
159 myRoadPathFunctions = pf;
170 return myRoadObstructionFinder;
175 myRoadObstructionFinder = of;
193 {
return myProcessState; }
195 {
return myObjectParams; }
201 virtual bool drivingOnLeftEnabled()
const;
210 virtual double frontOffset()
const;
211 virtual void setFrontOffset(
const double o);
216 virtual double rearAxleOffset()
const;
217 virtual void setRearAxleOffset(
const double o);
220 virtual DtVector localRearAxleLocation()
const;
244 virtual bool findPointOnTerrain(
const DtVector& worldLocation, DtVector& worldLocationOnTerrain);
249 return myObstacleLocations;
255 return myObstacleBoxes;
261 virtual const double followSpeedFactor()
const;
263 virtual double getDistanceBehindConvoyTarget(
const DtSimObject* convoyTgt)
const;
291 virtual bool createPSR();
294 virtual bool createUpdater();
295 virtual bool createPathFunctions();
298 virtual bool createRoadObstructionFinder();
300 virtual bool createDrivingLogic();
309 virtual void processSetConvoyFollowCallback(
DtSimMessage * msg);
327 virtual int entryLanePosition(
double heading,
unsigned int numLanes);
334 virtual void clearPath();
339 virtual void initiateLaneChange(
const int newLaneNum);
343 virtual void checkPathEnd();
354 virtual void manageRoadSegmentElevationLookup();
356 virtual void setLastSegmentWithElevation(
DtRoadSegment* seg);
358 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:412
DtRoadSegmentList myRoadPath
This path is computed, and includes the lane connections and the geometry of the paths connecting the...
Definition: roadMovementController.h:402
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:253
std::vector< std::vector< DtVector > > myObstacleBoxes
A set of polygons representing bounding volumes of the lanes to search for obstacle vehicles...
Definition: roadMovementController.h:480
DtRoadDrivingLogic * myDrivingLogic
Class to hold functions defining the driving logic.
Definition: roadMovementController.h:385
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:389
DtRoadMovementUpdater * myRoadUpdater
Class to hold functions that perform the kinematic update and compute the resulting position...
Definition: roadMovementController.h:395
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:194
virtual DtRailMovementControllerPSR * psr()
Definition: roadMovementController.h:192
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:403
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:430
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:163
DtRoadSegmentPart myRoadSegmentPart
Keeps track of what part of the road segment the vehicle currently occupies (entry curve...
Definition: roadMovementController.h:434
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:20
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:178
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:146
int myLastNumObstaclePoints
The number of obstacles last tick.
Definition: roadMovementController.h:475
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:414
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:376
double myFrontOffset
Distance from entity center to front. This is computed as boundingVolume->halfLength + boundingVolume...
Definition: roadMovementController.h:419
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtRoadMovementController is a movement controller that models an entity's movement along a road path...
Definition: roadMovementController.h:65
virtual bool beginProcessingTask(const DtTaskMessage &task, DtSimTaskStatePtr taskState) override
Called by the task manager when this controller should start executing the specified task...
Definition: settingsObject.h:27
std::list< DtRoadSegment * > DtRoadSegmentList
Definition: roadSegment.h:389
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:156
std::shared_ptr< DtRailObstruction > DtRailObstructionPtr
Definition: railObstructionInfo.h:78
const DtRoadMovementDescriptor * myRoadMoveDescriptor
Definition: roadMovementController.h:364
virtual const DtMovingObjectParameters * objectParameters()
Definition: roadMovementController.h:194
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:443
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:472
DtRailSegmentList myPath
This is the input path to the controller.
Definition: roadMovementController.h:399
bool myHaveCreatedDebugVis
Several visualizations are created once and never updated. They are created only if the entity notify...
Definition: roadMovementController.h:461
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:151
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: roadMovementController.h:488
std::vector< DtVector > myTaskVisPath
For debug visualizationThe path of the road segments. Holds world (geoc) coordinates. Computed once.
Definition: roadMovementController.h:440
Models an entity moving along a generated road path. Provides a kinematics-based model of an entity m...
Definition: roadMovementUpdater.h:48
const DtMovingObjectParameters * myObjectParams
Definition: roadMovementController.h:366
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:247
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:449
DtRoadPathFunctions * myRoadPathFunctions
Class to hold functions that process lists of road segments, i.e. a road path. These functions create...
Definition: roadMovementController.h:382
const DtRailSegmentList * path() const
Definition: roadMovementController.h:270
DtRailMovementControllerPSR * myProcessState
Definition: roadMovementController.h:363
DtRoadSegmentPart
This enumeration is a convenience for indicating what part of the lane geometry a point is on...
Definition: roadSegment.h:393
std::vector< DtVector > myOriginalPath
Holds the start (local) locations of the original rail path segments.
Definition: roadMovementController.h:464
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
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:80
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:407
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
File: railMoveAlongTask.h.
Definition: railMoveAlongTask.h:34
bool myWarnedAboutMissingConvoyLeaderOnce
Definition: roadMovementController.h:413
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:445
DtVrfMovingObjectStateRepository * myMovingStateRep
Definition: roadMovementController.h:365
Description of one segment of a road.
Definition: roadSegment.h:406
bool myDrivingOnLeft
Definition: roadMovementController.h:411
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:157
virtual void setObstructionFinder(DtRoadObstructionFinder *of)
After creating a new obstFinder, call init() on it.
Definition: roadMovementController.h:173
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:162
int myLastSegmentIndex
For debugging output.
Definition: roadMovementController.h:409
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:182
Definition: roadDrivingLogic.h:18
unsigned myCurrentTaskVisPathPtIndex
The current starting point index of the displayed task vis path.
Definition: roadMovementController.h:452
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:168
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
int myLastNumBoxes
The number of boxes last tick.
Definition: roadMovementController.h:483
A locally simulated VRF object.
Definition: localObject.h:98
A DtComponentDescriptor that has parameters that indicate how an entity should move along a rail segm...
Definition: roadMovementDescriptor.h:25