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