![]() |
VR-Forces 4.0.4 Class Documentation
|
DtBaseMountingController is a controller that generates the azimuth and elevation controls needed to manipulate a weapon mount to the a desired azimuth and elevation. More...

Public Member Functions | |
| DtBaseMountingController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtBaseMountingController () |
| destructor | |
| virtual bool | postAddComponentsInit () |
| Overridden to activate myMountingControlPortGroup. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual DtOutputPortGroup * | mountingControlPortGroup () |
| Returns myMountingControlPortGroup. | |
| virtual DtInputPortGroup * | azimuthInfoPortGroup () |
| Returns myAzimuthInfoPortGroup. | |
| virtual DtInputPortGroup * | elevationInfoPortGroup () |
| Returns myAzimuthInfoPortGroup. | |
| virtual void | tick () |
| Calculate new control values. | |
| virtual void | reorientMounting () |
| Spin the mounting to point toward the desired targetPoint or desiredAzimuth/desiredElevation. | |
| virtual void | findDesiredAzimuthAndElevation () |
| virtual bool | desiredOrientationIsInRange (double &azimuthOutOfRangeBy, double &elevationOutOfRangeBy, double additionalAzimuthMargin=0.0, double additionalElevationMargin=0.0) |
| Returns true if the desired azimuth and elevation are within the range that this mounting can do. | |
| virtual bool | createAzimuthPort () |
| These are called in init to create the ports used to communicate with the actuator. | |
| virtual DtConstrainedAnalogOutputPort * | azimuthPort () const |
| virtual bool | createElevationPort () |
| virtual DtConstrainedAnalogOutputPort * | elevationPort () const |
| virtual bool | createAzimuthInfoPorts () |
| creates the ports used by myAzimuthInfoPortGroup | |
| virtual bool | createElevationInfoPorts () |
| creates the ports used by myElevationInfoPortGroup | |
| virtual double | approximateMountSwing (double angleChange, double maxRate) |
| Determine how fast a mounting should swing given the angle it must travel through (angleChange) and the maxRate of its transit. | |
| virtual void | setDesiredAzimuth (DtReal desiredAzimuth) |
| virtual DtReal | desiredAzimuth () |
| virtual void | setDesiredElevation (DtReal desiredElevation) |
| virtual DtReal | desiredElevation () |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual bool | createPortGroups () |
| Overridden to create mounting port groups. | |
| virtual bool | createPorts () |
| Overridden to create mounting ports. | |
| DtBaseMountingController () | |
| default constructor; not implemented | |
| DtBaseMountingController (const DtBaseMountingController &orig) | |
| copy constructor; not implemented | |
| const DtBaseMountingController & | operator= (const DtBaseMountingController &orig) |
| assignment operator; not implemented | |
Protected Attributes | |
| DtArticulatedPartStateRepository * | myAzimuthMountPart |
| DtArticulatedPartStateRepository * | myElevationMountPart |
| DtArticulatedPartStateRepository * | myChildSimBody |
| DtReal | myDesiredAzimuth |
| Desired azimuth angle relative to the body. | |
| DtReal | myDesiredElevation |
| Desired elevation angle relative to the body. | |
| DtReal | myAngleApproxMargin |
| To prevent endless fine adjustments to the azimuth and elevation we'll use a constant margin to determine when the azimuth and elevation are close enough. | |
Ports and Port Groups | |
| DtInputPortGroup * | myAzimuthInfoPortGroup |
| Input Port Group Name: azimuth-info Input Port Group Description: Used to get azimuth information from the actuator. | |
| DtAnalogInputPort * | myNominalAzimuthPort |
| Input Port Name: nominal-azimuth Input Port Description: Nominal azimuth value. | |
| DtAnalogInputPort * | myAzimuthRangePort |
| Input Port Name: azimuth-range Input Port Description: Azimuth sweep range. | |
| DtAnalogInputPort * | myMaxAzimuthRatePort |
| Input Port Name: azimuth-rate Input Port Description: Max azimuth rate. | |
| DtIntegerInputPort * | myAzimuthPartTypePort |
| Input Port Name: azimuth-part-type Input Port Description: Type of articulated part. | |
| DtInputPortGroup * | myElevationInfoPortGroup |
| Input Port Group Name: elevation-info Input Port Group Description: Used to get elevation information from the actuator. | |
| DtAnalogInputPort * | myNominalElevationPort |
| Input Port Name: nominal-elevation Input Port Description: Nominal elevation value. | |
| DtAnalogInputPort * | myElevationRangePort |
| Input Port Name: elevation-range Input Port Description: Elevation sweep range Input Port Range: Input Port Default Value: Input Group Parent: elevation-info. | |
| DtAnalogInputPort * | myMaxElevationRatePort |
| Input Port Name: elevation-rate Input Port Description: Max elevation rate Input Port Range: Input Port Default Value: Input Group Parent: elevation-info. | |
| DtIntegerInputPort * | myElevationPartTypePort |
| Input Port Name: elevation-part-type Input Port Description: Type of articulated part Input Port Range: Input Port Default Value: Input Group Parent: elevation-info. | |
| DtOutputPortGroup * | myMountingControlPortGroup |
| Output Port Group Name: mounting-control Output Port Group Description: Accepts output from the missile launcher controller and indirect fire controller. | |
| DtConstrainedAnalogOutputPort * | myAzimuthPort |
| Output Port Name: azimuth Output Port Description: Output Port Range: -1. | |
| DtConstrainedAnalogOutputPort * | myElevationPort |
| Output Port Name: elevation Output Port Description: Output Port Range: -1. | |
DtBaseMountingController is a controller that generates the azimuth and elevation controls needed to manipulate a weapon mount to the a desired azimuth and elevation.
It expects to control an azimuth and/or elevation mount actuator(s).
Uses Descriptor Type: DtComponentDescriptor
| DtBaseMountingController::DtBaseMountingController | ( | 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 DtBaseMountingController::~DtBaseMountingController | ( | ) | [virtual] |
destructor
| DtBaseMountingController::DtBaseMountingController | ( | ) | [protected] |
default constructor; not implemented
| DtBaseMountingController::DtBaseMountingController | ( | const DtBaseMountingController & | orig | ) | [protected] |
copy constructor; not implemented
| virtual bool DtBaseMountingController::postAddComponentsInit | ( | ) | [virtual] |
Overridden to activate myMountingControlPortGroup.
Reimplemented from DtSimComponent.
| virtual DtString DtBaseMountingController::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.
Reimplemented from DtControllerComponent.
Reimplemented in DtMountingController.
| virtual DtOutputPortGroup* DtBaseMountingController::mountingControlPortGroup | ( | ) | [virtual] |
Returns myMountingControlPortGroup.
| virtual DtInputPortGroup* DtBaseMountingController::azimuthInfoPortGroup | ( | ) | [virtual] |
Returns myAzimuthInfoPortGroup.
| virtual DtInputPortGroup* DtBaseMountingController::elevationInfoPortGroup | ( | ) | [virtual] |
Returns myAzimuthInfoPortGroup.
| virtual void DtBaseMountingController::tick | ( | ) | [virtual] |
Calculate new control values.
Reimplemented from DtSimComponent.
| virtual void DtBaseMountingController::reorientMounting | ( | ) | [virtual] |
Spin the mounting to point toward the desired targetPoint or desiredAzimuth/desiredElevation.
Takes the current orientation of myChildSimBody (the DtSimBody part that has the combined azimuth and elevation orientation of the mounting), and generates the azimuth and elevation steering input needed to maneuver the mounting toward the desired azimuth and elevation. It obtains the orientation of the mount point in body coordinates of the entity, from myChildSimBody. These Euler angles give the current azimuth and elevation settings of the mount point. It then calls the static functions DtMountingAzimuthActuator::computeDeltaOutsideAzimuthRange(), and DtMountingElevationActuator::computeDeltaOutsideElevationRange(), to determine the extent to which the current orientation is off-target. If the azimuth or elevation angular extent returned is zero, the corresponding port value is set to zero. If not, the function is called to generate a control input, given the amount the angle is off approximateMountSwing() by, and the maximum angular rate at which it can swing. It sets the control input for the port with the value returned by approximateMountSwing().
| virtual void DtBaseMountingController::setDesiredAzimuth | ( | DtReal | desiredAzimuth | ) | [virtual] |
Set an azimuth you want this mounting to point towards. This azimuth is relative to the body.
| virtual DtReal DtBaseMountingController::desiredAzimuth | ( | ) | [virtual] |
Set an azimuth you want this mounting to point towards. This azimuth is relative to the body.
| virtual void DtBaseMountingController::setDesiredElevation | ( | DtReal | desiredElevation | ) | [virtual] |
Set an elevation you want this mounting to point towards. This elevation is relative to the body.
| virtual DtReal DtBaseMountingController::desiredElevation | ( | ) | [virtual] |
Set an elevation you want this mounting to point towards. This elevation is relative to the body.
| virtual void DtBaseMountingController::findDesiredAzimuthAndElevation | ( | ) | [virtual] |
Reimplemented in DtMountingController.
| virtual bool DtBaseMountingController::desiredOrientationIsInRange | ( | double & | azimuthOutOfRangeBy, |
| double & | elevationOutOfRangeBy, | ||
| double | additionalAzimuthMargin = 0.0, |
||
| double | additionalElevationMargin = 0.0 |
||
| ) | [virtual] |
Returns true if the desired azimuth and elevation are within the range that this mounting can do.
If it's out of range, the method returns false and puts the outOfRangeBy amounts into the appropriate "out" params. The params for additionalMargin allows the caller to broaden the acceptable azimuth and elevation range by the passed in values.
| virtual bool DtBaseMountingController::createAzimuthPort | ( | ) | [virtual] |
These are called in init to create the ports used to communicate with the actuator.
| virtual DtConstrainedAnalogOutputPort* DtBaseMountingController::azimuthPort | ( | ) | const [virtual] |
| virtual bool DtBaseMountingController::createElevationPort | ( | ) | [virtual] |
| virtual DtConstrainedAnalogOutputPort* DtBaseMountingController::elevationPort | ( | ) | const [virtual] |
| virtual bool DtBaseMountingController::createAzimuthInfoPorts | ( | ) | [virtual] |
creates the ports used by myAzimuthInfoPortGroup
| virtual bool DtBaseMountingController::createElevationInfoPorts | ( | ) | [virtual] |
creates the ports used by myElevationInfoPortGroup
| virtual double DtBaseMountingController::approximateMountSwing | ( | double | angleChange, |
| double | maxRate | ||
| ) | [virtual] |
Determine how fast a mounting should swing given the angle it must travel through (angleChange) and the maxRate of its transit.
Takes as input the amount of angle to be changed and the maximum angular rate of change, and returns a value between -1.0 and 1.0, representing the scaled rate at which the angle should change. It computes this value to be the amount of angular change desired, divided by the maximum angular rate times the current frame duration, dT, for example:
| static DtSimComponent* DtBaseMountingController::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). |
Reimplemented in DtMountingController.
| virtual bool DtBaseMountingController::createPortGroups | ( | ) | [protected, virtual] |
Overridden to create mounting port groups.
Reimplemented from DtSimComponent.
| virtual bool DtBaseMountingController::createPorts | ( | ) | [protected, virtual] |
Overridden to create mounting ports.
Reimplemented from DtSimComponent.
| const DtBaseMountingController& DtBaseMountingController::operator= | ( | const DtBaseMountingController & | orig | ) | [protected] |
assignment operator; not implemented
Input Port Group Name: azimuth-info
Input Port Group Description: Used to get azimuth information from the actuator.
Input Port Name: nominal-azimuth
Input Port Description: Nominal azimuth value.
Input Port Range:
Input Port Default Value:
Input Group Parent: azimuth-info
Input Port Name: azimuth-range
Input Port Description: Azimuth sweep range.
Input Port Range:
Input Port Default Value:
Input Group Parent: azimuth-info
Input Port Name: azimuth-rate
Input Port Description: Max azimuth rate.
Input Port Range:
Input Port Default Value:
Input Group Parent: azimuth-info
Input Port Name: azimuth-part-type
Input Port Description: Type of articulated part.
Input Port Range:
Input Port Default Value:
Input Group Parent: azimuth-info
Input Port Group Name: elevation-info
Input Port Group Description: Used to get elevation information from the actuator.
Input Port Name: nominal-elevation Input Port Description: Nominal elevation value.
Input Port Range:
Input Port Default Value:
Input Group Parent: elevation-info
Input Port Name: elevation-range Input Port Description: Elevation sweep range
Input Port Range:
Input Port Default Value:
Input Group Parent: elevation-info.
Input Port Name: elevation-rate Input Port Description: Max elevation rate
Input Port Range:
Input Port Default Value:
Input Group Parent: elevation-info.
Input Port Name: elevation-part-type Input Port Description: Type of articulated part
Input Port Range:
Input Port Default Value:
Input Group Parent: elevation-info.
Output Port Group Name: mounting-control
Output Port Group Description: Accepts output from the missile launcher controller and indirect fire controller.
Output Port Name: azimuth Output Port Description:
Output Port Range: -1.
to 1.
Output Port Default Value:
Output Group Parent: mounting-control
Output Port Name: elevation Output Port Description:
Output Port Range: -1.
to 1.
Output Port Default Value:
Output Group Parent: mounting-control
DtReal DtBaseMountingController::myDesiredAzimuth [protected] |
Desired azimuth angle relative to the body.
DtReal DtBaseMountingController::myDesiredElevation [protected] |
Desired elevation angle relative to the body.
DtReal DtBaseMountingController::myAngleApproxMargin [protected] |
To prevent endless fine adjustments to the azimuth and elevation we'll use a constant margin to determine when the azimuth and elevation are close enough.