|
WSF
|
A set of utilities that perform generic calculations among WSF objects. More...
Functions | |
| template<typename SYSTEM, typename ATTRIBUTE_TYPE> | |
| bool | GetAuxValue (SYSTEM *aSystem, const std::string &aLabel, ATTRIBUTE_TYPE &aValue) |
| template<typename SYSTEM, typename ATTRIBUTE_TYPE> | |
| bool | GetAuxValue (SYSTEM &aSystem, const std::string &aLabel, ATTRIBUTE_TYPE &aValue) |
| template<class T1, class T2> | |
| double | TimeToDestination (T1 &aSource, T2 &aDest, const double aVel[3]) |
| Calculate the time it would take an object (e.g., a WsfPlatform) to traverse a great circle distance from a source to a destination. | |
| template<class T1, class T2> | |
| double | DistanceToDestination (T1 &aSource, T2 &aDest) |
| Calculate the great circle distance from a source to a destination. | |
| int WSF_EXPORT | CountBitsOn (unsigned int aBitMask) |
| unsigned int | GenerateBitMask (int aNumBits) |
| void WSF_EXPORT | ClosestApproachPoint2D (const double aMoverLocWCS[3], const double aMoverVelWCS[3], const double aTargetLocWCS[3], double aClosestLocWCS[3]) |
| double WSF_EXPORT | ClosestApproachPoint3D (const double aMoverLocWCS[3], const double aMoverVelWCS[3], const double aTargetLocWCS[3], double aClosestLocWCS[3]) |
| bool WSF_EXPORT | PotentiallyWithinRange (double aSimTime, WsfPlatform *aObject1Ptr, WsfPlatform *aObject2Ptr, double aMaximumRange) |
| bool WSF_EXPORT | TriangulateLocation (const double aOriginWCS_1[3], const double &aBearing1, const double &aElevation1, const double aOriginWCS_2[3], const double &aBearing2, const double &aElevation2, double aLocationWCS[3]) |
| void WSF_EXPORT | ConvertRangeBearing (const double aFromLocationWCS[3], UtEntity *aToEntity, double &aRange, double &aBearing) |
| void WSF_EXPORT | ErrorNED (double aRange, double aBearing, double aElevation, double aRangeError, double aBearingError, double aElevationError, double aErrorNED[3]) |
| void WSF_EXPORT | ErrorNED (double aRange, double aBearing, double aRangeError, double aBearingError, double aErrorNED[3]) |
| int WSF_EXPORT | TrackIdToInt (const WsfTrackId &aTrackId) |
| WsfTrackId WSF_EXPORT | IntToTrackId (int aIntTrackId) |
| void WSF_EXPORT | CovarianceToEllipse_2x2 (std::vector< double > &aMatrix, double &aSemiMajorAxis, double &aSemiMinorAxis, double &aBearingRad) |
| double WSF_EXPORT | BallisticPropagate (const UtVec3d &aLocationWCS, const UtVec3d &aVelocityWCS, double aStopAltitude, UtVec3d &aPropagatedLocationWCS, UtVec3d &aPropagatedVelocityWCS) |
| void WSF_EXPORT | MakeTrack (double aSimTime, WsfTrack &aTrack, WsfPlatform &aTarget, WsfPlatform &aSource) |
| Fill a track with truth information on aTarget with aSource as the track source. | |
| void WSF_EXPORT | GetErrorEstimateLLA_SpeedHeading (const WsfTrack &aTrack, unsigned short &aValidity, double &aStDevLat, double &aStDevLon, double &aStDevAlt, double &aStDevSpeed, double &aStDevHeading) |
| void WSF_EXPORT | PrintLLA (const std::string &aLabel, double aLocationWCS[3]) |
| Calls PrintLLA() for the LLA representation of aLocationWCS. | |
| void WSF_EXPORT | PrintLLA (const std::string &aLabel, double aLat, double aLon, double aAlt) |
| void WSF_EXPORT | PrintLength (const std::string &aLabel, double aLength) |
| template<class T1, class T2> | |
| double | SlantRange (T1 &aSource, T2 &aDest) |
| Calculate the slant range distance from a source to a destination (second parameter is const). | |
Variables | |
| static const unsigned short | cLLA_ERROR_VALID = 0x01 |
| Validity Masks associated with the "aValidity" parameter in the following method: | |
| static const unsigned short | cSPEED_ERROR_VALID = 0x02 |
| static const unsigned short | cHEADING_ERROR_VALID = 0x04 |
A set of utilities that perform generic calculations among WSF objects.
| double WsfUtil::BallisticPropagate | ( | const UtVec3d & | aLocationWCS, |
| const UtVec3d & | aVelocityWCS, | ||
| double | aStopAltitude, | ||
| UtVec3d & | aPropagatedLocationWCS, | ||
| UtVec3d & | aPropagatedVelocityWCS ) |
Computes a simple ballistic projection from a starting location and velocity until falling below an altitude. Does NOT consider drag.
| aLocationWCS | Starting location in WCS |
| aVelocityWCS | Starting velocity in WCS |
| aStopAltitude | Altitude below which propagation is halted |
| aPropagatedLocationWCS | Resulting location in WCS |
| aPropagatedVelocityWCS | Resulting velocity in WCS |
| void WsfUtil::ClosestApproachPoint2D | ( | const double | aMoverLocWCS[3], |
| const double | aMoverVelWCS[3], | ||
| const double | aTargetLocWCS[3], | ||
| double | aClosestLocWCS[3] ) |
Compute the horizontal point of closest approach of a moving object to a given point. Given the location and velocity of a moving object and determine the horizontal point of closest approach to a given target location. This algorithm only solves the problem in the horizontal plane.
| aMoverLocWCS | [input] The WCS location of the moving object. |
| aMoverVelWCS | [input] The WCS velocity of the moving object. |
| aTargetLocWCS | [input] The WCS location of the target. |
| aClosestLocWCS | [output] The WCS location of the moving object at its point of closest approach. |
Referenced by UT_DEFINE_SCRIPT_METHOD().
| double WsfUtil::ClosestApproachPoint3D | ( | const double | aMoverLocWCS[3], |
| const double | aMoverVelWCS[3], | ||
| const double | aTargetLocWCS[3], | ||
| double | aClosestLocWCS[3] ) |
Compute the point of closest approach of a moving object at a given velocity.
| aMoverLocWCS | [input] The WCS location of the moving object. |
| aMoverVelWCS | [input] The WCS velocity of the moving object. |
| aTargetLocWCS | [input] The WCS location of the static target. |
| aClosestLocWCS | [output] The WCS location of the moving object at its point of closest approach. |
| void WsfUtil::ConvertRangeBearing | ( | const double | aFromLocationWCS[3], |
| UtEntity * | aToEntityPtr, | ||
| double & | aRange, | ||
| double & | aBearing ) |
Given an origin WCS location, range, and bearing, return the range and bearing from the given entity.
| int WsfUtil::CountBitsOn | ( | unsigned int | aBitMask | ) |
Count the number of bits on in a bit mask
| aBitMask | The bit mask to be tested. |
Referenced by WsfPlatform::ScriptOverride(), WsfDefaultSensorTracker::TargetDeleted(), WsfDefaultSensorTracker::TargetDetected(), and WsfDefaultSensorTracker::TargetSkipped().
| void WsfUtil::CovarianceToEllipse_2x2 | ( | std::vector< double > & | aMatrix, |
| double & | aSemiMajorAxis, | ||
| double & | aSemiMinorAxis, | ||
| double & | aBearingRad ) |
Given a 2x2 covariance matrix (in the form of a std::vector<double>), compute the semi-major axis, semi-minor axis, and bearing, in radians, of the associated error ellipse measured clockwise from north (y-axis).
| aMatrix | The covariance matrix in std::vector<double> form. |
| aSemiMajorAxis | The semi-major axis of the error ellipse. |
| aSemiMinorAxis | The semi-minor axis of the error ellipse. |
| aBearingRad | The bearing, in radians, of the semi-major axis measured clockwise from north (y-axis). |
References c1.
Referenced by wsf::event::utils::PrintTrackCovarianceData(), and wsf::event::utilsCSV::PrintTrackCovarianceData().
| double WsfUtil::DistanceToDestination | ( | T1 & | aSource, |
| T2 & | aDest ) |
Calculate the great circle distance from a source to a destination.
| aSource | The source object (non-const; typically a WsfPlatform or UtEntity). |
| aDest | The destination object. |
Referenced by TimeToDestination().
| void WsfUtil::ErrorNED | ( | double | aRange, |
| double | aBearing, | ||
| double | aElevation, | ||
| double | aRangeError, | ||
| double | aBearingError, | ||
| double | aElevationError, | ||
| double | aErrorNED[3] ) |
Given a range, bearing, elevation, and associated errors, compute the associated NED error.
| void WsfUtil::ErrorNED | ( | double | aRange, |
| double | aBearing, | ||
| double | aRangeError, | ||
| double | aBearingError, | ||
| double | aErrorNED[3] ) |
Given a range and bearing, and associated errors, compute the associated NED error. This version of the method will return a D error of the input range.
|
inline |
Form a bit mask with specified number of least-significant bits on.
| aNumBits | The number of bits to be on. |
Referenced by WsfPlatform::GetAppearance(), WsfExchange::IsCapable(), WsfSensorMode::ProcessInput(), WsfPlatform::ScriptOverride(), WsfPlatform::SetAppearance(), and WsfExchange::SetCapabilityFlag().
|
inline |
References GetAuxValue().
|
inline |
| void WsfUtil::GetErrorEstimateLLA_SpeedHeading | ( | const WsfTrack & | aTrack, |
| unsigned short & | aValidity, | ||
| double & | aStDevLat, | ||
| double & | aStDevLon, | ||
| double & | aStDevAlt, | ||
| double & | aStDevSpeed, | ||
| double & | aStDevHeading ) |
Given a track with valid location and covariance, provide estimates of error in location (lat, lon, alt), as well as speed, and heading of the target. If the covariance is 3x3, only the location errors are will be valid. A validity bit-field is passed as a parameter to determine which of the outputs are valid. The masks for this field are defied in the WsfUtil header: WsfUtil::cLLA_ERROR_VALID = 0x01 WsfUtil::cSPEED_ERROR_VALID = 0x02 WsfUtil::cHEADING_ERROR_VALID = 0x04
| aTrack | The track that is the source of the data being evaluated (position, velocity, and covariance). |
| aStDevLat | The estimated latitude error of the track location, in degreees. |
| aValidity | The bit-field that indicates the validitity of the return values. |
| aStDevLon | The estimated longitude error of the track location, in degrees. |
| aStDevAlt | The estimated altitude error of the track location, in meters. |
| aStDevSpeed | The estimated error in the track's speed (magnitude of velocity estimate), in meters per second. |
| aStDevHeading | The estimated error of the track's heading (arctan of east velocity component divided by north velocity component), in degrees. |
References cHEADING_ERROR_VALID, cLLA_ERROR_VALID, and cSPEED_ERROR_VALID.
| WsfTrackId WsfUtil::IntToTrackId | ( | int | aIntTrackId | ) |
Given an integer track id, compute a WSF track id. It is assumed that the argument was initially computed by the WsfUtil::ToInt method; otherwise the returned track id will not have meaning to an WSF simulation.
| void WsfUtil::MakeTrack | ( | double | aSimTime, |
| WsfTrack & | aTrack, | ||
| WsfPlatform & | aTarget, | ||
| WsfPlatform & | aSource ) |
Fill a track with truth information on aTarget with aSource as the track source.
References WsfPlatform::GetIndex(), WsfObject::GetNameId(), WsfPlatform::GetNextTrackId(), WsfPlatform::GetSideId(), WsfPlatform::GetSimulation(), WsfPlatform::GetSpatialDomain(), WsfObject::GetTypeId(), WsfTrack::Initialize(), WsfTrack::Set3D(), WsfTrack::SetPlatformOriginator(), WsfMeasurement::SetSpatialDomain(), WsfTrack::SetTargetIndex(), WsfTrack::SetTargetName(), and WsfTrack::SetTargetType().
Referenced by WsfExtDetonation::Execute(), WsfCuedLaserWeapon::Fire(), WsfWeaponServer::ProcessCommand(), and UT_DEFINE_SCRIPT_METHOD().
| bool WsfUtil::PotentiallyWithinRange | ( | double | aSimTime, |
| WsfPlatform * | aObject1Ptr, | ||
| WsfPlatform * | aObject2Ptr, | ||
| double | aMaximumRange ) |
Perform a very conservative check to see if two objects are within a defined interaction range.
This method is called by various 'device' objects (sensors, interferers, etc.) to determine if two platforms are POTENTIALLY within the interaction range of the device. It is basically a fast culling check that is used to prevent more expensive calculations that may be unnecessary.
Judicious use of this method can reduce computation time.
| aSimTime | The current simulation time. |
| aObject1Ptr | Pointer to the first platform. |
| aObject2Ptr | Pointer to the second platform. |
| aMaximumRange | The declared maximum interaction range. |
References deltaTime, WsfPlatform::GetLastUpdateTime(), and WsfPlatform::Update().
Referenced by WsfSensorMode::WithinDetectionRange().
| void WsfUtil::PrintLength | ( | const std::string & | aLabel, |
| double | aLength ) |
Prints out a length value in meters and feet on a single line prepended by a label. used for debug output.
| void WsfUtil::PrintLLA | ( | const std::string & | aLabel, |
| double | aLat, | ||
| double | aLon, | ||
| double | aAlt ) |
Prints out lat,lon,alt in both DMS and D formats as an info message. Used for debug output.
| void WsfUtil::PrintLLA | ( | const std::string & | aLabel, |
| double | aLocationWCS[3] ) |
Calls PrintLLA() for the LLA representation of aLocationWCS.
References PrintLLA().
Referenced by PrintLLA().
| double WsfUtil::SlantRange | ( | T1 & | aSource, |
| T2 & | aDest ) |
Calculate the slant range distance from a source to a destination (second parameter is const).
| aSource | The source object (non-const; typically a WsfPlatform or UtEntity). |
| aDest | The destination object. |
Referenced by WsfThreatProcessor::IsThreatening().
| double WsfUtil::TimeToDestination | ( | T1 & | aSource, |
| T2 & | aDest, | ||
| const double | aVel[3] ) |
Calculate the time it would take an object (e.g., a WsfPlatform) to traverse a great circle distance from a source to a destination.
| aSource | The source object. |
| aDest | The destination object. |
| aVel | velocity vector for the source object. |
References DistanceToDestination().
Referenced by UT_DEFINE_SCRIPT_METHOD().
| int WsfUtil::TrackIdToInt | ( | const WsfTrackId & | aTrackId | ) |
Given a WSF track id, compute a unique single integer.
References WsfTrackId::GetLocalTrackNumber(), and WsfTrackId::GetOwningPlatformId().
Referenced by MTT_PerceivedCluster::CopyFrom(), and WsfMTT_Correlation::CorrelateImpl().
| bool WsfUtil::TriangulateLocation | ( | const double | aOriginWCS_1[3], |
| const double & | aBearing1, | ||
| const double & | aElevation1, | ||
| const double | aOriginWCS_2[3], | ||
| const double & | aBearing2, | ||
| const double & | aElevation2, | ||
| double | aLocationWCS[3] ) |
Compute a triangulated position based on two valid azimuth/elevation measurements.
| aOriginWCS_1 | The WCS origin of the first measurement. |
| aBearing1 | The bearing measurement of the target from the first sensor. |
| aElevation1 | The elevation measurement of the target from the first sensor. |
| aOriginWCS_2 | The WCS origin of the first measurement. |
| aBearing2 | The bearing measurement of the target from the first sensor. |
| aElevation2 | The elevation measurement of the target from the first sensor. |
| aLocationWCS | The computed triangulated position. TODO The algorithm currently only utilized the second elevation measurement. review the paper to ensure the triangulation is as accurate as possible. |
|
static |
Referenced by GetErrorEstimateLLA_SpeedHeading().
|
static |
Validity Masks associated with the "aValidity" parameter in the following method:
Referenced by GetErrorEstimateLLA_SpeedHeading().
|
static |
Referenced by GetErrorEstimateLLA_SpeedHeading().