WSF
WsfDirectionFinderProcessor.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFDIRECTIONFINDERPROCESSOR_HPP
13#define WSFDIRECTIONFINDERPROCESSOR_HPP
14
15#include "wsf_export.h"
16
17#include <list>
18
22
23#ifdef DEBUG_DIR_FIND_VERBOSE
24#include <cstring>
25#include <sstream>
26#endif
27
28#include "UtEntity.hpp"
29class UtLineSegment;
30#include "UtRandom.hpp"
31#include "WsfCovariance.hpp"
32#include "WsfDraw.hpp"
33#include "WsfFilter.hpp"
35#include "WsfLocalTrack.hpp"
37#include "WsfTrackList.hpp"
38
39namespace wsf
40{
41class Terrain;
42}
43
51{
52public:
63
64#ifdef DEBUG_DIR_FIND_VERBOSE
65 inline static std::string ToString(FuseResult result)
66 {
67 std::stringstream ss;
68 ss << result;
69 return ss.str();
70 }
71 inline friend std::ostream& operator<<(std::ostream& aOut, const FuseResult& aType)
72 {
73 if (aType == FUSE_SUCCESS)
74 {
75 aOut << "FUSE_SUCCESS";
76 }
77 else if (aType == NO_FUSE_ANGLE_THERSHOLD)
78 {
79 aOut << "NO_FUSE_ANGLE_THERSHOLD";
80 }
81 else if (aType == NO_FUSE_BASELINE_DIST)
82 {
83 aOut << "NO_FUSE_BASELINE_DIST";
84 }
85 else if (aType == NO_FUSE_DIVERGENT_BEARINGS)
86 {
87 aOut << "NO_FUSE_DIVERGENT_BEARINGS";
88 }
89 else if (aType == NO_FUSE_NO_INTERSECTION)
90 {
91 aOut << "NO_FUSE_NO_INTERSECTION";
92 }
93 else if (aType == NO_FUSE_EXCEED_RANGE_ERROR)
94 {
95 aOut << "NO_FUSE_EXCEED_RANGE_ERROR";
96 }
97 else if (aType == NO_FUSE_NON_SYNC)
98 {
99 aOut << "NO_FUSE_NON_SYNC";
100 }
101 return aOut;
102 }
103#endif
104
105public:
106 WsfDirectionFinderProcessor(WsfScenario& aScenario);
107 WsfDirectionFinderProcessor(const WsfDirectionFinderProcessor& aSrc);
110
111 bool ProcessInput(UtInput& aInput) override;
112 bool Initialize(double aSimTime) override;
113 WsfProcessor* Clone() const override { return new WsfDirectionFinderProcessor(*this); }
114 bool ProcessMessage(double aSimTime, const WsfMessage& aMessage) override;
115
116protected:
117 bool FuseSideType(WsfTrack& aFusedTrack, const WsfTrack& aBearingElevationTrack);
118
119 WsfLocalTrack* CreateLocalTrack(const WsfTrack& aTrack);
120
121 void AddFilterToFusedTrack(WsfLocalTrack& aTrack);
122
123 double GetPurgeInterval() const { return mPurgeInterval; }
124
125 double GetMaxExpectedError() const { return mMaxExpectedError; }
126
127 bool BypassFilter() const { return mBypassFilter; }
128
129 bool UseTruthAltitude() const { return mUseTruthAltitude; }
130
131 wsf::Terrain& GetTerrain() const { return *mTerrainPtr; }
132
133 double CorrectForAltitude(double aTargetLocWCS[3], // in / out
134 WsfPlatform* aTargetPtr,
135 bool aComputeElevation,
136 double aDefaultElevation);
137
138 std::list<std::unique_ptr<WsfTrack>> mTrackList;
141
146
148
149private:
150 FuseResult FuseBearingElevation(WsfLocalTrack& aFusedTrack,
151 WsfTrack& aSavedTrack, // for internal use
152 WsfTrack& aBearingElevationTrack);
153
154 bool GetIntersectionPoint(const UtLineSegment& aTargetVec1,
155 const UtLineSegment& aTargetVec2,
156 double aIntersectionPoint[3],
157 bool aDraw = false);
158
159
160 void GetNED_Vector(double aBearing, double aElevation, double aVecNED[3]);
161
162 void CorrectForAltitude(double aAlt,
163 double aLocationWCS[3]); // in/out
164
165 UtEntity mReferencePoint;
166 double mCenterLat;
167 double mCenterLon;
168 double mCenterRad;
169 bool mFuseAllCollects;
170 bool mUseTruthAltitude;
171 double mPurgeInterval;
172 double mMaxExpectedError;
173 double mMinBaselineDistance;
174 bool mTest;
175
178 double mMaxTimeDifference;
179
183 bool mBypassFilter;
184
188 bool mUseStatisticalLocation;
189 ut::Random mRandom;
190};
191
192#endif
std::ostream & operator<<(std::ostream &aStream, const WsfTSPI &aTSPI)
Stream out operator (typically, to a file); units are converted on output.
Definition WsfTSPI.cpp:92
WsfTrackListT< WsfLocalTrack > WsfLocalTrackList
Definition WsfTrackList.hpp:89
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
WsfProcessor * Clone() const override
Definition WsfDirectionFinderProcessor.hpp:113
wsf::Terrain * mTerrainPtr
Definition WsfDirectionFinderProcessor.hpp:147
double CorrectForAltitude(double aTargetLocWCS[3], WsfPlatform *aTargetPtr, bool aComputeElevation, double aDefaultElevation)
Definition WsfDirectionFinderProcessor.cpp:899
WsfLocalTrackList mFusedTrackList
Definition WsfDirectionFinderProcessor.hpp:139
WsfDirectionFinderProcessor(WsfScenario &aScenario)
Definition WsfDirectionFinderProcessor.cpp:42
FuseResult
Definition WsfDirectionFinderProcessor.hpp:54
@ NO_FUSE_NO_INTERSECTION
Definition WsfDirectionFinderProcessor.hpp:59
@ NO_FUSE_EXCEED_RANGE_ERROR
Definition WsfDirectionFinderProcessor.hpp:60
@ NO_FUSE_DIVERGENT_BEARINGS
Definition WsfDirectionFinderProcessor.hpp:58
@ NO_FUSE_NON_SYNC
Definition WsfDirectionFinderProcessor.hpp:61
@ NO_FUSE_ANGLE_THRESHOLD
Definition WsfDirectionFinderProcessor.hpp:56
@ NO_FUSE_BASELINE_DIST
Definition WsfDirectionFinderProcessor.hpp:57
@ FUSE_SUCCESS
Definition WsfDirectionFinderProcessor.hpp:55
std::list< std::unique_ptr< WsfTrack > > mTrackList
Definition WsfDirectionFinderProcessor.hpp:138
double GetPurgeInterval() const
Definition WsfDirectionFinderProcessor.hpp:123
wsf::Terrain & GetTerrain() const
Definition WsfDirectionFinderProcessor.hpp:131
bool BypassFilter() const
Definition WsfDirectionFinderProcessor.hpp:127
WsfFilter * mPrototypeFilterPtr
Definition WsfDirectionFinderProcessor.hpp:145
double GetMaxExpectedError() const
Definition WsfDirectionFinderProcessor.hpp:125
WsfDirectionFinderProcessor & operator=(const WsfDirectionFinderProcessor &)=delete
WsfPerfectCorrelation mCorrelation
Definition WsfDirectionFinderProcessor.hpp:140
bool UseTruthAltitude() const
Definition WsfDirectionFinderProcessor.hpp:129
Implement a filter as an adapter.
Definition WsfFilter.hpp:24
bool ProcessInput(UtInput &aInput) override
Definition WsfLinkedProcessor.cpp:54
bool ProcessMessage(double aSimTime, const WsfMessage &aMessage) override
Definition WsfLinkedProcessor.cpp:70
bool Initialize(double aSimTime) override
Definition WsfLinkedProcessor.cpp:43
WsfLinkedProcessor(WsfScenario &aScenario)
Definition WsfLinkedProcessor.cpp:19
Definition WsfLocalTrack.hpp:32
A base class for messages sent among simulation communication objects, processors and sensors.
Definition WsfMessage.hpp:33
Definition WsfPerfectCorrelation.hpp:22
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
WsfProcessor(const WsfScenario &aScenario)
Definition WsfProcessor.cpp:25
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Definition WsfTerrain.hpp:336
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved