VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtDisaggregatedMoveAlongController Class Reference

Class DtDisaggregatedMoveAlongController is a task controller that models aggregate entity move-along-route behavior. More...

Inheritance diagram for DtDisaggregatedMoveAlongController:
Inheritance graph
[legend]

List of all members.

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 DtSimComponentcreator (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, DtStringmyPromotionIndexRouteNameMap
 Map of formation positions to generated route object names.
DtMaintainFormationMonitormyMaintainFormationMonitor
 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.
DtVrfAggregateStateRepositorymyAggregateStateRepository
 Pointer to aggregate's state repository, cached in this class for convenience.
DtFormationStatemyFormationState
 Pointer to aggregate's formation state object, cached in this class for convenience.
DtCommandChannelRadiomyCommandRadio
 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.
DtAggregateMoveAlongPSRmyProcessState
 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
DtDisaggregatedMoveAlongControlleroperator= (const DtDisaggregatedMoveAlongController &orig)
 assignment operator - not implemented

Detailed Description

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


Constructor & Destructor Documentation

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

destructor

default constructor - not implemented

copy constructor - not implemented


Member Function Documentation

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.

Returns:
DtAggregateMoveAlongControllerType

Implements DtTaskControllerComponent.

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.

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.

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.

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.

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.

Parameters:
msgMessage containing DtMoveAlongTask.
usrPointer 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.

Parameters:
msgMessage containing DtTaskCompleteReport.
usrPointer 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.

Parameters:
formationStateFormation state repository for the aggregate (maintained in aggegate state repository).
usrPointer 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().

Parameters:
objPointer to the route we're following.
usrPointer 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.

Parameters:
vrfObjectPointer to object just added to object manager (could be any type of object -- entity, aggregate, control object).
usrPointer 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().

Parameters:
vrfObjectPointer to object representing the route we're following.
usrPointer 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().

Parameters:
objectManagerThe object manager maintinaing all simulated objects in a VR-Forces back-end.
usrPointer 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*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns:
New instance of this class.
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.

Parameters:
routeThe route we're tasked to follow.
traversalDirectionThe 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.
startAtClosestPointThis 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().

Parameters:
formationStateFormation state maintained in our aggregate's state repository.
virtual void DtDisaggregatedMoveAlongController::processMoveAlongTask ( DtSimMessage msg,
DtSimTaskStatePtr  taskState 
) [protected, virtual]

Unpacks DtMoveAlongTask and calls moveAlong().

Parameters:
msgMessage 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().

Parameters:
msgMessage containing DtTaskCompleteReport.
virtual void DtDisaggregatedMoveAlongController::processRouteChanged ( const DtVrfObject obj) [protected, virtual]

Regenerates routes.

Parameters:
objThe 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.

Parameters:
vrfObjectPointer 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().

Parameters:
vrfObjectPointer 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.

Parameters:
routeNameThe object name of the route we're tasked to move along.
traverseForwardFlag 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.

Parameters:
routeObject name of the route we are tasked to follow.
traverseForwardFlag indicating if route should be traversed in order of increasing vertex index (DtIteratorForward) or decreasing vertex index (DtIteratorReverse).
startAtClosestPointThis 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.

Parameters:
routeObject name of the route we are following.
reverseDirectionFlag indicating if traversal direction is reverse (false) or forward (true).

Generate map of which subordinate is following which generated route.

Parameters:
mapMap 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.

Parameters:
taskTask to be issued to a subordinate.
subordinateObjectNameObject 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.

Parameters:
setDataSet data request to be issued to subordinate.
subordinateObjectNameObject 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.

Parameters:
objectManagerReference 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.

Parameters:
routeThe route the aggregate is tasked to follow.
traverseForwardIf true, route should be traversed in order of increasing route vertex index. If false, traversal should be in order of decreasing vertex index.
initialPositionInitial position of aggregate at start of route in geocentric coordinates. Centers the aggregate at the start of the route.
initialHeadingInitial 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.

Parameters:
idEntity identifier object to modify (one of the working routes).
verticesList 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.

Parameters:
localRouteVertexListOriginal list of DtLocalRwVector vertices from route we're tasked to follow.
bodyOffsetFormation position offset in aggregate body coordinates of formation position, relative to center of mass of aggregate formation.
reverseDirectionIf true, generate route in reverse direction relative to original route. If false, generate route in same direction as original route.
generateRoutesWithRoundedCornersIf true, round the edges of turns by inserting additional vertices in offset route.
vertexSpacingAlongRoundedCornersDistance in meters between vertices inserted in offset route to create rounded corners.
geocentricOffsetRouteVertexListList of DtVector* vertices in geocentric coordinates for new offset route.
Returns:
true if offset route was built sucessfully, false if not

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.

Initializes myGenerateRoutesWithRoundedCorners, myVertexSpacingAlongRoundedCorners, myMaintainFormationTickInterval, and myMaintainFormationMonitor data members with data in descriptor.

Parameters:
descDescriptor used to configure this component.

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().

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.

Parameters:
recipientNameObject name of the entity we want to have clear its task
taskTypeIdentifies 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.

Returns:
true if route is sucessfully adjusted (route is still valid after adjustment), false otherwise.
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.

Returns:
true if route is sucessfully adjusted (route is still valid after adjustment), false otherwise.
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.

Parameters:
routeList of vertices representing a route
distanceAmount to extend the first segment
Returns:
true if route was sucessfully modified
virtual bool DtDisaggregatedMoveAlongController::clipRouteEnd ( std::vector< DtVector > &  route,
double  distance 
) const [protected, virtual]

Clips end of given route by distance.

Parameters:
routeto be modified.
distanceAmount to be clipped back from end of route
Returns:
true if route was sucessfully clipped back. Returns false if distance to clip is greater than length of route (in which case the route will have no vertices).

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.

Parameters:
entityPointer to the entity using this formation monitor (myEntity).
virtual bool DtDisaggregatedMoveAlongController::publishFormationRoutes ( ) const [protected, virtual]
Returns:
Look up whether or not we should publish formation following routes in DtVrfSettingsManager. Returns true if setting cannot be found.
virtual bool DtDisaggregatedMoveAlongController::shouldGroundClamp ( ) const [protected, virtual]
Returns:
Boolean value indicating whether or not generated route vertices should be ground clamped or not.
DtDisaggregatedMoveAlongController& DtDisaggregatedMoveAlongController::operator= ( const DtDisaggregatedMoveAlongController orig) [private]

assignment operator - not implemented


Member Data Documentation

Map of formation positions to generated route object names.

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.

Simulation time interval at which myMaintainFormationMonitor should be ticked.

Simulation time for next tick of myMaintainFormationMonitor.

Map of subordinates and route following data.

Map of subordinate and current route traversal state.

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.

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).

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.

Flag used to indicate first non-zero dT() tick.

Counter used in naming generated routes.

Routes are assigned unique object names using the convention <original route="" name>="">_<myNextRouteIndex>.


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)