15#ifndef WSFNAVIGATIONERRORS_HPP
16#define WSFNAVIGATIONERRORS_HPP
18#include "wsf_export.h"
24#include "UtCoords.hpp"
25#include "UtEntity.hpp"
28#include "UtRandom.hpp"
65 void Update(
double aSimTime);
76 ut::coords::RSCS GetLocationErrorRSCS()
const;
77 ut::coords::WCS GetLocationErrorWCS()
const;
78 void SetLocationErrorWCS(
const ut::coords::WCS& aLocationErrorWCS);
80 ut::coords::WCS GetPerceivedLocationWCS()
const;
81 void GetPerceivedLocationLLA(
double& aLat,
double& aLon,
double& aAlt)
const;
96 virtual bool SetGPS_Status(
double aSimTime, GPS_Status aStatus);
99 static GPS_Status GetGPS_Status(
int aStatus);
114 Term(
double aCoefficient,
double aExponent)
119 int intExponent =
static_cast<int>(
mExponent);
120 if (
static_cast<double>(intExponent) ==
mExponent)
142 ut::coords::RSCS
ConvertNED_ToRSCS(UtEntity* aEntityPtr,
const ut::coords::NED& aLocNED)
const;
144 ut::coords::NED
ConvertRSCS_ToNED(UtEntity* aEntityPtr,
const ut::coords::RSCS& aLocRSCS)
const;
@ cWSF_INITIALIZE_ORDER_NAVIGATION_ERRORS
Definition WsfComponentRoles.hpp:174
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_NAVIGATION_ERRORS
A 'navigation_error' component (WsfNavigationErrors).
Definition WsfComponentRoles.hpp:108
aObjectPtr Update(simTime)
WsfSimpleComponentT< WsfPlatformComponent > WsfSimplePlatformComponent
Definition WsfSimpleComponent.hpp:126
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfComponent.hpp:39
virtual bool Initialize(double aSimTime)
Definition WsfComponent.cpp:45
virtual bool Initialize2(double aSimTime)
Definition WsfComponent.cpp:63
virtual bool ProcessInput(UtInput &aInput)
Definition WsfComponent.cpp:100
Term()
Definition WsfNavigationErrors.hpp:107
double mExponent
Definition WsfNavigationErrors.hpp:126
Term(double aCoefficient, double aExponent)
Definition WsfNavigationErrors.hpp:114
int mIntExponent
Definition WsfNavigationErrors.hpp:127
double mCoefficient
Definition WsfNavigationErrors.hpp:125
Definition WsfNavigationErrors.hpp:42
void INS_Initialize(double aSimTime)
Definition WsfNavigationErrors.cpp:831
std::vector< Term > Polynomial
Definition WsfNavigationErrors.hpp:138
std::string mTimeHistoryPath
Definition WsfNavigationErrors.hpp:247
double mINS_StartTime
The time when INS mode was initiated.
Definition WsfNavigationErrors.hpp:221
double GetLastUpdateTime() const
Get the time when the last call was made.
Definition WsfNavigationErrors.hpp:74
GPS_Status GetGPS_Status() const
Definition WsfNavigationErrors.hpp:97
WsfNavigationErrors()
Definition WsfNavigationErrors.cpp:87
WsfComponent * CloneComponent() const override
Definition WsfNavigationErrors.hpp:54
GPS_Status mGPS_Status
GPS status. -1: no GPS (use INS), 0 = perfect (no errors), 1 : GPS Active; 2 GPS Degraded.
Definition WsfNavigationErrors.hpp:167
WSF_DEPRECATED void GetLocationErrorXYZ(double aLocationErrorXYZ[3]) const
Definition WsfNavigationErrors.cpp:1118
double GlobalGaussian()
Definition WsfNavigationErrors.cpp:667
int GetComponentInitializationOrder() const override
Definition WsfNavigationErrors.hpp:56
WsfVariable< double > mGPS_DegradedMultiplier
Definition WsfNavigationErrors.hpp:181
WsfVariable< double > mGPS_VerticalError
Standard deviation of a Gaussian distribution for vertical errors for GPS.
Definition WsfNavigationErrors.hpp:177
bool mRandomnessEnabled
true if randomness is enabled (default true).
Definition WsfNavigationErrors.hpp:224
void INS_PrintEquations(const std::string &aString, const Polynomial aTerms[3], ut::log::MessageStream &aStream) const
Definition WsfNavigationErrors.cpp:930
void ReadPolynomial(UtInput &aInput, Polynomial &aTerms)
Definition WsfNavigationErrors.cpp:741
Polynomial mINS_AclError[3]
Definition WsfNavigationErrors.hpp:207
double mINS_ScaleFactor[3]
A simple scale factor for the INS errors.
Definition WsfNavigationErrors.hpp:214
Polynomial mINS_VelError[3]
Definition WsfNavigationErrors.hpp:206
ut::coords::WCS GetLocationErrorWCS() const
Definition WsfNavigationErrors.cpp:439
WsfVariable< double > mGPS_InTrackError
Standard deviation of a Gaussian distribution for the 'in-track' errors for GPS.
Definition WsfNavigationErrors.hpp:171
void * QueryInterface(int aRole) override
Definition WsfNavigationErrors.hpp:55
virtual void GPS_Update(double aSimTime)
Definition WsfNavigationErrors.cpp:791
void INS_Start(double aSimTime)
Definition WsfNavigationErrors.cpp:958
std::string StatusString(int aStatus) const
Definition WsfNavigationErrors.cpp:775
bool mShowStatusChanges
true if status change messages should be written to stdout.
Definition WsfNavigationErrors.hpp:227
ut::coords::WCS GetPerceivedLocationWCS() const
Get the perceived WCS location of the platform as of the last update.
Definition WsfNavigationErrors.cpp:504
virtual void InitializeGPS_Status(double aSimTime)
Definition WsfNavigationErrors.cpp:562
bool mPerceivedEntityValid
Definition WsfNavigationErrors.hpp:231
ut::Random mRandom
Random number stream.
Definition WsfNavigationErrors.hpp:243
ut::coords::WCS mExternalLocationErrorWCS
The location error used when mGPS_Status == GPS_Status::cGPS_EXTERNAL.
Definition WsfNavigationErrors.hpp:211
static WsfNavigationErrors * Find(const WsfPlatform &aPlatform)
Definition WsfNavigationErrors.cpp:81
WsfVariable< double > mINS_AccelerometerBiasError
Standard deviation of a Gaussian distribution for the INS accelerometer bias error.
Definition WsfNavigationErrors.hpp:187
static void RegisterComponentFactory(WsfScenario &aScenario)
Definition WsfNavigationErrors.cpp:74
void INS_Update(double aSimTime)
Definition WsfNavigationErrors.cpp:998
UtEntity & GetPerceivedEntity()
Definition WsfNavigationErrors.hpp:83
ut::coords::RSCS ConvertNED_ToRSCS(UtEntity *aEntityPtr, const ut::coords::NED &aLocNED) const
Definition WsfNavigationErrors.cpp:631
double mLastUpdateTime
Definition WsfNavigationErrors.hpp:218
WsfVariable< double > mINS_RandomWalkError
Standard deviation of a Gaussian distribution for the INS angular random walk error.
Definition WsfNavigationErrors.hpp:190
GPS_Status
Definition WsfNavigationErrors.hpp:88
@ cGPS_ACTIVE
Definition WsfNavigationErrors.hpp:91
@ cGPS_PERFECT
Definition WsfNavigationErrors.hpp:90
@ cGPS_DEGRADED
Definition WsfNavigationErrors.hpp:92
@ cGPS_INACTIVE
Definition WsfNavigationErrors.hpp:89
@ cGPS_EXTERNAL
Definition WsfNavigationErrors.hpp:93
WsfVariable< int > mGPS_StatusVar
Definition WsfNavigationErrors.hpp:168
WsfVariable< double > mINS_GyroscopeBiasError
Standard deviation of a Gaussian distribution for the INS gyroscope bias error.
Definition WsfNavigationErrors.hpp:184
WsfVariable< double > mGPS_CrossTrackError
Standard deviation of a Gaussian distribution for the 'cross-track' errors for GPS.
Definition WsfNavigationErrors.hpp:174
double LocalGaussian()
Definition WsfNavigationErrors.cpp:674
UtEntity mPerceivedEntity
The entity that represents the perceived state.
Definition WsfNavigationErrors.hpp:237
void WriteTimeHistory(double aSimTime)
Definition WsfNavigationErrors.cpp:1069
bool mINS_ErrorsInitialized
true if INS errors have been initialized.
Definition WsfNavigationErrors.hpp:234
void ComponentParentChanged(WsfPlatform *aPlatformPtr) override
Definition WsfNavigationErrors.hpp:57
double EvaluatePolynomial(double aT, const Polynomial &aTerms) const
Definition WsfNavigationErrors.cpp:703
ut::coords::NED ConvertRSCS_ToNED(UtEntity *aEntityPtr, const ut::coords::RSCS &aLocRSCS) const
Definition WsfNavigationErrors.cpp:651
WsfVariable< double > mINS_VerticalError
Standard deviation of a Gaussian distribution for vertical error for INS.
Definition WsfNavigationErrors.hpp:193
WsfPlatform * mPlatformPtr
Pointer to the platform for which errors are being computed.
Definition WsfNavigationErrors.hpp:164
void CompressPolynomial(Polynomial &aTerms)
Compress a polynomial to remove terms with a zero coefficient.
Definition WsfNavigationErrors.cpp:682
std::ofstream mTimeHistoryOfs
Stream for writing time history output.
Definition WsfNavigationErrors.hpp:250
Polynomial mINS_LocError[3]
Definition WsfNavigationErrors.hpp:205
UtEntity mTruthEntity
The truth entity state.
Definition WsfNavigationErrors.hpp:240
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
WsfSimpleComponentT & operator=(const WsfSimpleComponentT &aRhs)
Definition WsfSimpleComponent.hpp:84
int mRoles[2]
Definition WsfSimpleComponent.hpp:116
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfVariable.hpp:149