Available Functions and Documentation¶
Apart from the algorithms, several auxiliary functions are available. In this page, one can find all the available functions and their respective documentation.
Algorithms¶
gtrs ¶
gtrs(
a_i: ArrayLike,
n: int,
k: int,
destinations: ArrayLike,
initial_uav_position: ArrayLike,
v_max: float,
tau: float,
gamma: float,
noise_seed: int = 1,
noise_distribution: str = "standard_normal",
distribution_parameters: Optional[ArrayLike] = None,
tol: float = 0.001,
n_iter: int = 30,
max_lim: float = 1000000.0,
) -> NDArray
Executes the GTRS algorithm.
See here more details about the GTRS algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a_i |
ArrayLike
|
The true position of the anchors in 3D. |
required |
n |
int
|
The number of anchors. |
required |
k |
int
|
The number of measurements. |
required |
destinations |
ArrayLike
|
The intermediate points need for navigation in 3D. |
required |
initial_uav_position |
ArrayLike
|
The initial UAV position in 3D. |
required |
v_max |
float
|
The maximum velocity that the UAV can fly. |
required |
tau |
float
|
The threshold to reach the destination. |
required |
gamma |
float
|
The smoothing factor. |
required |
noise_seed |
int
|
The seed to generate the noise. |
1
|
noise_distribution |
str
|
The distribution used to model the noise. |
'standard_normal'
|
distribution_parameters |
Optional[ArrayLike]
|
Optional parameters to customize the noise distribution. |
None
|
tol |
float
|
The tolerance for the bisection function. |
0.001
|
n_iter |
int
|
The max number of iterations for the bisection function. |
30
|
max_lim |
float
|
The maximum value for the interval in the bisection function. |
1000000.0
|
Returns:
Type | Description |
---|---|
NDArray
|
The estimated positions for the UAV computed using the GTRS algorithm for the given input scenario |
NDArray
|
and the true trajectory that the UAV followed. |
Source code in autonav/GTRS.py
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 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
wls ¶
wls(
a_i: ArrayLike,
n: int,
k: int,
destinations: ArrayLike,
initial_uav_position: ArrayLike,
v_max: float,
tau: float,
gamma: float,
noise_seed: int = 1,
noise_distribution: str = "standard_normal",
distribution_parameters: Optional[ArrayLike] = None,
) -> NDArray
Executes the WLS algorithm.
[See here more details about the WLS algorithm.] (https://ietresearch.onlinelibrary.wiley.com/doi/full/10.1049/wss2.12041)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a_i |
ArrayLike
|
The true position of the anchors in 3D. |
required |
n |
int
|
The number of anchors. |
required |
k |
int
|
The number of measurements. |
required |
destinations |
ArrayLike
|
The intermediate points need for navigation in 3D. |
required |
initial_uav_position |
ArrayLike
|
The initial UAV position in 3D. |
required |
v_max |
float
|
The maximum velocity that the UAV can fly. |
required |
tau |
float
|
The threshold to reach the destination. |
required |
gamma |
float
|
The smoothing factor. |
required |
noise_seed |
int
|
The seed to generate the noise. |
1
|
noise_distribution |
str
|
The distribution used to model the noise. |
'standard_normal'
|
distribution_parameters |
Optional[ArrayLike]
|
Optional parameters to customize the noise distribution. |
None
|
Returns:
Type | Description |
---|---|
NDArray
|
The estimated positions for the UAV computed using the WLS algorithm for the given input scenario |
NDArray
|
and the true trajectory that the UAV followed. |
Source code in autonav/WLS.py
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 |
|
Plots¶
This module contains the plotting functions.
plot_rmse ¶
plot_rmse(
estimated_trajectories: List[ArrayLike],
true_trajectories: List[ArrayLike],
names_of_the_algorithms: Optional[List[str]] = None,
) -> NDArray
Plots the root mean squared error along the trajectory for one or more algorithms.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
estimated_trajectories |
List[ArrayLike]
|
The estimated trajectory that the UAV followed. |
required |
true_trajectories |
List[ArrayLike]
|
The true trajectory that the UAV followed. |
required |
names_of_the_algorithms |
Optional[List[str]]
|
The names of the algorithms in the same order as in estimated_trajectories. |
None
|
Returns:
Type | Description |
---|---|
NDArray
|
An NDArray object containing the RMSE comparison. |
Source code in autonav/plots.py
plot_trajectories ¶
plot_trajectories(
ideal_trajectory: ArrayLike,
estimated_trajectories: List[ArrayLike],
a_i: ArrayLike,
names_of_the_algorithms: Optional[List[str]] = None,
) -> list
Plots the ideal and estimated trajectory for one or more algorithms.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ideal_trajectory |
ArrayLike
|
The ideal trajectory that the UAV is supposed to follow. |
required |
estimated_trajectories |
List[ArrayLike]
|
The estimated trajectory that the UAV followed using an algorithm. |
required |
names_of_the_algorithms |
Optional[List[str]]
|
The names of the algorithms in the same order as in estimated_trajectories. |
None
|
a_i |
ArrayLike
|
The position of the anchors. |
required |
Returns:
Type | Description |
---|---|
list
|
A list of Matplotlib Axes object containing the ideal and estimated trajectory comparison. |
Source code in autonav/plots.py
Metrics¶
This module contains the metrics functions.
compute_armse ¶
This function computes the average root mean squared error between the true and estimated trajectory of the UAV.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
estimated_trajectory |
ArrayLike
|
The estimated trajectory by the algorithm. |
required |
true_trajectory |
ArrayLike
|
The true trajectory that the UAV followed. |
required |
Returns:
Type | Description |
---|---|
float
|
The average root mean squared error between the true and the estimated trajectories. |
Source code in autonav/metrics.py
compute_rmse ¶
Computes the root mean squared error between the true and estimated trajectory of the UAV.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
estimated_trajectory |
ArrayLike
|
The estimated trajectory by the algorithm. |
required |
true_trajectory |
ArrayLike
|
The true trajectory that the UAV followed. |
required |
Returns:
Type | Description |
---|---|
list
|
The average root mean squared error between the true and the estimated trajectories. |
Source code in autonav/metrics.py
Other functions¶
This module contains the functions to read the path file.
readpathfile ¶
Reads the path file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
The name of the file to read. |
required |
Returns:
Type | Description |
---|---|
NDArray
|
The waypoints needed to guide the drone. |