VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtVreGimbalController Class Reference

Detailed Description

DtVreGimbalController extends the base sensor gimbal controller with VRE-specific functionality. It manages the rotation of sensor gimbals to aim sensors at targets, handles laser designation, and provides mechanisms for object tracking. The controller supports both joystick-controlled and AI-controlled gimbal movement. Joystick connection state and the current request count are restored through VreJoystickControllers.Controllers internal state, using the existing sensor interface.

#include <vreGimbalController.h>

Inheritance diagram for makVre::DtVreGimbalController:
[legend]

Public Member Functions

 DtVreGimbalController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreGimbalController () override
 
virtual const char * type () const override
 
virtual bool init () override
 
virtual void preFirstTickInit () override
 
virtual void calcAndSetPortValues (const DtString &functionGroup, const DtString &function, double value, bool repeat) override
 
virtual bool findLocationOfSensorAiming (const DtVector &location, const DtTaitBryan &orientation, DtVector &aimingPoint) const override
 
virtual const makVrf::DtLaserDesignatorStateComponent * lookupDesignator () const
 
virtual void processSetAimGimbal (DtSimMessage *msg) override
 
virtual void holdCurrentAim ()
 
virtual void updateDesignatorLocation ()
 
virtual void tick () override
 
virtual bool targetPoint (const DtTaitBryan &orientation, DtVector &location) const override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtSensorGimbalController >
 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
std::vector< std::string > controllingStations (const std::string &role) const
 
std::vector< std::string > engagedRoles () const
 
DtString entitySystemName () const
 
 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
std::vector< std::string > controllingStations (const std::string &role) const
 
std::vector< std::string > engagedRoles () const
 
DtString entitySystemName () const
 

Static Public Member Functions

static DtSimComponent * creator (const DtString &name, DtLocalObject *object, DtSimulationServices *simManager, DtComponentDescriptor *compDescriptor, DtReaderWriterRegistry *parentRegistry)
 

Protected Member Functions

virtual void joystickConnected () override
 
virtual void joystickDisconnected () override
 
virtual void processJoyDeviceRequest (DtSimMessage *msg) override
 
void updateJoystickState ()
 
void restoreJoystickState ()
 
virtual void aimSensorAtPoint (const DtVector &worldLocation) override
 
double checkDistance () const
 
void increaseCheckDistance () const
 
void resetCheckDistance () const
 

Protected Attributes

DtVreGimbalControllerDescriptor * myVreGimbalDescriptor
 
double myMinCheckDistance
 
double myCurrentCheckDistance
 
double myMaxCheckDistance
 
int myLaserCode
 
bool myContinuousTrack
 
double myPendingHoldTime = -1.0
 

Private Types

using Base = DtVreSimComponent<DtSensorGimbalController>
 

Private Member Functions

 DtVreGimbalController ()
 
 DtVreGimbalController (const DtVreGimbalController &orig)
 
const DtVreGimbalController & operator= (const DtVreGimbalController &orig)
 

Private Attributes

bool myRestoreJoystickState
 

Member Typedef Documentation

◆ Base

using makVre::DtVreGimbalController::Base = DtVreSimComponent<DtSensorGimbalController>
private

Constructor & Destructor Documentation

◆ DtVreGimbalController() [1/3]

makVre::DtVreGimbalController::DtVreGimbalController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descComponent descriptor with configuration parameters
parentRegistryOptional parent registry for reader/writer functionality

Creates a new gimbal controller component with the specified parameters.

Referenced by DtVreGimbalController(), and operator=().

◆ ~DtVreGimbalController()

virtual makVre::DtVreGimbalController::~DtVreGimbalController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the gimbal controller component.

◆ DtVreGimbalController() [2/3]

makVre::DtVreGimbalController::DtVreGimbalController ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

◆ DtVreGimbalController() [3/3]

makVre::DtVreGimbalController::DtVreGimbalController ( const DtVreGimbalController & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtVreGimbalController().

Member Function Documentation

◆ type()

virtual const char * makVre::DtVreGimbalController::type ( ) const
overridevirtual

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreGimbalControllerType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

◆ init()

virtual bool makVre::DtVreGimbalController::init ( )
overridevirtual

Initializes the gimbal controller.

Returns
True if initialization succeeded

Powers on VRE gimbal sensors as soon as the backend component is initialized so first-created frontend sensor views render scene data.

◆ preFirstTickInit()

virtual void makVre::DtVreGimbalController::preFirstTickInit ( )
overridevirtual

Runs existing initialization, then restores incoming joystick control.

Note
Ordinary creation, scenario loading, and rewind do not reconnect the joystick.

◆ calcAndSetPortValues()

virtual void makVre::DtVreGimbalController::calcAndSetPortValues ( const DtString & functionGroup,
const DtString & function,
double value,
bool repeat )
overridevirtual

Calculates and sets port values based on function input.

Parameters
functionGroupThe function group identifier
functionThe specific function name
valueThe input value to process
repeatFlag indicating whether the function should repeat

Processes input from function ports (typically joystick inputs) and applies the appropriate transforms to control the gimbal movement.

◆ findLocationOfSensorAiming()

virtual bool makVre::DtVreGimbalController::findLocationOfSensorAiming ( const DtVector & location,
const DtTaitBryan & orientation,
DtVector & aimingPoint ) const
overridevirtual

Finds the world location that a sensor is aiming at.

Parameters
locationThe geocentric location of the sensor
orientationThe orientation of the sensor
aimingPointOutput parameter that will contain the aiming point if found
Returns
True if an aiming point was successfully found, false otherwise

Determines the world location that a sensor is currently aiming at, based on the sensor's location, orientation, and internal configuration.

◆ lookupDesignator()

virtual const makVrf::DtLaserDesignatorStateComponent * makVre::DtVreGimbalController::lookupDesignator ( ) const
virtual

Chooses an appropriate laser designator object as the target to engage.

Returns
Pointer to the selected designator component, or NULL if no valid target found

Searches for and selects an appropriate laser designator object to engage as a target. Uses targetDesignatorValid() to check if each potential target is valid. This method enables sensors to track laser-designated targets.

◆ processSetAimGimbal()

virtual void makVre::DtVreGimbalController::processSetAimGimbal ( DtSimMessage * msg)
overridevirtual

Processes a message to set the gimbal aim direction.

Parameters
msgPointer to the simulation message containing aim parameters

Handles messages requesting to set the aiming direction of the gimbal. Extracts the target aiming information from the message and applies it to the gimbal controller.

◆ holdCurrentAim()

virtual void makVre::DtVreGimbalController::holdCurrentAim ( )
virtual

Stops tracking, keeps the current elevation, and returns azimuth to neutral.

◆ updateDesignatorLocation()

virtual void makVre::DtVreGimbalController::updateDesignatorLocation ( )
virtual

Updates the current laser designator target location.

Refreshes the stored location of the current laser designator target. This keeps the gimbal controller's understanding of the target position up to date for accurate tracking.

◆ tick()

virtual void makVre::DtVreGimbalController::tick ( )
overridevirtual

Updates the controller state each simulation frame.

Overridden to allow object tracking while in joystick mode. This method is called each simulation frame to update the gimbal orientation based on current tracking targets and input controls.

◆ targetPoint()

virtual bool makVre::DtVreGimbalController::targetPoint ( const DtTaitBryan & orientation,
DtVector & location ) const
overridevirtual

Determines the target point based on orientation and maximum laser range.

Parameters
orientationThe orientation to calculate the target point from
locationOutput parameter that will contain the target point if found
Returns
True if a target point was successfully found, false otherwise

Overridden to respect the maximum range of the laser when determining target points. Calculates the point in world space that corresponds to the given orientation and the configured maximum laser range.

◆ joystickConnected()

virtual void makVre::DtVreGimbalController::joystickConnected ( )
overrideprotectedvirtual

Handles joystick connection events.

Keeps the VRE gimbal sensor powered on when a player role takes control of the gimbal joystick function group and persists the current joystick state.

◆ joystickDisconnected()

virtual void makVre::DtVreGimbalController::joystickDisconnected ( )
overrideprotectedvirtual

Runs the sensor's normal disconnection hook and persists the disabled state.

◆ processJoyDeviceRequest()

virtual void makVre::DtVreGimbalController::processJoyDeviceRequest ( DtSimMessage * msg)
overrideprotectedvirtual

Calls the inherited request handler once and persists count-only changes.

Parameters
msgThe original joystick device request message.

◆ updateJoystickState()

void makVre::DtVreGimbalController::updateJoystickState ( )
protected

Writes the existing sensor interface's enabled flag and exact request count.

◆ restoreJoystickState()

void makVre::DtVreGimbalController::restoreJoystickState ( )
protected

Restores incoming state and reconnects the original sensor joystick callback once.

◆ aimSensorAtPoint()

virtual void makVre::DtVreGimbalController::aimSensorAtPoint ( const DtVector & worldLocation)
overrideprotectedvirtual

Aims the sensor at a specified world location.

Parameters
worldLocationThe geocentric world location to aim at

Attempts to adjust the gimbal orientation so that the sensor is aimed at the specified world location. Calculates the appropriate azimuth and elevation angles to achieve the desired aiming point.

◆ operator=()

const DtVreGimbalController & makVre::DtVreGimbalController::operator= ( const DtVreGimbalController & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtVreGimbalController().

◆ creator()

static DtSimComponent * makVre::DtVreGimbalController::creator ( const DtString & name,
DtLocalObject * object,
DtSimulationServices * simManager,
DtComponentDescriptor * compDescriptor,
DtReaderWriterRegistry * parentRegistry )
static

Factory method to create a new instance of this component.

Parameters
nameThe name for the new component
objectThe local object that will own this component
simManagerThe simulation services manager
compDescriptorOptional component descriptor
parentRegistryOptional parent registry for reader/writer functionality
Returns
Pointer to the newly created component

Static factory method used by the component creation system to instantiate new instances of this component type.

◆ checkDistance()

double makVre::DtVreGimbalController::checkDistance ( ) const
protected

Gets the current terrain check distance.

Returns
The current distance to check for terrain intersections

Returns the current distance value used for terrain intersection checks. Used to handle terrain loading latency issues by progressively checking at different distances.

◆ increaseCheckDistance()

void makVre::DtVreGimbalController::increaseCheckDistance ( ) const
protected

Increases the terrain check distance.

Increments the terrain check distance when a previous check fails. Helps handle terrain loading latency by progressively increasing the check distance until terrain is found or the maximum is reached.

◆ resetCheckDistance()

void makVre::DtVreGimbalController::resetCheckDistance ( ) const
protected

Resets the terrain check distance to the minimum value.

Resets the terrain check distance back to the minimum configured value. Called when starting a new series of terrain checks.

Member Data Documentation

◆ myRestoreJoystickState

bool makVre::DtVreGimbalController::myRestoreJoystickState
private

Remembers incoming conversion until first-tick initialization consumes it.

◆ myVreGimbalDescriptor

DtVreGimbalControllerDescriptor* makVre::DtVreGimbalController::myVreGimbalDescriptor
protected

Pointer to the gimbal controller descriptor.

Contains the configuration parameters for this gimbal controller component.

◆ myMinCheckDistance

double makVre::DtVreGimbalController::myMinCheckDistance
protected

Minimum distance for terrain intersection checks.

The starting (minimum) distance used for terrain intersection checks. This is the initial value used when resetting the check distance.

◆ myCurrentCheckDistance

double makVre::DtVreGimbalController::myCurrentCheckDistance
mutableprotected

Current distance for terrain intersection checks.

The current distance being used for terrain intersection checks. May be modified during runtime as checks are performed.

◆ myMaxCheckDistance

double makVre::DtVreGimbalController::myMaxCheckDistance
protected

Maximum distance for terrain intersection checks.

The maximum distance to use for terrain intersection checks. Once this value is reached, no further increases will occur.

◆ myLaserCode

int makVre::DtVreGimbalController::myLaserCode
protected

Laser code for designation.

The code used for laser designation. This helps identify specific laser designators when multiple are present in the simulation.

◆ myContinuousTrack

bool makVre::DtVreGimbalController::myContinuousTrack
protected

Flag indicating whether continuous tracking is enabled.

When true, indicates that the gimbal should continuously track the target, even in joystick control mode.

◆ myPendingHoldTime

double makVre::DtVreGimbalController::myPendingHoldTime = -1.0
protected

Sim time at which a deferred end-of-task hold is applied, or negative if none is pending.


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