-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCD3D.h
212 lines (189 loc) · 7.08 KB
/
CD3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/*
* CD3D.h
* Release: ACCoRD++-2.b (08/22/10)
*
* Contact: Cesar Munoz ([email protected])
* NASA LaRC
* http://shemesh.larc.nasa.gov/people/cam/ACCoRD
*
* CD3D is an algorithm for 3-D conflict *detection*.
*
* Unit Convention
* ---------------
* All units in this file are *internal*:
* - Units of distance are denoted [d]
* - Units of time are denoted [t]
* - Units of speed are denoted [d/t]
*
* REMARK: X points to East, Y points to North.
*
* Naming Convention
* -----------------
* The intruder is fixed at the origin of the coordinate system.
*
* D : Diameter of the protected zone [d]
* H : Height of the protected zone [d]
* B : Lower bound of lookahed time interval [t] (B >= 0)
* T : Upper bound of lookahead time interval [t] (B < T)
* s : Relative 3-D position of the ownship [d,d,d]
* vo : Ownship velocity vector [d/t,d/t,d/t]
* vi : Traffic velocity vector [d/t,d/t,d/t]
*
* Functions
* ---------
* LoS : Check for 3-D loss of separation
* detection : 3-D conflict detection with calculation of conflict interval
* cd3d : Check for predicted conflict
*
* Global variables (modified by detection)
* ----------------
* t_in : Time to loss of separation
* t_out : Time to recovery from loss of separation
*
* Copyright (c) 2011-2021 United States Government as represented by
* the National Aeronautics and Space Administration. No copyright
* is claimed in the United States under Title 17, U.S.Code. All Other
* Rights Reserved.
*/
#ifndef CD3D_H_
#define CD3D_H_
#include "CD2D.h"
#include "Vertical.h"
#include "Detection3D.h"
#include "LossData.h"
namespace larcfm {
class CD3D {
public:
/**
* Returns true is aircraft are in loss of separation (LoS) at time 0.
*
* @param s the relative position of the aircraft
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
*
* @return true, if aircraft are in loss of separation
*/
static bool LoS(const Vect3& s, const double D, const double H);
/**
* Returns true is aircraft are in loss of separation at time 0.
*
* @param so the relative position of the ownship aircraft
* @param si the relative position of the traffic aircraft
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
*
* @return true, if aircraft are in loss of separation
*/
static bool lossOfSep(const Vect3& so, const Vect3& si, const double D, const double H);
/**
* Computes the conflict time interval in [B,T].
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
* @param B the the lower bound of the lookahead time (B >= 0)
* @param T the upper bound of the lookahead time (B < T)
*
* @return true, if the conflict time interval (t_in,t_out) is in [B,T].
* The returned t_in and t_out values are truncated to be within [B,T]
*
*/
static LossData detection(const Vect3& s, const Vect3& vo, const Vect3& vi, const double D, const double H, const double B, const double T);
/**
* Computes the actual conflict times
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
*
* @return true, if there is a conflict time interval (t_in,t_out)
*/
static LossData detectionActual(const Vect3& s, const Vect3& vo, const Vect3& vi, const double D, const double H);
/**
* Determines if there is a conflict in the time interval [B,T]
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
* @param B the the lower bound of the lookahead time (B >= 0)
* @param T the upper bound of the lookahead time (B < T)
*
* @return true, if there is a conflict in the time interval [B,T].
*/
static bool cd3d(const Vect3& s, const Vect3& vo, const Vect3& vi, const double D, const double H, const double B, const double T);
/**
* Determines if there is a conflict in the time interval [0,T]
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
* @param T the upper bound of the lookahead time (T > 0)
*
* @return true, if there is a conflict in the time interval [0,T].
*/
static bool cd3d(const Vect3& s, const Vect3& vo, const Vect3& vi, const double D, const double H, const double T);
/**
* Determines if there is a conflict in the time interval [0,...)
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
*
* @return true, if there is a conflict in the time interval [0,...)
*/
static bool cd3d(const Vect3& s, const Vect3& vo, const Vect3& vi, const double D, const double H);
/**
* Computes the time to cylindrical closest point of approach for the interval [0,...).
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
*
* @return the time to cylindrical closest point of approach for the interval [0,...).
*/
static double tccpa(const Vect3& s, const Vect3& vo, const Vect3& vi,
const double D, const double H);
/**
* Computes the time to cylindrical closest point of approach for the interval [B,T].
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
* @param B the the lower bound of the lookahead time (B >= 0)
* @param T the upper bound of the lookahead time (B < T)
*
* @return the time to cylindrical closest point of approach for the interval [B,T].
*/
static double tccpa(const Vect3& s, const Vect3& vo, const Vect3& vi,
const double D, const double H, const double B, const double T);
/**
* Computes the time to cylindrical closest point of approach for the interval [0,T].
*
* @param s the relative position of the aircraft
* @param vo the ownship's velocity
* @param vi the intruder's velocity
* @param D the minimum horizontal distance
* @param H the minimum vertical distance
* @param T the upper bound of the lookahead time (T > 0)
*
* @return the time to cylindrical closest point of approach for the interval [0,T].
*/
static double tccpa(const Vect3& s, const Vect3& vo, const Vect3& vi,
const double D, const double H, const double T);
};
}
#endif /* CD3D_H_ */