![]() |
VR-Forces 4.0.4 Class Documentation
|
Class DtDisaggregatedMoveAlongController is a task controller that models aggregate entity move-along-route behavior. More...

Public Member Functions | |
| DtDisaggregatedMoveAlongController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtDisaggregatedMoveAlongController () |
| destructor | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual bool | init () |
| Initialize myAggregateStateRepository, myFormationState, and myAggregateMoveAlongDescriptor member variables. | |
| virtual void | registerTaskMsgCallbacks () |
| Registers moveAlongTaskCallback member function for DtMoveAlongType tasks on radio (for tasks issued in GUI or by superior). | |
| virtual void | tick () |
| Calls registerRouteCallbacksIfNeeded() to register route-related callbacks so we can be notified in the event the route changes. | |
| virtual void | clearTask () |
| If tasked, clears out myProcessState, sends clear task messages to any subordinates that are currently tasked, and calls deleteFormationRoutes() to remove any working routes this controller has created. | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
| virtual DtSimTaskStatePtr | currentTaskState () const |
| Returns pointer to a DtMoveAlongTaskState object containing status of our current move-along task. | |
Static Public Member Functions | |
| static void | moveAlongTaskCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState) |
| Callback registered with radio, invoked upon receipt of a DtMoveAlongTask. | |
| static void | taskCompleteReportCallback (DtSimMessage *msg, void *usr) |
| Callback registered with radio, invoked upon receipt of a DtTaskCompleteReport. | |
| static void | formationChangedCallback (const DtFormationState &formationState, void *usr) |
| Callback registered with formation state object (in aggregate state repository), invoked in the event that the formation state has changed. | |
| static void | routeChangedCallback (DtVrfObject *obj, void *usr) |
| Callback registered with the DtVrfObject representing the route we're following, for notification when thevroute vertices change. | |
| static void | objectAddedCb (DtVrfObject *vrfObject, void *usr) |
| Callback registered with DtVrfObjectManager for notification when objects are added. | |
| static void | objectAboutToBeRemovedCb (DtVrfObject *vrfObject, void *usr) |
| Callback registered with DtVrfObjectManager for notification when objects are removed. | |
| static void | objectManagerRemoveAndDeleteAllCallback (const DtVrfObjectManager &objectManager, void *usr) |
| Callback to be invoked when the DtVrfObjectManager's removeAndDeleteAll() member function is about to be invoked. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual void | initializeMoveAlongTask (DtVrfObject &route, DtIteratorDirection traversalDirection, bool startAtClosestPoint, DtSimTaskStatePtr taskState) |
| Initializes move along task, setting name of the route in myProcessState, registering the routeChangedCallback with the given route. | |
| virtual void | processFormationChanged (const DtFormationState &formationState) |
| If currently tasked and in the moving along route phase, calls reevaluateMoveAlongAssignments(). | |
| virtual void | processMoveAlongTask (DtSimMessage *msg, DtSimTaskStatePtr taskState) |
| Unpacks DtMoveAlongTask and calls moveAlong(). | |
| virtual void | processTaskComplete (DtSimMessage *msg) |
| If task complete report is a DtMoveAlongTask, remove corresponding entry from myCurrentlyTaskedSubordinateEchelonIds. | |
| virtual void | processRouteChanged (const DtVrfObject &obj) |
| Regenerates routes. | |
| virtual void | processObjectAdded (DtVrfObject *vrfObject) |
| Checks given vrfObject against the route we're looking for. | |
| virtual void | processObjectAboutToBeRemoved (DtVrfObject *vrfObject) |
| Checks given vrfObject against the route we're looking for. | |
| virtual void | moveTo (const DtString &routeName, bool traverseForward) |
| Issue DtMoveIntoFormation task as subtask to ourself. | |
| virtual void | moveAlong (const DtString &route, bool traverseForward, bool startAtClosestPoint) |
| Generate separate route for each subordinate, and then task subordinate to follow its own route. | |
| virtual void | generateFormationRoutes (const DtVrfObject &route, bool reverseDirection) |
| Generate routes for subordinates to follow, at offsets corresponding to their position in formation. | |
| virtual void | buildEntityRouteFollowingMap (std::map< DtVrfObject *, DtEntityRouteFollowingData > &map) |
| Generate map of which subordinate is following which generated route. | |
| virtual void | sendTaskToSubordinate (const DtSimTask &task, const DtString &subordinateObjectName) const |
| Constructs task messages and sends it to given subordinate through myRadio. | |
| virtual void | sendSetDataToSubordinate (const DtSetDataRequest &setData, const DtString &subordinateObjectName) const |
| Constructs set data request message and sends it to given subordinate through myRadio. | |
| virtual void | deleteFormationRoutes () |
| Delete all formation routes (routes generated by this controller). | |
| virtual void | onObjectManagerRemoveAndDeleteAll (const DtVrfObjectManager &objectManager) |
| De-registers for formation changed callbacks. | |
| virtual bool | calculateInitialPositionAndHeadingAlongRoute (const DtVrfObject &route, bool traverseForward, DtVector &initialPosition, double &initialHeading) |
| Determines location and heading of aggregate at the logical beginning of the route the aggregate wants to follow. | |
| virtual void | sendVrfObjectModifyMsg (const DtEntityIdentifier &id, DtList *vertices) const |
| Sends DtIfModifyVrfObject interface message for given object id, with updated set of vertices. | |
| virtual void | initializeNextRouteIndex () |
| Initialize counter used to generate working route names. | |
| virtual unsigned int | nextRouteIndex () |
| Next available index to use when constructing working route names. | |
| virtual bool | buildOffsetRoute (const DtList &localRouteVertexList, const DtVector &bodyOffset, bool reverseDirection, bool generateRoutesWithRoundedCorners, double vertexSpacingAlongRoundedCorners, DtList &geocentricOffsetRouteVertexList) |
| Builds route at body offset relative to given route. | |
| virtual void | registerRouteCallbacksIfNeeded () |
| If tasked and we have not yet registered any callbacks with move-along route, register callbacks to either discover route, or be notified when route changes and when it is about to be removed. | |
| virtual void | initializeMemberDataFromDescriptor (const DtAggregateMoveAlongDescriptor &desc) |
| Initializes myGenerateRoutesWithRoundedCorners, myVertexSpacingAlongRoundedCorners, myMaintainFormationTickInterval, and myMaintainFormationMonitor data members with data in descriptor. | |
| virtual void | maintainMovementInFormation () |
| If currently tasked and in the moving along route state, montiors subordinates' speed using myMaintainFormationMonitor, and calls task complete if behavior is complete. | |
| virtual void | reevaluateMoveAlongAssignments () |
| Prunes entities no longer part of current formation from process state repository. | |
| virtual void | sendClearTask (const DtString &recipientName, int taskType) const |
| Sends a clear task request to the given receipient on this entity's command radio. | |
| virtual bool | adjustOffsetRouteStart (std::vector< DtVector > &route) const |
| Adjusts the start of a given offset route. | |
| virtual bool | adjustOffsetRouteEnd (std::vector< DtVector > &route) const |
| Adjusts the ending point of a given offset route. | |
| virtual bool | extendRouteStart (std::vector< DtVector > &route, double distance) const |
| Extends route by given distance at start of route, extending the first segment by the given distance. | |
| virtual bool | clipRouteEnd (std::vector< DtVector > &route, double distance) const |
| Clips end of given route by distance. | |
| virtual DtMaintainFormationMonitor * | createFormationMonitor (DtVrfObject *entity) const |
| Creates an instance of a DtMaintainFormationMonitor. | |
| virtual bool | publishFormationRoutes () const |
| virtual bool | shouldGroundClamp () const |
Protected Attributes | |
| std::map< int, DtString > | myPromotionIndexRouteNameMap |
| Map of formation positions to generated route object names. | |
| DtMaintainFormationMonitor * | myMaintainFormationMonitor |
| Object that monitors current subordinate positions and adjusts them if necessary to maintain correct formation shape while moving. | |
| double | myMaintainFormationTickInterval |
| Simulation time interval at which myMaintainFormationMonitor should be ticked. | |
| double | myTimeToNextMaintainFormationTick |
| Simulation time for next tick of myMaintainFormationMonitor. | |
| std::map< DtVrfObject *, DtEntityRouteFollowingData > | myEntityRouteFollowingMap |
| Map of subordinates and route following data. | |
| std::map< DtVrfObject *, DtEntityRouteTraversalState > | myEntityRouteTraversalStateMap |
| Map of subordinate and current route traversal state. | |
| DtVrfAggregateStateRepository * | myAggregateStateRepository |
| Pointer to aggregate's state repository, cached in this class for convenience. | |
| DtFormationState * | myFormationState |
| Pointer to aggregate's formation state object, cached in this class for convenience. | |
| DtCommandChannelRadio * | myCommandRadio |
| Pointer to aggregate's command radio, cached in this class for convenience. | |
| bool | myGenerateRoutesWithRoundedCorners |
| Flag indicating all generated route should have rounded turns. | |
| double | myVertexSpacingAlongRoundedCorners |
| Spacing in meters between extra vertices inserted in generated routes to form rounded turns. | |
| DtAggregateMoveAlongPSR * | myProcessState |
| Container for state data associated with this component. | |
| const DtAggregateMoveAlongDescriptor * | myAggregateMoveAlongDescriptor |
| Pointer to descriptor used to configure this object. | |
| bool | myRegisteredFormationChangedCallback |
| Flag used to indicate whether formation changed callback has been registered yet. | |
| bool | myRegisteredObjectCallbacks |
| Flag used to indcate whether route added/changed/removed callbacks have yet been registered. | |
| bool | myFirstTick |
| Flag used to indicate first non-zero dT() tick. | |
| unsigned int | myNextRouteIndex |
| Counter used in naming generated routes. | |
| DtSimTaskStatePtr | myCachedTaskState |
Private Member Functions | |
| DtDisaggregatedMoveAlongController () | |
| default constructor - not implemented | |
| DtDisaggregatedMoveAlongController (const DtDisaggregatedMoveAlongController &orig) | |
| copy constructor - not implemented | |
| DtDisaggregatedMoveAlongController & | operator= (const DtDisaggregatedMoveAlongController &orig) |
| assignment operator - not implemented | |
Class DtDisaggregatedMoveAlongController is a task controller that models aggregate entity move-along-route behavior.
End User Description: The DtDisaggregatedMoveAlongController models movement along a route for aggregate entities. It handles execution of DtMoveAlongTasks. Movement is implemented by creating temporary working routes for each subordinate, positioned at an offset needed to maintain that subordinate's position in formation. The controller periodically monitors subordinate's relative positions to one another and issues DtSetSpeedRequests at a relatively faster or slower speed than the ordered speed. In this way, the controller attempts to maintain the shape of the formation as the subordinates move. The movement task is considered is considered complete when all subordinates have reached the end of the route and have issued task complete reports to the aggregate. At that point, the aggregate destroys the temporary working routes and the task ends.
This controller may only be configured as a part of an entity that has a vrf-aggregate-state-repository.
Developer Description: The DtDisaggregatedMoveAlongController class registers a callback for handling DtMoveAlongTasks. When it receives a DtMoveAlongTask, it queries the aggregate's DtFormationState repository in the state repository for the current positions of its taskable subordinates in the current formation. It then creates a set of 'working' routes parallel to the original route, based on the offsets obtained from the formation state repository. It registers callbacks for handling changes to formation state, changes to route vertices, and unexpected removal of route while tasked to move along route.
Uses Descriptor Type: DtAggregateMoveAlongDescriptor
| DtDisaggregatedMoveAlongController::DtDisaggregatedMoveAlongController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtDisaggregatedMoveAlongController::~DtDisaggregatedMoveAlongController | ( | ) | [virtual] |
destructor
default constructor - not implemented
| DtDisaggregatedMoveAlongController::DtDisaggregatedMoveAlongController | ( | const DtDisaggregatedMoveAlongController & | orig | ) | [private] |
copy constructor - not implemented
| virtual DtString DtDisaggregatedMoveAlongController::type | ( | ) | const [virtual] |
Returns a string identifies the class type of component.
Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.
Implements DtTaskControllerComponent.
| virtual bool DtDisaggregatedMoveAlongController::init | ( | ) | [virtual] |
Initialize myAggregateStateRepository, myFormationState, and myAggregateMoveAlongDescriptor member variables.
Registers formationChangedCallback member function with myFormationState. Calls initializeMemberDataFromDescriptor() to initializes class members with data in myAggregateMoveAlongDescriptor.
Reimplemented from DtControllerComponent.
| virtual void DtDisaggregatedMoveAlongController::registerTaskMsgCallbacks | ( | ) | [virtual] |
Registers moveAlongTaskCallback member function for DtMoveAlongType tasks on radio (for tasks issued in GUI or by superior).
Registers taskCompleteReportCallback member function for DtTaskComplete reports on radio and command radio (so it can receive task complete reports from itself and its subordinates, respectively).
Reimplemented from DtTaskControllerComponent.
| virtual void DtDisaggregatedMoveAlongController::tick | ( | ) | [virtual] |
Calls registerRouteCallbacksIfNeeded() to register route-related callbacks so we can be notified in the event the route changes.
Calls taskStateFromPre3_8Scenario() to check if current tasked state has been read in from a pre-3.8 scenario. If true, calls upgradeTaskStateFromPre3_8Scenario() to update task state to current version. Calls initializerRouteIndex() initialize myNextRouteIndex member from process state repository. Calls maintainMovementInFormation() to maintain relative formation positions, if we're currently tasked and moving along the route.
Reimplemented from DtSimComponent.
| virtual void DtDisaggregatedMoveAlongController::clearTask | ( | ) | [virtual] |
If tasked, clears out myProcessState, sends clear task messages to any subordinates that are currently tasked, and calls deleteFormationRoutes() to remove any working routes this controller has created.
Override to send clear task messages to subordinates and delete working routes, if currently tasked.
Reimplemented from DtSingleTaskControllerComponent.
| virtual bool DtDisaggregatedMoveAlongController::createPSR | ( | ) | [virtual] |
Creates myProcessState data member, and adds it to our process state repository manager.
Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.
| virtual DtSimTaskStatePtr DtDisaggregatedMoveAlongController::currentTaskState | ( | ) | const [virtual] |
Returns pointer to a DtMoveAlongTaskState object containing status of our current move-along task.
Reimplemented from DtSingleTaskControllerComponent.
| static void DtDisaggregatedMoveAlongController::moveAlongTaskCallback | ( | DtSimMessage * | msg, |
| void * | usr, | ||
| DtSimTaskStatePtr | taskState | ||
| ) | [static] |
Callback registered with radio, invoked upon receipt of a DtMoveAlongTask.
Calls processMoveAlongTask() to handle the task message.
| msg | Message containing DtMoveAlongTask. |
| usr | Pointer to instance of this class. |
| static void DtDisaggregatedMoveAlongController::taskCompleteReportCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callback registered with radio, invoked upon receipt of a DtTaskCompleteReport.
Calls processTaskComplete() to handle the report.
| msg | Message containing DtTaskCompleteReport. |
| usr | Pointer to instance of this class. |
| static void DtDisaggregatedMoveAlongController::formationChangedCallback | ( | const DtFormationState & | formationState, |
| void * | usr | ||
| ) | [static] |
Callback registered with formation state object (in aggregate state repository), invoked in the event that the formation state has changed.
Calls processFormationChanged to handle the event.
| formationState | Formation state repository for the aggregate (maintained in aggegate state repository). |
| usr | Pointer to instance of this class. |
| static void DtDisaggregatedMoveAlongController::routeChangedCallback | ( | DtVrfObject * | obj, |
| void * | usr | ||
| ) | [static] |
Callback registered with the DtVrfObject representing the route we're following, for notification when thevroute vertices change.
Calls processRouteChanged().
| obj | Pointer to the route we're following. |
| usr | Pointer to instance of this class. |
| static void DtDisaggregatedMoveAlongController::objectAddedCb | ( | DtVrfObject * | vrfObject, |
| void * | usr | ||
| ) | [static] |
Callback registered with DtVrfObjectManager for notification when objects are added.
Calls processObjectAdded() to handle the event.
| vrfObject | Pointer to object just added to object manager (could be any type of object -- entity, aggregate, control object). |
| usr | Pointer to instance of this class. |
| static void DtDisaggregatedMoveAlongController::objectAboutToBeRemovedCb | ( | DtVrfObject * | vrfObject, |
| void * | usr | ||
| ) | [static] |
Callback registered with DtVrfObjectManager for notification when objects are removed.
Calls processObjectAboutToBeRemoved().
| vrfObject | Pointer to object representing the route we're following. |
| usr | Pointer to instance of this class. |
| static void DtDisaggregatedMoveAlongController::objectManagerRemoveAndDeleteAllCallback | ( | const DtVrfObjectManager & | objectManager, |
| void * | usr | ||
| ) | [static] |
Callback to be invoked when the DtVrfObjectManager's removeAndDeleteAll() member function is about to be invoked.
Calls onObjectManagerRemoveAndDeleteAll().
| objectManager | The object manager maintinaing all simulated objects in a VR-Forces back-end. |
| usr | Pointer to an instance of this class. |
| static DtSimComponent* DtDisaggregatedMoveAlongController::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [static] |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual void DtDisaggregatedMoveAlongController::initializeMoveAlongTask | ( | DtVrfObject & | route, |
| DtIteratorDirection | traversalDirection, | ||
| bool | startAtClosestPoint, | ||
| DtSimTaskStatePtr | taskState | ||
| ) | [protected, virtual] |
Initializes move along task, setting name of the route in myProcessState, registering the routeChangedCallback with the given route.
If startAtClosest is true, calls moveAlong() to starting moving along the route immediately. Otherwise calls moveTo() to move the aggregate to a starting point at the appropriate end of the route.
| route | The route we're tasked to follow. |
| traversalDirection | The direction we want to follow the route. A value of DtIteratorForward indicates route should be traversed in order of increasing vertex index, DtIteratorReverse indicates traversal should be in order of decreasing vertex index. |
| startAtClosestPoint | This flag indicates whether traversal should start at closest vertex (true), or at the logical beginning of the route (false). |
| virtual void DtDisaggregatedMoveAlongController::processFormationChanged | ( | const DtFormationState & | formationState | ) | [protected, virtual] |
If currently tasked and in the moving along route phase, calls reevaluateMoveAlongAssignments().
| formationState | Formation state maintained in our aggregate's state repository. |
| virtual void DtDisaggregatedMoveAlongController::processMoveAlongTask | ( | DtSimMessage * | msg, |
| DtSimTaskStatePtr | taskState | ||
| ) | [protected, virtual] |
Unpacks DtMoveAlongTask and calls moveAlong().
| msg | Message containing DtMoveAlongTask. |
| virtual void DtDisaggregatedMoveAlongController::processTaskComplete | ( | DtSimMessage * | msg | ) | [protected, virtual] |
If task complete report is a DtMoveAlongTask, remove corresponding entry from myCurrentlyTaskedSubordinateEchelonIds.
If myCurrentlyTaskedSubordinateEchelonIds is empty, calls taskComplete().
| msg | Message containing DtTaskCompleteReport. |
| virtual void DtDisaggregatedMoveAlongController::processRouteChanged | ( | const DtVrfObject & | obj | ) | [protected, virtual] |
Regenerates routes.
| obj | The route we're currently following. |
| virtual void DtDisaggregatedMoveAlongController::processObjectAdded | ( | DtVrfObject * | vrfObject | ) | [protected, virtual] |
Checks given vrfObject against the route we're looking for.
If it is ours, registers a vertices-changed callback on the object. This way we can detect if the route changes while we're trying to follow it.
| vrfObject | Pointer to the object just added to the object manager. May be any type of DtVrfObject (entity, aggregate, control object). |
| virtual void DtDisaggregatedMoveAlongController::processObjectAboutToBeRemoved | ( | DtVrfObject * | vrfObject | ) | [protected, virtual] |
Checks given vrfObject against the route we're looking for.
If it is the route we're following, calls clearTask().
| vrfObject | Pointer to the object about to be removed from the object manager. May be any type of DtVrfObject (entity, aggregate, control object). |
| virtual void DtDisaggregatedMoveAlongController::moveTo | ( | const DtString & | routeName, |
| bool | traverseForward | ||
| ) | [protected, virtual] |
Issue DtMoveIntoFormation task as subtask to ourself.
| routeName | The object name of the route we're tasked to move along. |
| traverseForward | Flag indicating if route should be traversed in order of increasing vertex index (DtIteratorForward) or decreasing vertex index (DtIteratorReverse). |
| virtual void DtDisaggregatedMoveAlongController::moveAlong | ( | const DtString & | route, |
| bool | traverseForward, | ||
| bool | startAtClosestPoint | ||
| ) | [protected, virtual] |
Generate separate route for each subordinate, and then task subordinate to follow its own route.
| route | Object name of the route we are tasked to follow. |
| traverseForward | Flag indicating if route should be traversed in order of increasing vertex index (DtIteratorForward) or decreasing vertex index (DtIteratorReverse). |
| startAtClosestPoint | This flag indicates whether traversal should start at closest vertex (true), or at the logical beginning of the route (false). |
| virtual void DtDisaggregatedMoveAlongController::generateFormationRoutes | ( | const DtVrfObject & | route, |
| bool | reverseDirection | ||
| ) | [protected, virtual] |
Generate routes for subordinates to follow, at offsets corresponding to their position in formation.
| route | Object name of the route we are following. |
| reverseDirection | Flag indicating if traversal direction is reverse (false) or forward (true). |
| virtual void DtDisaggregatedMoveAlongController::buildEntityRouteFollowingMap | ( | std::map< DtVrfObject *, DtEntityRouteFollowingData > & | map | ) | [protected, virtual] |
Generate map of which subordinate is following which generated route.
| map | Map of subordinates versus current route following state (such as identity of route subordinate should follow, current vertex, and so on). |
| virtual void DtDisaggregatedMoveAlongController::sendTaskToSubordinate | ( | const DtSimTask & | task, |
| const DtString & | subordinateObjectName | ||
| ) | const [protected, virtual] |
Constructs task messages and sends it to given subordinate through myRadio.
| task | Task to be issued to a subordinate. |
| subordinateObjectName | Object name of the subordinate to be given the task. |
| virtual void DtDisaggregatedMoveAlongController::sendSetDataToSubordinate | ( | const DtSetDataRequest & | setData, |
| const DtString & | subordinateObjectName | ||
| ) | const [protected, virtual] |
Constructs set data request message and sends it to given subordinate through myRadio.
| setData | Set data request to be issued to subordinate. |
| subordinateObjectName | Object name of the subordinate to be given the set data request. |
| virtual void DtDisaggregatedMoveAlongController::deleteFormationRoutes | ( | ) | [protected, virtual] |
Delete all formation routes (routes generated by this controller).
| virtual void DtDisaggregatedMoveAlongController::onObjectManagerRemoveAndDeleteAll | ( | const DtVrfObjectManager & | objectManager | ) | [protected, virtual] |
De-registers for formation changed callbacks.
We don't want to be affected by intermediate changes to aggregate composition as objects are being cleaned up in the object manager.
| objectManager | Reference to the object manager that maintains all of the simulated object in a VR-Forces back-end. |
| virtual bool DtDisaggregatedMoveAlongController::calculateInitialPositionAndHeadingAlongRoute | ( | const DtVrfObject & | route, |
| bool | traverseForward, | ||
| DtVector & | initialPosition, | ||
| double & | initialHeading | ||
| ) | [protected, virtual] |
Determines location and heading of aggregate at the logical beginning of the route the aggregate wants to follow.
Aggregate is positioned such that the lead entity in the current formation is at the start of the route.
| route | The route the aggregate is tasked to follow. |
| traverseForward | If true, route should be traversed in order of increasing route vertex index. If false, traversal should be in order of decreasing vertex index. |
| initialPosition | Initial position of aggregate at start of route in geocentric coordinates. Centers the aggregate at the start of the route. |
| initialHeading | Initial heading of aggregate at start of route, such that aggregate is aligned along first segment of route, in radians. |
| virtual void DtDisaggregatedMoveAlongController::sendVrfObjectModifyMsg | ( | const DtEntityIdentifier & | id, |
| DtList * | vertices | ||
| ) | const [protected, virtual] |
Sends DtIfModifyVrfObject interface message for given object id, with updated set of vertices.
Used to modify vertices of working route generated by this class whenever the route we're following changes.
| id | Entity identifier object to modify (one of the working routes). |
| vertices | List of DtVector* vertices in geocentric coordinates for the route. |
| virtual void DtDisaggregatedMoveAlongController::initializeNextRouteIndex | ( | ) | [protected, virtual] |
Initialize counter used to generate working route names.
Sets it to lowest integer greater than that used by any routes stored in process state.
| virtual unsigned int DtDisaggregatedMoveAlongController::nextRouteIndex | ( | ) | [protected, virtual] |
Next available index to use when constructing working route names.
| virtual bool DtDisaggregatedMoveAlongController::buildOffsetRoute | ( | const DtList & | localRouteVertexList, |
| const DtVector & | bodyOffset, | ||
| bool | reverseDirection, | ||
| bool | generateRoutesWithRoundedCorners, | ||
| double | vertexSpacingAlongRoundedCorners, | ||
| DtList & | geocentricOffsetRouteVertexList | ||
| ) | [protected, virtual] |
Builds route at body offset relative to given route.
Generates a route parallel to the original route, at the given body offset. Then calls adjustOffsetRouteStart() followed by adjustOffsetRouteEnd() to modify the beginning and end of the route, respectively.
| localRouteVertexList | Original list of DtLocalRwVector vertices from route we're tasked to follow. |
| bodyOffset | Formation position offset in aggregate body coordinates of formation position, relative to center of mass of aggregate formation. |
| reverseDirection | If true, generate route in reverse direction relative to original route. If false, generate route in same direction as original route. |
| generateRoutesWithRoundedCorners | If true, round the edges of turns by inserting additional vertices in offset route. |
| vertexSpacingAlongRoundedCorners | Distance in meters between vertices inserted in offset route to create rounded corners. |
| geocentricOffsetRouteVertexList | List of DtVector* vertices in geocentric coordinates for new offset route. |
| virtual void DtDisaggregatedMoveAlongController::registerRouteCallbacksIfNeeded | ( | ) | [protected, virtual] |
If tasked and we have not yet registered any callbacks with move-along route, register callbacks to either discover route, or be notified when route changes and when it is about to be removed.
Registers objectAddedCb member function with object manger for notification when new objects are added to object manager, and objectAboutToBeRemovedCb member function when a given object is about to be removed. Registered routeChangedCallback when given route we're following vertices have changed.
| virtual void DtDisaggregatedMoveAlongController::initializeMemberDataFromDescriptor | ( | const DtAggregateMoveAlongDescriptor & | desc | ) | [protected, virtual] |
Initializes myGenerateRoutesWithRoundedCorners, myVertexSpacingAlongRoundedCorners, myMaintainFormationTickInterval, and myMaintainFormationMonitor data members with data in descriptor.
| desc | Descriptor used to configure this component. |
| virtual void DtDisaggregatedMoveAlongController::maintainMovementInFormation | ( | ) | [protected, virtual] |
If currently tasked and in the moving along route state, montiors subordinates' speed using myMaintainFormationMonitor, and calls task complete if behavior is complete.
If tasked, in the moving-along-route phase of task, and it is time to tick formation maonitor, calls myMaintainFormationMonitor->tick().
| virtual void DtDisaggregatedMoveAlongController::reevaluateMoveAlongAssignments | ( | ) | [protected, virtual] |
Prunes entities no longer part of current formation from process state repository.
Removes routes associated with those entities from the process state repository and from the object manager. For remaining entities, adjusts formation routes to reflect their latest position in formation.
| virtual void DtDisaggregatedMoveAlongController::sendClearTask | ( | const DtString & | recipientName, |
| int | taskType | ||
| ) | const [protected, virtual] |
Sends a clear task request to the given receipient on this entity's command radio.
| recipientName | Object name of the entity we want to have clear its task |
| taskType | Identifies the kind of task we want the recipient to clear (see radioMsgTypes.h for available task types) |
| virtual bool DtDisaggregatedMoveAlongController::adjustOffsetRouteStart | ( | std::vector< DtVector > & | route | ) | const [protected, virtual] |
Adjusts the start of a given offset route.
Calls extendRouteStart() with the the current formation half length to adjust the route such that the aggregate will line up with the leading entity at the start of the route.
| virtual bool DtDisaggregatedMoveAlongController::adjustOffsetRouteEnd | ( | std::vector< DtVector > & | route | ) | const [protected, virtual] |
Adjusts the ending point of a given offset route.
Calls clipRouteEnd() with the the current formation half length to adjust the route such that the aggregate will line up with the leading entity at the end of the route.
| virtual bool DtDisaggregatedMoveAlongController::extendRouteStart | ( | std::vector< DtVector > & | route, |
| double | distance | ||
| ) | const [protected, virtual] |
Extends route by given distance at start of route, extending the first segment by the given distance.
| route | List of vertices representing a route |
| distance | Amount to extend the first segment |
| virtual bool DtDisaggregatedMoveAlongController::clipRouteEnd | ( | std::vector< DtVector > & | route, |
| double | distance | ||
| ) | const [protected, virtual] |
Clips end of given route by distance.
| route | to be modified. |
| distance | Amount to be clipped back from end of route |
| virtual DtMaintainFormationMonitor* DtDisaggregatedMoveAlongController::createFormationMonitor | ( | DtVrfObject * | entity | ) | const [protected, virtual] |
Creates an instance of a DtMaintainFormationMonitor.
Override this function if you want to create derived kind of formation monitor to be used by this class.
| entity | Pointer to the entity using this formation monitor (myEntity). |
| virtual bool DtDisaggregatedMoveAlongController::publishFormationRoutes | ( | ) | const [protected, virtual] |
| virtual bool DtDisaggregatedMoveAlongController::shouldGroundClamp | ( | ) | const [protected, virtual] |
| DtDisaggregatedMoveAlongController& DtDisaggregatedMoveAlongController::operator= | ( | const DtDisaggregatedMoveAlongController & | orig | ) | [private] |
assignment operator - not implemented
std::map<int, DtString> DtDisaggregatedMoveAlongController::myPromotionIndexRouteNameMap [protected] |
Map of formation positions to generated route object names.
DtMaintainFormationMonitor* DtDisaggregatedMoveAlongController::myMaintainFormationMonitor [protected] |
Object that monitors current subordinate positions and adjusts them if necessary to maintain correct formation shape while moving.
Adjustment is made by sending DtSetSpeedRequest messages to subordinates, relatively faster or slower than ordered speed of the aggregate.
double DtDisaggregatedMoveAlongController::myMaintainFormationTickInterval [protected] |
Simulation time interval at which myMaintainFormationMonitor should be ticked.
double DtDisaggregatedMoveAlongController::myTimeToNextMaintainFormationTick [protected] |
Simulation time for next tick of myMaintainFormationMonitor.
std::map<DtVrfObject*, DtEntityRouteFollowingData> DtDisaggregatedMoveAlongController::myEntityRouteFollowingMap [protected] |
Map of subordinates and route following data.
std::map<DtVrfObject*, DtEntityRouteTraversalState> DtDisaggregatedMoveAlongController::myEntityRouteTraversalStateMap [protected] |
Map of subordinate and current route traversal state.
DtVrfAggregateStateRepository* DtDisaggregatedMoveAlongController::myAggregateStateRepository [protected] |
Pointer to aggregate's state repository, cached in this class for convenience.
Pointer to aggregate's formation state object, cached in this class for convenience.
Pointer to aggregate's command radio, cached in this class for convenience.
Aggregates must be configured with a command radio for this controller to work properly.
Flag indicating all generated route should have rounded turns.
Default is true.
double DtDisaggregatedMoveAlongController::myVertexSpacingAlongRoundedCorners [protected] |
Spacing in meters between extra vertices inserted in generated routes to form rounded turns.
Default is 20 meters.
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
const DtAggregateMoveAlongDescriptor* DtDisaggregatedMoveAlongController::myAggregateMoveAlongDescriptor [protected] |
Pointer to descriptor used to configure this object.
Flag used to indicate whether formation changed callback has been registered yet.
Flag used to indcate whether route added/changed/removed callbacks have yet been registered.
This may not happen until sometime after the first non-zero dT() tick.
bool DtDisaggregatedMoveAlongController::myFirstTick [protected] |
Flag used to indicate first non-zero dT() tick.
unsigned int DtDisaggregatedMoveAlongController::myNextRouteIndex [protected] |
Counter used in naming generated routes.
Routes are assigned unique object names using the convention <original route="" name>="">_<myNextRouteIndex>.