![]() |
VR-Forces 4.0.4 Class Documentation
|
DtGroundAutoControllerComponent is a base controller that holds capabilitites common to all automotive controllers. More...

Public Member Functions | |
| DtGroundAutoControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtGroundAutoControllerComponent () |
| destructor | |
| virtual bool | init () |
| Initializes myGroundVehicleState. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | clearTask () |
| Overridden to call deactive the port group when this controller completes a task. | |
| virtual double | approximateThrottle (double speed) |
| We use this to approximate the correct throttle for a given speed, much like a real (experienced) driver does. | |
| virtual double | calculateSteering (double currentHeading, double desiredHeading) const |
| virtual double | calculateCurrentBrakingDistance () const |
| virtual bool | createAutomotiveControlPortGroup () |
| These are called in init to create the ports used to communicate with the actuator. | |
| virtual bool | createThrottlePort () |
| virtual bool | createSteeringPort () |
| virtual bool | createBrakePort () |
| virtual bool | createGearPort () |
| virtual bool | createParkingBrakePort () |
| virtual DtConstrainedAnalogOutputPort * | throttlePort () |
| virtual DtConstrainedAnalogOutputPort * | steeringPort () |
| virtual DtConstrainedAnalogOutputPort * | brakePort () |
| virtual DtConstrainedIntegerOutputPort * | gearPort () |
| virtual DtBooleanOutputPort * | parkingBrakePort () |
| virtual double | decelerationSoilFactor () const |
| virtual double | calcSteeringForTurnInPlace () |
| calcSteering() calculates steering values for executing either a pivot or a (reverse) k turn. | |
| virtual double | calcThrottleForTurnInPlace () |
| calcThrottle() calculates throttle values for executing either a pivot or a (reverse) k turn. | |
| virtual double | calcBrakeForTurnInPlace () |
| If the vehicle can pivot, 0.0 is returned and otherwise a call to calcBrakeForKTurn() is returned. | |
| virtual int | calcGearForTurnInPlace () |
| calcGear() determines the correct gear setting for executing either a pivot or (reverse) k turn. | |
| virtual double | calcSteeringForPivot () |
| calcSteeringForPivot() determines an appropriate steering value for executing a pivot turn. | |
| virtual double | calcThrottleForPivot () |
| calcThrottleForPivot() determines an appropriate throttle value for executing a pivot turn. | |
| virtual double | calcSteeringForKTurn () |
| If the entity can not pivot, then this method can be used to calculate a steering value for a (reverse) k turn. | |
| virtual double | calcThrottleForKTurn () |
| If the entity can not pivot, then this method can be used to calculate a throttle value for a (reverse) k turn. | |
| virtual double | calcBrakeForKTurn () |
| If kTurnReverseComplete() returns true but the entity is still moving backwards, this function sets the brakes to 1.0 until the entity comes to a complete stop. | |
| virtual double | findSpeedForKTurn () |
| If the entity is in the reverse phase of the k turn, the maximum reverse speed of the vehicle is returned. | |
| virtual double | findHeadingForKTurn () |
| If the entity is in the reverse phase of the k turn, kTurnReverseGoalHeading() is returned, otherwise headingToTurnTo() is returned. | |
| virtual void | setHeadingToTurnTo (double headingToTurnTo) |
| Get/Set the heading we the entity has been tasked to turn to. | |
| virtual double | headingToTurnTo () const |
| virtual void | setKTurnReverseGoalHeading (double kTurnReverseGoalHeading) |
| Get/Set the heading that is halfway between the original heading and the heading to turn to. | |
| virtual double | kTurnReverseGoalHeading () const |
| virtual void | setKTurnReverseComplete (bool kTurnReverseComplete) |
| Get/set the flag that indicates whether or not the entity has completed first half of the turn maneuver (backing up until at kTurnReverseGoalHeading()) | |
| virtual bool | kTurnReverseComplete () const |
Protected Member Functions | |
| virtual bool | createPorts () |
| Overridden to create the automotive ports. | |
| virtual bool | createPortGroups () |
| Overridden to create myAutomotiveControlPortGroup. | |
| virtual void | lookupAndCacheProcessSR () |
This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in
myProcessState. | |
| virtual bool | postAddComponentsInit () |
| Calls lookupAndCacheProcessSR(), to look up our process state repository after all of the components have been created and loaded. | |
| virtual DtSoilFactors * | currentSoilFactors () const |
| virtual bool | decideToGiveUpTask () const |
| If the entity is attached and the target of the current task is not, give up on the task. | |
Protected Attributes | |
| DtGroundVehicleStateRepository * | myGroundVehicleState |
| DtAutomotivePSR * | myProcessState |
| Pointer to a process state repository used to store state data associated with this component. | |
Ports and Port Groups | |
| DtConstrainedAnalogOutputPort * | myThrottlePort |
| Output Port Name: throttle Output Port Description: Output Port Range: 0. | |
| DtConstrainedAnalogOutputPort * | mySteeringPort |
| Output Port Name: steering Output Port Description: Output Port Range: -1.0 to 1.0 Output Port Default Value: Output Group Parent: automotive-control. | |
| DtConstrainedAnalogOutputPort * | myBrakePort |
| Output Port Name: brake Output Port Description: Output Port Range: 0. | |
| DtConstrainedIntegerOutputPort * | myGearPort |
| Output Port Name: gear Output Port Description: Output Port Range: Output Port Default Value: Output Group Parent: automotive-control. | |
| DtBooleanOutputPort * | myParkingBrakePort |
| Output Port Name: parking-brake Output Port Description: Output Port Default Value: True Output Group Parent: automotive-control. | |
| DtOutputPortGroup * | myAutomotiveControlPortGroup |
| Output Port Group Name: automotive-control Output Port Group Description: Collection of control output for automotive entity movement controllers. | |
Private Member Functions | |
| DtGroundAutoControllerComponent () | |
| default constructor; not implemented | |
| DtGroundAutoControllerComponent (const DtGroundAutoControllerComponent &orig) | |
| copy constructor; not implemented | |
| const DtGroundAutoControllerComponent & | operator= (const DtGroundAutoControllerComponent &orig) |
| assignment operator; not implemented | |
DtGroundAutoControllerComponent is a base controller that holds capabilitites common to all automotive controllers.
Uses Descriptor Type: DtComponentDescriptor
| DtGroundAutoControllerComponent::DtGroundAutoControllerComponent | ( | 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 DtGroundAutoControllerComponent::~DtGroundAutoControllerComponent | ( | ) | [virtual] |
destructor
default constructor; not implemented
| DtGroundAutoControllerComponent::DtGroundAutoControllerComponent | ( | const DtGroundAutoControllerComponent & | orig | ) | [private] |
copy constructor; not implemented
| virtual bool DtGroundAutoControllerComponent::init | ( | ) | [virtual] |
Initializes myGroundVehicleState.
Reimplemented from DtControllerComponent.
Reimplemented in BHAVE::DtBhaveMoveDirectionController, DtGroundCollisionAvoidanceController, DtGroundMoveToDestinationControllerComponent, and DtGroundMoveDirectionController.
| virtual DtString DtGroundAutoControllerComponent::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.
Reimplemented in DtGroundCollisionAvoidanceController, DtGroundMoveToDestinationControllerComponent, DtRetreatController, BHAVE::DtBhaveMoveDirectionController, DtGroundMoveToControllerComponent, DtGroundMoveDirectionController, DtGroundPatrolRouteController, DtGroundStopMovingControllerComponent, DtGroundFollowEntityController, DtGroundInterceptAndDestroyController, DtGroundPatrolBetweenController, DtGroundTurnToControllerComponent, DtGroundJoyMoveController, DtGroundMoveToLocationControllerComponent, DtGroundOrbitController, and DtGroundMoveAlongControllerComponent.
| virtual void DtGroundAutoControllerComponent::clearTask | ( | ) | [virtual] |
Overridden to call deactive the port group when this controller completes a task.
Reimplemented from DtSingleTaskControllerComponent.
Reimplemented in DtGroundMoveAlongControllerComponent.
| virtual double DtGroundAutoControllerComponent::approximateThrottle | ( | double | speed | ) | [virtual] |
We use this to approximate the correct throttle for a given speed, much like a real (experienced) driver does.
Reimplemented in BHAVE::DtBhaveMoveDirectionController.
| virtual double DtGroundAutoControllerComponent::calculateSteering | ( | double | currentHeading, |
| double | desiredHeading | ||
| ) | const [virtual] |
| virtual double DtGroundAutoControllerComponent::calculateCurrentBrakingDistance | ( | ) | const [virtual] |
| virtual bool DtGroundAutoControllerComponent::createAutomotiveControlPortGroup | ( | ) | [virtual] |
These are called in init to create the ports used to communicate with the actuator.
| virtual bool DtGroundAutoControllerComponent::createThrottlePort | ( | ) | [virtual] |
| virtual bool DtGroundAutoControllerComponent::createSteeringPort | ( | ) | [virtual] |
| virtual bool DtGroundAutoControllerComponent::createBrakePort | ( | ) | [virtual] |
| virtual bool DtGroundAutoControllerComponent::createGearPort | ( | ) | [virtual] |
| virtual bool DtGroundAutoControllerComponent::createParkingBrakePort | ( | ) | [virtual] |
| virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::throttlePort | ( | ) | [virtual] |
| virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::steeringPort | ( | ) | [virtual] |
| virtual DtConstrainedAnalogOutputPort* DtGroundAutoControllerComponent::brakePort | ( | ) | [virtual] |
| virtual DtConstrainedIntegerOutputPort* DtGroundAutoControllerComponent::gearPort | ( | ) | [virtual] |
| virtual DtBooleanOutputPort* DtGroundAutoControllerComponent::parkingBrakePort | ( | ) | [virtual] |
| virtual double DtGroundAutoControllerComponent::decelerationSoilFactor | ( | ) | const [virtual] |
| virtual double DtGroundAutoControllerComponent::calcSteeringForTurnInPlace | ( | ) | [virtual] |
calcSteering() calculates steering values for executing either a pivot or a (reverse) k turn.
An outside automotive controller could use this function in conjunction with calcThrottle() and calcGear() to effect turns as part of some other maneuver. An outside caller can ignore the last 2 arguments if it knows the entity is pivot-capable.
| virtual double DtGroundAutoControllerComponent::calcThrottleForTurnInPlace | ( | ) | [virtual] |
calcThrottle() calculates throttle values for executing either a pivot or a (reverse) k turn.
An outside caller can ignore the last argument if it knows the entity is pivot-capable.
| virtual double DtGroundAutoControllerComponent::calcBrakeForTurnInPlace | ( | ) | [virtual] |
If the vehicle can pivot, 0.0 is returned and otherwise a call to calcBrakeForKTurn() is returned.
| virtual int DtGroundAutoControllerComponent::calcGearForTurnInPlace | ( | ) | [virtual] |
calcGear() determines the correct gear setting for executing either a pivot or (reverse) k turn.
So that it may be used from outside the controller, a writable flag is passed to indicate whether, in the case of a k turn being executed, the first part of the maneuver has been completed. The tick() method calls this routine using the myProcessState->myKTurnReverseComplete member, but outside callers should maintain this value across simulation frames.
| virtual double DtGroundAutoControllerComponent::calcSteeringForPivot | ( | ) | [virtual] |
calcSteeringForPivot() determines an appropriate steering value for executing a pivot turn.
This is called by calcSteering() for pivot-capable entities
| virtual double DtGroundAutoControllerComponent::calcThrottleForPivot | ( | ) | [virtual] |
calcThrottleForPivot() determines an appropriate throttle value for executing a pivot turn.
This is called by calcThrottle() for pivot-capable entities
| virtual double DtGroundAutoControllerComponent::calcSteeringForKTurn | ( | ) | [virtual] |
If the entity can not pivot, then this method can be used to calculate a steering value for a (reverse) k turn.
It is called by calcSteering() for non-pivot capable entities.
| virtual double DtGroundAutoControllerComponent::calcThrottleForKTurn | ( | ) | [virtual] |
If the entity can not pivot, then this method can be used to calculate a throttle value for a (reverse) k turn.
It is called by calcThrottle() for non-pivot capable entities.
| virtual double DtGroundAutoControllerComponent::calcBrakeForKTurn | ( | ) | [virtual] |
If kTurnReverseComplete() returns true but the entity is still moving backwards, this function sets the brakes to 1.0 until the entity comes to a complete stop.
| virtual double DtGroundAutoControllerComponent::findSpeedForKTurn | ( | ) | [virtual] |
If the entity is in the reverse phase of the k turn, the maximum reverse speed of the vehicle is returned.
If the entity has turned far enough in reverse and needs to begin braking, 0.0 is returned. Otherwise if the entity has completed the reverse phase, the ordered speed of the entity is returned.
| virtual double DtGroundAutoControllerComponent::findHeadingForKTurn | ( | ) | [virtual] |
If the entity is in the reverse phase of the k turn, kTurnReverseGoalHeading() is returned, otherwise headingToTurnTo() is returned.
| virtual void DtGroundAutoControllerComponent::setHeadingToTurnTo | ( | double | headingToTurnTo | ) | [virtual] |
Get/Set the heading we the entity has been tasked to turn to.
| virtual double DtGroundAutoControllerComponent::headingToTurnTo | ( | ) | const [virtual] |
| virtual void DtGroundAutoControllerComponent::setKTurnReverseGoalHeading | ( | double | kTurnReverseGoalHeading | ) | [virtual] |
Get/Set the heading that is halfway between the original heading and the heading to turn to.
This is only used fore entities that are not pivot capable.
| virtual double DtGroundAutoControllerComponent::kTurnReverseGoalHeading | ( | ) | const [virtual] |
| virtual void DtGroundAutoControllerComponent::setKTurnReverseComplete | ( | bool | kTurnReverseComplete | ) | [virtual] |
Get/set the flag that indicates whether or not the entity has completed first half of the turn maneuver (backing up until at kTurnReverseGoalHeading())
| virtual bool DtGroundAutoControllerComponent::kTurnReverseComplete | ( | ) | const [virtual] |
| virtual bool DtGroundAutoControllerComponent::createPorts | ( | ) | [protected, virtual] |
Overridden to create the automotive ports.
Reimplemented from DtSimComponent.
Reimplemented in DtGroundMoveToDestinationControllerComponent, DtGroundCollisionAvoidanceController, DtGroundInterceptAndDestroyController, DtGroundFollowEntityController, BHAVE::DtBhaveMoveDirectionController, and DtGroundMoveDirectionController.
| virtual bool DtGroundAutoControllerComponent::createPortGroups | ( | ) | [protected, virtual] |
Overridden to create myAutomotiveControlPortGroup.
Reimplemented from DtSimComponent.
Reimplemented in DtGroundMoveToDestinationControllerComponent, DtGroundCollisionAvoidanceController, and DtGroundMoveDirectionController.
| virtual void DtGroundAutoControllerComponent::lookupAndCacheProcessSR | ( | ) | [protected, virtual] |
This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in
The name (if it exists) is given in the component descriptor (DtComponentDescriptor::processStateRepositoryName). If the name does not exist, it uses the appropriate default name defined in procSRTypes.h. Another component is responsible for creating and destroying the process state repository.
| virtual bool DtGroundAutoControllerComponent::postAddComponentsInit | ( | ) | [protected, virtual] |
Calls lookupAndCacheProcessSR(), to look up our process state repository after all of the components have been created and loaded.
Reimplemented from DtSimComponent.
| virtual DtSoilFactors* DtGroundAutoControllerComponent::currentSoilFactors | ( | ) | const [protected, virtual] |
| virtual bool DtGroundAutoControllerComponent::decideToGiveUpTask | ( | ) | const [protected, virtual] |
If the entity is attached and the target of the current task is not, give up on the task.
Reimplemented from DtSingleTaskControllerComponent.
Reimplemented in DtGroundMoveToDestinationControllerComponent, DtGroundMoveAlongControllerComponent, and DerivedMoveToController.
| const DtGroundAutoControllerComponent& DtGroundAutoControllerComponent::operator= | ( | const DtGroundAutoControllerComponent & | orig | ) | [private] |
assignment operator; not implemented
Output Port Name: throttle
Output Port Description:
Output Port Range: 0.
to 1.
Output Port Default Value:
Output Group Parent: automotive-control
Output Port Name: steering
Output Port Description:
Output Port Range: -1.0 to 1.0
Output Port Default Value:
Output Group Parent: automotive-control.
Output Port Name: brake
Output Port Description:
Output Port Range: 0.
to 1.
Output Port Default Value:
Output Group Parent: automotive-control
Output Port Name: gear
Output Port Description:
Output Port Range:
Output Port Default Value:
Output Group Parent: automotive-control.
Output Port Name: parking-brake
Output Port Description:
Output Port Default Value: True
Output Group Parent: automotive-control.
Output Port Group Name: automotive-control
Output Port Group Description: Collection of control output for automotive entity movement controllers.
Pointer to a process state repository used to store state data associated with this component.
This process state repository is shared with other components. Another component is responsible for creating and destroying the process state repository. This state is saved and restored as part of a scenario (or checkpoint).