VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreSimpleRadarObjectSensor Class Reference

Detailed Description

DtVreSimpleRadarObjectSensor extends the base radar object sensor to provide target tracking and designation capabilities specifically for air targets. It manages the radar antenna state for tracking, supports different radar modes (TWS - Track While Scan and STT - Single Target Track), and maintains prioritized lists of designated targets.

The sensor provides information about detected targets including their position, velocity, and classification, and supports selecting specific targets for tracking and weapons guidance.

#include <vreSimpleRadarObjectSensor.h>

Inheritance diagram for makVre::DtVreSimpleRadarObjectSensor:
[legend]

Public Member Functions

 DtVreSimpleRadarObjectSensor (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimpleRadarObjectSensor () override
 
virtual bool init () override
 
virtual const char * type () const override
 
virtual void tick () override
 
virtual bool detectObject (DtSimObjectReference object, DtRwSensorContactInfo *contactInfo) override
 
virtual ContinueDetectingResult continueDetectingObject (DtSimObjectReference object, DtRwSensorContactInfo *contactInfo, bool &contactInfoModified) override
 
- Public Member Functions inherited from makVre::DtVreRadarObjectSensor
 DtVreRadarObjectSensor (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreRadarObjectSensor () override
 
virtual int sensorType () const override
 
virtual bool createAndInitSensorMonitors () override
 
virtual bool createAndInitRadarSettingsMonitor ()
 
virtual void processSetRadarSettings (DtSimMessage *msg)
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtRadarObjectSensor >
 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
DtString entitySystemName () const
 

Static Public Member Functions

static DtSimComponent * creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
- Static Public Member Functions inherited from makVre::DtVreRadarObjectSensor
static void setRadarSettingsCallback (DtSimMessage *msg, void *usrData)
 
static DtReaderWriter * provideDesignatedTargetCallback (void *usrData)
 

Protected Member Functions

void updateAntennaState ()
 
void incrementBar ()
 
bool targetShouldBeDetected (int trackId)
 
double azimuthToTargetInDegrees (DtSimObjectReference target)
 
double elevationToTargetInDegrees (DtSimObjectReference target)
 
bool updateContactData (DtSimObjectReference target, DtRwRadarContactInfo *targetInfo)
 
virtual DtReaderWriter * processProvideDesignatedTarget () override
 
virtual const char * defaultPSRType () const override
 
virtual int trackID (const DtUUID &id)
 
virtual const DtUUID & uuidFromTrackId (int trackId)
 
std::string entityLabelFromType (const DtEntityType &)
 
virtual void setDesignatedTargets (const std::vector< int > &trackId) override
 
virtual void clearDesignatedTargets () override
 
int targetPriority (int trackId) const
 
bool isTargetDesignated (int trackId) const
 
int nextToShootTarget () const
 
bool singleTrackTargetMode () const
 
- Protected Member Functions inherited from makVre::DtVreRadarObjectSensor
virtual void updateDetectionArea ()
 
virtual void registerAttributeFunctions () override
 

Protected Attributes

std::unordered_map< std::string, DtRwString > myKnownEntityLabels
 
std::unordered_map< int, bool > myTargetDetectionState
 
DtVreSimpleRadarObjectSensorPSRmyVreSimpleRadarObjectSensorPsr
 
- Protected Attributes inherited from makVre::DtVreRadarObjectSensor
DtRadarStateMonitormyRadarStateMonitor
 
const DtVreRadarObjectSensorDescriptormyRadarObjectDescriptor
 
DtVreRadarObjectSensorPSRmyRadarObjectPsr
 

Private Member Functions

 DtVreSimpleRadarObjectSensor ()
 
 DtVreSimpleRadarObjectSensor (const DtVreSimpleRadarObjectSensor &orig)
 
const DtVreSimpleRadarObjectSensoroperator= (const DtVreSimpleRadarObjectSensor &orig)
 

Constructor & Destructor Documentation

◆ DtVreSimpleRadarObjectSensor() [1/3]

makVre::DtVreSimpleRadarObjectSensor::DtVreSimpleRadarObjectSensor ( )
private

Default constructor (not implemented)

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

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

◆ DtVreSimpleRadarObjectSensor() [2/3]

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

Copy constructor (not implemented)

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

References DtVreSimpleRadarObjectSensor().

◆ DtVreSimpleRadarObjectSensor() [3/3]

makVre::DtVreSimpleRadarObjectSensor::DtVreSimpleRadarObjectSensor ( 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 simple radar object sensor component with the specified parameters.

◆ ~DtVreSimpleRadarObjectSensor()

virtual makVre::DtVreSimpleRadarObjectSensor::~DtVreSimpleRadarObjectSensor ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the simple radar object sensor component.

Member Function Documentation

◆ operator=()

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

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtVreSimpleRadarObjectSensor().

◆ init()

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

Initializes the radar sensor component.

Returns
True if initialization is successful, false otherwise

Performs component initialization, including setting up the radar sensor parameters and process state repository. Called during component creation.

Reimplemented from makVre::DtVreRadarObjectSensor.

◆ type()

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

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreSimpleRadarObjectSensorType)

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

Reimplemented from makVre::DtVreRadarObjectSensor.

◆ tick()

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

Updates the radar sensor state each simulation frame.

Updates the antenna state for target tracking and calls the base class tick method to process standard radar operations. Manages target tracking, designation, and updates radar contact information based on current sensor mode and detected objects.

Reimplemented from makVre::DtVreRadarObjectSensor.

◆ detectObject()

virtual bool makVre::DtVreSimpleRadarObjectSensor::detectObject ( DtSimObjectReference object,
DtRwSensorContactInfo * contactInfo )
overridevirtual

Determines if an object should be detected by the radar.

Parameters
objectReference to the object being evaluated for detection
contactInfoOutput parameter to receive contact information if detected
Returns
True if the object is detected, false otherwise

Evaluates whether the specified object should be detected by the radar sensor based on range, radar cross-section, and other factors. If detected, populates the contactInfo parameter with information about the contact.

◆ continueDetectingObject()

virtual ContinueDetectingResult makVre::DtVreSimpleRadarObjectSensor::continueDetectingObject ( DtSimObjectReference object,
DtRwSensorContactInfo * contactInfo,
bool & contactInfoModified )
overridevirtual

Determines if an already detected object should remain detected.

Parameters
objectReference to the previously detected object
contactInfoOutput parameter with contact information to update
contactInfoModifiedOutput parameter indicating if contactInfo was modified
Returns
Result indicating if detection should continue, be removed, or remain unchanged

Evaluates whether a previously detected object should continue to be detected by the radar sensor. Updates contact information if the object remains detected and sets contactInfoModified to true if changes were made.

◆ creator()

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

Factory method to create a new instance of this component.

Parameters
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional 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.

◆ updateAntennaState()

void makVre::DtVreSimpleRadarObjectSensor::updateAntennaState ( )
protected

Updates the radar antenna position and state.

Updates the radar antenna position and state based on the current tracking mode and target information. Manages antenna rotation in scanning modes and fixed pointing in single-target tracking mode.

◆ incrementBar()

void makVre::DtVreSimpleRadarObjectSensor::incrementBar ( )
protected

Increments the radar scan bar counter.

Increments the counter that tracks the current scan bar position in the radar scanning pattern. Used to simulate radar scan patterns across elevation bars.

◆ targetShouldBeDetected()

bool makVre::DtVreSimpleRadarObjectSensor::targetShouldBeDetected ( int trackId)
protected

Determines if a tracked target should be detected based on radar modes.

Parameters
trackIdThe track identifier of the target to check
Returns
True if the target should be detected in the current radar mode

Evaluates whether a target with the specified track ID should be detected based on the current radar mode (e.g., in STT mode, only the designated target should be detected).

◆ azimuthToTargetInDegrees()

double makVre::DtVreSimpleRadarObjectSensor::azimuthToTargetInDegrees ( DtSimObjectReference target)
protected

Calculates the azimuth angle to a target.

Parameters
targetReference to the target object
Returns
Azimuth angle to the target in degrees

Calculates the azimuth angle (horizontal angle) from the radar to the specified target object, in degrees. Used for determining if the target is within the current radar scan sector.

◆ elevationToTargetInDegrees()

double makVre::DtVreSimpleRadarObjectSensor::elevationToTargetInDegrees ( DtSimObjectReference target)
protected

Calculates the elevation angle to a target.

Parameters
targetReference to the target object
Returns
Elevation angle to the target in degrees

Calculates the elevation angle (vertical angle) from the radar to the specified target object, in degrees. Used for determining if the target is within the current radar scan bar.

◆ updateContactData()

bool makVre::DtVreSimpleRadarObjectSensor::updateContactData ( DtSimObjectReference target,
DtRwRadarContactInfo * targetInfo )
protected

Updates the contact information for a detected target.

Parameters
targetReference to the target object
targetInfoPointer to the contact information to update
Returns
True if the contact information was modified, false otherwise

Updates the radar contact information for a detected target with current data such as position, velocity, and track quality. Returns true if any information was changed.

◆ processProvideDesignatedTarget()

virtual DtReaderWriter * makVre::DtVreSimpleRadarObjectSensor::processProvideDesignatedTarget ( )
overrideprotectedvirtual

Provides information about the currently designated target.

Returns
Reader/writer containing information about the designated target

Implements the base class method to provide information about the currently designated target (highest priority target in the designated target list). Used by other components to identify which target the radar is currently prioritizing for tracking or weapons guidance.

Implements makVre::DtVreRadarObjectSensor.

◆ defaultPSRType()

virtual const char * makVre::DtVreSimpleRadarObjectSensor::defaultPSRType ( ) const
overrideprotectedvirtual

Gets the default process state repository type.

Returns
String identifying the default PSR type (DtVreSimpleRadarObjectSensorPSRType)

Returns the default process state repository type for this component. Overrides the base class method to provide the specialized PSR type for the simple radar object sensor.

Reimplemented from makVre::DtVreRadarObjectSensor.

◆ trackID()

virtual int makVre::DtVreSimpleRadarObjectSensor::trackID ( const DtUUID & id)
protectedvirtual

Gets the track ID for a target entity.

Parameters
idUUID of the target entity
Returns
Track ID assigned to the entity

Retrieves or assigns a track ID for the entity with the specified UUID. Track IDs are unique identifiers used to reference detected targets in the radar system.

◆ uuidFromTrackId()

virtual const DtUUID & makVre::DtVreSimpleRadarObjectSensor::uuidFromTrackId ( int trackId)
protectedvirtual

Gets the entity UUID corresponding to a track ID.

Parameters
trackIdThe track ID to look up
Returns
Reference to the UUID for the specified track ID

Retrieves the entity UUID associated with the specified track ID. This performs the reverse lookup of trackID(), converting a radar track identifier back to the corresponding entity UUID.

◆ entityLabelFromType()

std::string makVre::DtVreSimpleRadarObjectSensor::entityLabelFromType ( const DtEntityType & )
protected

Determines a display label for an entity based on its type.

Parameters
DtEntityTypeEntity type to get a label for
Returns
String label to display for the entity type

Creates a human-readable label for an entity based on its type code. Used to generate display names for radar contacts in the user interface.

◆ setDesignatedTargets()

virtual void makVre::DtVreSimpleRadarObjectSensor::setDesignatedTargets ( const std::vector< int > & trackId)
overrideprotectedvirtual

Sets the list of designated targets for the radar.

Parameters
trackIdVector of track IDs to designate, in priority order

Sets the designated targets list and updates the emitter system's track targets. The order of track IDs in the vector represents their priority, with the first element being the highest priority target. Overrides the base class method.

Implements makVre::DtVreRadarObjectSensor.

◆ clearDesignatedTargets()

virtual void makVre::DtVreSimpleRadarObjectSensor::clearDesignatedTargets ( )
overrideprotectedvirtual

Clears all designated targets from the radar.

Clears the designated targets list and the emitter system's track targets. This removes all current target designations, restoring the radar to a standard search/track state. Overrides the base class method.

Implements makVre::DtVreRadarObjectSensor.

◆ targetPriority()

int makVre::DtVreSimpleRadarObjectSensor::targetPriority ( int trackId) const
protected

Gets the priority of a designated target.

Parameters
trackIdThe track ID to check for priority
Returns
The target's priority (1-based, with 1 being highest priority) or -1 if not designated

Returns the target's position in the designated targets list, where 1 represents the highest priority target. If the specified track ID is not in the designated targets list, returns -1 to indicate it is not designated.

◆ isTargetDesignated()

bool makVre::DtVreSimpleRadarObjectSensor::isTargetDesignated ( int trackId) const
protected

Checks if a target is in the designated targets list.

Parameters
trackIdThe track ID to check
Returns
True if the target is designated, false otherwise

Determines whether the specified track ID is present in the designated targets list. Returns true if the target is designated, false otherwise.

◆ nextToShootTarget()

int makVre::DtVreSimpleRadarObjectSensor::nextToShootTarget ( ) const
protected

Gets the highest priority designated target's track ID.

Returns
The Next To Shoot (NTS) target's track ID, or -1 if no targets are designated

Returns the track ID of the first target in the designated targets list, which represents the Next To Shoot (NTS) target with highest priority. This is effectively the only designated target in STT (Single Target Track) mode. Returns -1 if the designated targets list is empty.

◆ singleTrackTargetMode()

bool makVre::DtVreSimpleRadarObjectSensor::singleTrackTargetMode ( ) const
protected

Checks if the radar is in Single Track Target mode.

Returns
True if in STT mode, false otherwise

Determines whether the radar is currently in STT (Single Track Target) mode. In this mode, only the designated target (as returned by nextToShootTarget()) should be tracked. This contrasts with TWS (Track While Scan) mode where multiple targets can be tracked simultaneously.

Member Data Documentation

◆ myKnownEntityLabels

std::unordered_map<std::string, DtRwString> makVre::DtVreSimpleRadarObjectSensor::myKnownEntityLabels
protected

Cache of entity labels by entity type string.

Stores previously looked up entity labels indexed by entity type string. Used to avoid repeating the entity label lookup for commonly encountered entity types.

◆ myTargetDetectionState

std::unordered_map<int, bool> makVre::DtVreSimpleRadarObjectSensor::myTargetDetectionState
protected

Map of detection states indexed by track ID.

Tracks the detection state of each target by its track ID. The boolean value indicates whether the target is currently detected (true) or not (false). Used to manage continuity of detection between simulation frames.

◆ myVreSimpleRadarObjectSensorPsr

DtVreSimpleRadarObjectSensorPSR* makVre::DtVreSimpleRadarObjectSensor::myVreSimpleRadarObjectSensorPsr
protected

Pointer to the radar sensor's process state repository.

Contains the persistent state information for the radar sensor, including tracking settings, antenna position, and designated targets.


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