LRAUV  revA
HFRadarModelPoint.h
Go to the documentation of this file.
1 
12 #ifndef HFRADARMODELPOINT_H_
13 #define HFRADARMODELPOINT_H_
14 
15 #include "component/Behavior.h"
16 #include "data/Mtx.h"
17 #include "utils/FlexArray.h"
18 
19 class Location;
20 class LocationNode;
23 
35 {
36 public:
37  HFRadarModelPoint( const Str& prefix, const Module* module );
38 
39  virtual ~HFRadarModelPoint();
40 
41  void initialize( void );
42 
44  bool isSatisfied();
45 
47  void run();
48 
50  bool runIfUnsatisfied();
51 
52  void uninitialize( void );
53 
55  static Behavior* CreateBehavior( const Str& prefix, const Module* module );
56 
57 protected:
58 
61 
64 
67 
70 
73 
74  // Intermediate lat/lon points
76 
77  // If true, need to calculate subpoints
79 
80  // If true, currently calculating subpoints
82 
83  // If true, currently refining subpoints
85 
88  float* fineLat_;
90  float* fineLon_;
91  float*** fineU_;
92  float*** fineV_;
93 
95  float bearing_;
96 
99 
103 
106 
110 
113 
115  double initTime_;
116 
119 
120  // Slate input setting variables
121 
125 
129 
135 
136  // Desired waypoint latitude
138 
139  // Desired waypoint latitude delta from the current latitude
140  // If specified with latitude, the two are added together
142 
143  // Desired waypoint longitude
145 
146  // Desired waypoint latitude delta from the current latitude
147  // If specified with latitude, the two are added together
149 
155 
158 
161 
162  // Slate input measurements
163 
166 
169 
170  // Slate output variables
171 
172  // Sets the heading mode for HeadingControl
174 
175  // Sets the waypoint latitude for HeadingControl
177 
178  // Sets the waypoint longitude for HeadingControl
180 
181  // Sets the bearing to the waypoint
183 
184  // Variables related to path search algorithm
185 
187 
189 
191 
194 
197 
200 
202  float heuristic( LocationNode* node, const float& maxCurent );
203 
204  // Returns 32 pairs of adjoining edge offsets from a grid center
205  // Can be subset at the first 8 or 16 offsets
206  static const int EDGE_OFFSETS[32][2];
207 
209  void getAdjoining( const LocationNode* node, FlexArray<LocationNode*>& adjs,
210  int nLats, int nLons, float* lats, float* lons );
211 
212  // Returns the travel time from one node to another
213  // Assumes that dScore of node equals arrival time at that node minus initTime_
214  float travelTime( LocationNode* fromNode, LocationNode* toNode,
215  const double* time, int timeSize, float*** u, float*** v );
216 
217 private:
218  // Note that the copy constructor below is private and not given a body.
219  // Any attempt to call it will return a compiler error.
220  HFRadarModelPoint( const HFRadarModelPoint& old ); // disallow copy constructor
221 
222  void initCompletion( double startLatitude, double startLongitude );
223 
224  void calcCompletion( double startLatitude, double startLongitude,
225  double latitudeSetting, double longitudeSetting,
226  double& perpendicularSlope, bool& startOverLine );
227 
228  bool isComplete( double latitude, double longitude, double latitudeGoal,
229  double longitudeGoal, double perpendicularSlope,
230  bool startOverLine );
231 
233  void initNodes( const double& latitude, const double& longitude, int latSize,
234  int lonSize, float* lat, float* lon, const float& maxCurrent );
235 
236  // Allocates fine-grained data
237  void makeFine( int timeSize, int latSize, int lonSize, float* lat,
238  float* lon, float*** u, float*** v );
239 
241  void clearFine();
242 
243 };
244 
245 #endif /*RATECALCULATOR_H_*/
Timestamp calcCompleteTime_
Definition: HFRadarModelPoint.h:186
int minNodeCount_
Just for statistics, number of nodes considered "minimum" nodes.
Definition: HFRadarModelPoint.h:199
virtual ~HFRadarModelPoint()
Definition: HFRadarModelPoint.cpp:79
bool initialized_
Indicates initialization success.
Definition: HFRadarModelPoint.h:112
DataWriter * bearingCmdWriter_
Definition: HFRadarModelPoint.h:182
SettingReader * latitudeSettingReader_
Definition: HFRadarModelPoint.h:137
int fineLonSize_
Definition: HFRadarModelPoint.h:89
FastMap< const float, LocationNode * > nodeQueue_
The A* priority queue.
Definition: HFRadarModelPoint.h:196
double intermediateLatitude_
Intermediate Latitude along the way.
Definition: HFRadarModelPoint.h:69
void run()
The actual "payload" of the component.
Definition: HFRadarModelPoint.cpp:286
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: UniversalDataReader.h:26
SettingReader * eastingsDeltaSettingReader_
Desired change in longitude to achieve, expressed as a distance.
Definition: HFRadarModelPoint.h:134
SettingReader * distanceDeltaSettingReader_
distance from the nominal waypoint set by other settings.
Definition: HFRadarModelPoint.h:124
bool calculatingSubpoints_
Definition: HFRadarModelPoint.h:81
SettingReader * speedSettingReader_
Speed of the vehicle to use in computations.
Definition: HFRadarModelPoint.h:157
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: UniversalDataWriter.h:24
float *** fineV_
Definition: HFRadarModelPoint.h:92
void calcCompletion(double startLatitude, double startLongitude, double latitudeSetting, double longitudeSetting, double &perpendicularSlope, bool &startOverLine)
Definition: HFRadarModelPoint.cpp:92
LocationNode * goalNode_
Definition: HFRadarModelPoint.h:190
float * fineLat_
Definition: HFRadarModelPoint.h:88
float travelTime(LocationNode *fromNode, LocationNode *toNode, const double *time, int timeSize, float ***u, float ***v)
Definition: HFRadarModelPoint.cpp:630
SettingReader * distanceDeltaBearingSettingReader_
bearing of distance from the nominal waypoint set by other settings.
Definition: HFRadarModelPoint.h:128
SettingReader * longitudeDeltaSettingReader_
Definition: HFRadarModelPoint.h:148
void uninitialize(void)
Provide a space for uninitialization.
Definition: HFRadarModelPoint.cpp:1003
double finalPerpendicularSlope_
Slope for crossing line (thru wapoint)
Definition: HFRadarModelPoint.h:98
LocationNode * startNode_
Definition: HFRadarModelPoint.h:188
Behavior is the abstract base class for components that implement mission behaviors and commands...
Definition: Behavior.h:32
Over simplified HFRadarModelPoint component.
Definition: HFRadarModelPoint.h:34
Definition: LocationNode.h:14
float * fineLon_
Definition: HFRadarModelPoint.h:90
bool runIfUnsatisfied()
runs only if unsatisfied
Definition: HFRadarModelPoint.cpp:990
bool finalStartOverLine_
Is our starting point latitude > than the latitude of the starting longitude on the crossing line...
Definition: HFRadarModelPoint.h:102
void getAdjoining(const LocationNode *node, FlexArray< LocationNode * > &adjs, int nLats, int nLons, float *lats, float *lons)
Appends the adjoining nodes to the specified node to the FlexArray.
Definition: HFRadarModelPoint.cpp:564
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
SettingReader * latitudeDeltaSettingReader_
Definition: HFRadarModelPoint.h:141
bool refiningSubpoints_
Definition: HFRadarModelPoint.h:84
DataWriter * latitudeCmdWriter_
Definition: HFRadarModelPoint.h:176
Contains the FlexArrayBase and FlexArray class declarations.
bool isSatisfied()
Returns true when vehicle has "arrived" at the waypoint.
Definition: HFRadarModelPoint.cpp:255
void initCompletion(double startLatitude, double startLongitude)
double longitudeSetting_
Desired Longitude.
Definition: HFRadarModelPoint.h:63
Contains the Behavior class definition.
double latitudeSetting_
Desired Latitude.
Definition: HFRadarModelPoint.h:60
void initNodes(const double &latitude, const double &longitude, int latSize, int lonSize, float *lat, float *lon, const float &maxCurrent)
Sets up node map and node queue.
Definition: HFRadarModelPoint.cpp:524
double intermediateLongitude_
Intermediate Laongitude along the way.
Definition: HFRadarModelPoint.h:72
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
float *** fineU_
Definition: HFRadarModelPoint.h:91
FlexArray< FlexArray< LocationNode * > * > nodeMap_
The node map.
Definition: HFRadarModelPoint.h:193
float bearing_
Desired Bearing.
Definition: HFRadarModelPoint.h:95
Replacement for standard template class string.
Definition: Str.h:12
SettingReader * northingsDeltaSettingReader_
Desired change in latitude to achieve, expressed as a distance.
Definition: HFRadarModelPoint.h:154
FlexArray< Location * > subpoints_
Definition: HFRadarModelPoint.h:75
void initialize(void)
Provide a space for initialization before being run.
Definition: HFRadarModelPoint.cpp:117
UniversalDataReader * latitudeReader_
Current platform latitude.
Definition: HFRadarModelPoint.h:165
void clearFine()
Clears refining data.
Definition: HFRadarModelPoint.cpp:942
DataWriter * horizontalModeWriter_
Definition: HFRadarModelPoint.h:173
Reads values from mission settings.
Definition: SettingReader.h:26
DataWriter * longitudeCmdWriter_
Definition: HFRadarModelPoint.h:179
double intermediatePerpendicularSlope_
Slope for crossing line (thru intermediate wapoint)
Definition: HFRadarModelPoint.h:105
HFRadarModelPoint(const Str &prefix, const Module *module)
Definition: HFRadarModelPoint.cpp:19
float speedSetting_
Expected speed.
Definition: HFRadarModelPoint.h:66
SettingReader * longitudeSettingReader_
Definition: HFRadarModelPoint.h:144
double initTime_
Time of initialization.
Definition: HFRadarModelPoint.h:115
bool isComplete(double latitude, double longitude, double latitudeGoal, double longitudeGoal, double perpendicularSlope, bool startOverLine)
Definition: HFRadarModelPoint.cpp:235
Wraps a pair of double precision (8-byte) floating point numbers and units for storage in a DataEleme...
Definition: Location.h:38
int timeSize_
Size of time array.
Definition: HFRadarModelPoint.h:118
float heuristic(LocationNode *node, const float &maxCurent)
Returns the best possible travel time to goalNode_ following a straight line;.
Definition: HFRadarModelPoint.cpp:547
SettingReader * gridDivideSettingReader_
Speed of the vehicle to use in computations.
Definition: HFRadarModelPoint.h:160
static Behavior * CreateBehavior(const Str &prefix, const Module *module)
Mission Component factory interface.
Definition: HFRadarModelPoint.cpp:1014
bool needSubpoints_
Definition: HFRadarModelPoint.h:78
UniversalDataReader * longitudeReader_
Current platform longitude.
Definition: HFRadarModelPoint.h:168
bool intermediateStartOverLine_
Is our starting point latitude > than the latitude of the starting longitude on the intermediate cros...
Definition: HFRadarModelPoint.h:109
static const int EDGE_OFFSETS[32][2]
Definition: HFRadarModelPoint.h:206
Represents absolute times.
Definition: Timestamp.h:31
void makeFine(int timeSize, int latSize, int lonSize, float *lat, float *lon, float ***u, float ***v)
Definition: HFRadarModelPoint.cpp:729
int fineLatSize_
Storage for data when refining data points.
Definition: HFRadarModelPoint.h:87