RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
magnetic_based_position.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
3  * 2020 Freie Universität Berlin
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
24 #ifndef MAGNETIC_BASED_POSITION_H_
25 #define MAGNETIC_BASED_POSITION_H_
26 
27 #include <inttypes.h>
28 #include <math.h>
29 
30 #include "matrix.h"
31 
35 #define I0 15
36 
40 #define NW 140
41 
45 #define R0 0.25
46 
50 #define PI 3.14159265358979323846
51 
55 #define AR PI * R0 * R0 //Loop area
56 
60 #define MU0 4 * PI * 1E-7 //TGm/A
61 
65 #define K MU0 * NW * I0 * AR / (4 * PI)
66 
70 #define MG_TO_T 1E7
71 
75 #define K_T K * MG_TO_T
76 
80 #define MILPS_MAX_DIST 25
81 
93  matrix_t approx_value_arr[],
94  matrix_t absolute_error_arr[],
95  uint8_t length);
96 
109 void magnetic_based_get_distances(matrix_t magnetic_field_strength_arr[],
110  matrix_t angular_theta_arr[],
111  matrix_t distance_arr[], uint8_t length,
112  matrix_t k);
113 
126 
138  matrix_t point[3]);
150  matrix_t target_point[3],
151  matrix_t k);
164  matrix_t ref_point_matrix[m][3],
165  matrix_t target_point[],
166  matrix_t k,
167  matrix_t magn_field_vec[]);
168 
182 void magnetic_based_preprocessing_get_position(uint8_t anchor_num,
183  matrix_t anchor_pos_matrix[anchor_num][3],
184  matrix_t pseudo_inv_matrix[4][anchor_num],
185  matrix_t homog_sol_arr[],
186  matrix_t solution_x1[],
187  matrix_t solution_x2[]);
188 
189 #endif /* MAGNETIC_BASED_POSITION_H_ */
magnetic_based_get_distances_to_anchors
matrix_t magnetic_based_get_distances_to_anchors(matrix_t ref_point[3], matrix_t point[3])
Computes the distance between a mobile station and a reference station of magnetic-based localization...
Definition: magnetic_based_position.c:50
matrix.h
Matrix computations.
magnetic_based_get_distances
void magnetic_based_get_distances(matrix_t magnetic_field_strength_arr[], matrix_t angular_theta_arr[], matrix_t distance_arr[], uint8_t length, matrix_t k)
Computes the distances between a mobile station and the reference stations of a magnet-based localiza...
Definition: magnetic_based_position.c:125
magnetic_based_get_magnetic_field_vec
void magnetic_based_get_magnetic_field_vec(uint8_t m, matrix_t ref_point_matrix[m][3], matrix_t target_point[], matrix_t k, matrix_t magn_field_vec[])
Computes the magnetic field strengths from a mobile station to various reference stations.
Definition: magnetic_based_position.c:91
magnetic_based_preprocessing_get_position
void magnetic_based_preprocessing_get_position(uint8_t anchor_num, matrix_t anchor_pos_matrix[anchor_num][3], matrix_t pseudo_inv_matrix[4][anchor_num], matrix_t homog_sol_arr[], matrix_t solution_x1[], matrix_t solution_x2[])
Computes the position of a mobile station by a magnetic-based localization system.
Definition: magnetic_based_position.c:188
matrix_t
#define matrix_t
Define the data type of the matrix elements.
Definition: matrix.h:38
magnetic_based_get_r
matrix_t magnetic_based_get_r(matrix_t B, matrix_t theta, matrix_t k)
Computes the distance between a mobile station and a reference stations of a magnet-based localizatio...
Definition: magnetic_based_position.c:166
magnetic_based_get_absolute_error
void magnetic_based_get_absolute_error(matrix_t value_arr[], matrix_t approx_value_arr[], matrix_t absolute_error_arr[], uint8_t length)
Computes the absolute error of a position of magnet-based localization system.
Definition: magnetic_based_position.c:34
magnetic_based_get_magnetic_field
matrix_t magnetic_based_get_magnetic_field(matrix_t ref_point[3], matrix_t target_point[3], matrix_t k)
Computes the magnetic field strength from a mobile station to a reference station.
Definition: magnetic_based_position.c:62