WSF
WsfSixDOF_Waypoint.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 2020 Infoscitex, a DCS 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 WSFSIXDOFWAYPOINT_HPP
13#define WSFSIXDOFWAYPOINT_HPP
14
15#include "wsf_six_dof_export.h"
16
17#include <string>
18
19#include "UtLLAPos.hpp"
20
21namespace wsf
22{
23namespace six_dof
24{
25class WSF_SIX_DOF_EXPORT Waypoint
26{
27public:
28 // This enum specifies the speed "units"
30 {
32 SPD_TYPE_TAS_KNOTS, // Knots True Air Speed (KTAS)
33 SPD_TYPE_CAS_KNOTS, // Knots Calibrated Air Speed (KCAS/KIAS)
34 SPD_TYPE_FPS, // Feet/second (fps)
35 SPD_TYPE_MPH, // Miles/hour (mph)
36 SPD_TYPE_MPS // Meters/second (mps)
37 };
38
39 // This enum specifies the type of g-load specified for a turn.
41 {
42 TURN_G_TYPE_LATERAL, // G-load in the lateral plane
44 };
45
46 // Structure containing a speed type and value
47 struct sSpeed
48 {
49 // Default speed of 400 ktas
51 double val = 400.0;
52 };
53
54 // Structure containing a turn G type and value
55 struct sTurnG
56 {
57 // Default 2-g turn (60 deg bank)
59 double val = 2.0;
60 };
61
62 // Default constructor
63 Waypoint() = default;
64
65 // Constructor given a lat/lon/alt
66 Waypoint(double aLat, double aLon, double aAlt);
67
68 // Remove the assignment operator
69 Waypoint& operator=(const Waypoint& other) = delete;
70
71 // Destructor
72 ~Waypoint() = default;
73
74 // Return a deep copy of this waypoint
75 Waypoint* Clone();
76
77 // Set Methods
78
79 // Functions to set current waypoint parameters
80 void SetLLA(const UtLLAPos& aPosLLA);
81
82 // Set whether or not the horizontal track should be followed
83 void SetFollowHorizontalTrack(bool aCommand);
84
85 // Set whether or not the vertical track should be followed
86 void SetFollowVerticalTrack(bool aCommand);
87
88 // Set whether or not the waypoint is achieved on passing
89 void SetWaypointOnPassing(bool aCommand);
90
91 // Set the speed given an sSpeed struct
92 void SetSpeed(sSpeed aSpeed);
93
94 // Set the speed given a type and a value
95 void SetSpeed(eSpeedType aType, double aValue);
96
97 // Set the maximum turn g
98 void SetMaxTurnG(eTurnGType type, double aTurnG);
99
100 // Set the waypoint label
101 void SetLabel(const std::string& aLabel);
102
103 // Set a GoTo to another waypoint
104 void SetGoTo(const std::string& aLabel);
105
106 // Numerical id value
107 void SetId(int aId);
108
109 // Get Methods
110 // Return the lat/lon/alt position of this waypoint
111 UtLLAPos GetLLA() const;
112
113 // Return the speed at this waypoint
114 sSpeed GetSpeed() const;
115
116 // Return the maximum turn G at this waypoint
117 sTurnG GetMaxTurnG() const;
118
119 // Return the label of this waypoint
120 std::string GetLabel() const;
121
122 // Return the GoTo of this waypoint
123 std::string GetGoTo() const;
124
125 // Return whether or not the horizontal track is to be followed
126 bool FollowHorizontalTrack() const;
127
128 // Return whether or not the vertical track is to be followed
129 bool FollowVerticalTrack() const;
130
131 // Return whether or not the waypoint is achieved on passing
132 bool WaypointOnPassing() const;
133
134 int GetId() const;
135
136private:
137 // Copy constructor
138 Waypoint(const Waypoint& aSrc) = default;
139
140 UtLLAPos mPosition_lla; // Position in lat, lon, alt_m
141 sSpeed mSpeed; // Speed type/value
142 sTurnG mMaxG_g; // Maximum radial G to use when turning
143 std::string mLabel; // Waypoint label
144 std::string mGoTo; // Label of waypoint to travel to
145 bool mFollowHorizontalTrack = true; // Follow the horizontal track (or just head straight to waypoint)
146 bool mFollowVerticalTrack = false; // Follow the vertical track (or use max vertical speed to climb to altitude)
147 bool mWaypointOnPassing = false; // Waypoint is achieved on passing (or on approach)
148 int mId = -1;
149};
150} // namespace six_dof
151} // namespace wsf
152
153#endif
Waypoint & operator=(const Waypoint &other)=delete
bool WaypointOnPassing() const
Definition WsfSixDOF_Waypoint.cpp:49
std::string GetLabel() const
Definition WsfSixDOF_Waypoint.cpp:101
void SetId(int aId)
Definition WsfSixDOF_Waypoint.cpp:111
eSpeedType
Definition WsfSixDOF_Waypoint.hpp:30
@ SPD_TYPE_TAS_KNOTS
Definition WsfSixDOF_Waypoint.hpp:32
@ SPD_TYPE_FPS
Definition WsfSixDOF_Waypoint.hpp:34
@ SPD_TYPE_MPH
Definition WsfSixDOF_Waypoint.hpp:35
@ SPD_TYPE_MPS
Definition WsfSixDOF_Waypoint.hpp:36
@ SPD_TYPE_MACH
Definition WsfSixDOF_Waypoint.hpp:31
@ SPD_TYPE_CAS_KNOTS
Definition WsfSixDOF_Waypoint.hpp:33
void SetWaypointOnPassing(bool aCommand)
Definition WsfSixDOF_Waypoint.cpp:34
UtLLAPos GetLLA() const
Definition WsfSixDOF_Waypoint.cpp:64
eTurnGType
Definition WsfSixDOF_Waypoint.hpp:41
@ TURN_G_TYPE_PILOT
Definition WsfSixDOF_Waypoint.hpp:43
@ TURN_G_TYPE_LATERAL
Definition WsfSixDOF_Waypoint.hpp:42
sSpeed GetSpeed() const
Definition WsfSixDOF_Waypoint.cpp:80
sTurnG GetMaxTurnG() const
Definition WsfSixDOF_Waypoint.cpp:91
void SetSpeed(sSpeed aSpeed)
Definition WsfSixDOF_Waypoint.cpp:69
Waypoint * Clone()
Definition WsfSixDOF_Waypoint.cpp:19
void SetLabel(const std::string &aLabel)
Definition WsfSixDOF_Waypoint.cpp:96
int GetId() const
Definition WsfSixDOF_Waypoint.cpp:54
void SetFollowHorizontalTrack(bool aCommand)
Definition WsfSixDOF_Waypoint.cpp:24
bool FollowHorizontalTrack() const
Definition WsfSixDOF_Waypoint.cpp:39
void SetFollowVerticalTrack(bool aCommand)
Definition WsfSixDOF_Waypoint.cpp:29
void SetMaxTurnG(eTurnGType type, double aTurnG)
Definition WsfSixDOF_Waypoint.cpp:85
std::string GetGoTo() const
Definition WsfSixDOF_Waypoint.cpp:116
void SetLLA(const UtLLAPos &aPosLLA)
Definition WsfSixDOF_Waypoint.cpp:59
bool FollowVerticalTrack() const
Definition WsfSixDOF_Waypoint.cpp:44
void SetGoTo(const std::string &aLabel)
Definition WsfSixDOF_Waypoint.cpp:106
Definition WsfSA_Processor.hpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Definition WsfSixDOF_Waypoint.hpp:48
eSpeedType type
Definition WsfSixDOF_Waypoint.hpp:50
double val
Definition WsfSixDOF_Waypoint.hpp:51
Definition WsfSixDOF_Waypoint.hpp:56
eTurnGType type
Definition WsfSixDOF_Waypoint.hpp:58
double val
Definition WsfSixDOF_Waypoint.hpp:59
Copyrights Multiple, All Rights Reserved