Synthetic Data Generation
Creates a synthetic dataset using a constant magnetic vector that is randomly rotated in three different degrees of motion: low, mid, and high. The created data is saved in the folderPath directory as a pickle (.pkl) file. The file's name uses the date of its creation as: yyyymmdd_hhmm.pkl
The data provided is: magnetic field (m), magnetic field with added noise (mt), magnetic field with HSI (mm), magnetic field with HSI and noise (mmt), angular rates (w), angular rates with noise (wt), angular rates with gyroscope bias (wm), angular rate with gyroscope bias and noise (wmt), attitude (rph), time (t), ground truth magnetic vector (m0), soft iron (si), hard iron (hi), and gyroscope bias (wb).
For each level of movement the data is provided as a multi-dimensional array, where the shape is: (simulation, samples, 3).
If not random, the soft iron, hard iron, and gyroscope biases are fixed as follows:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder_path |
Path
|
Folder to save the data as a pickle (.pkl) file. |
required |
niter |
int
|
Number of simulations per motion level, by default 100 |
100
|
nsamples |
int
|
Number of samples per simulation, by default 10000 |
10000
|
frequency |
float
|
Simulated sensor frequency, by default 25 |
25.0
|
mag_noise_G |
float
|
Noise for the magnetic measurements in G. |
0.01
|
gyro_noise_rad_s |
float
|
Noise for the gyroscope measurements in rad/s |
0.005
|
random |
bool
|
If True, the soft iron, hard iron, and gyroscope biases are randomly generated. If False, the soft iron, hard iron, and gyroscope biases are fixed, by default False. |
False
|
scale_factor |
float
|
Scale factor for the SI, HI, and WB matrices, by default 1.0 |
1.0
|
Source code in magyc/sim_data/generate_data.py
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 |
|