|
| 1 | +% Visualize Montecarlo simulation's each run in a 2d and 3D plot. |
| 2 | +% @author : Jagatpreet |
| 3 | +% Northeastern University |
| 4 | +% Date created: Sep 9, 2023 |
| 5 | + |
| 6 | +clc |
| 7 | +clear all |
| 8 | +close all |
| 9 | + |
| 10 | +%% config for paths and queries |
| 11 | +root_folder = fullfile("/media/jagatpreet/Data/datasets/",... |
| 12 | + "imu_modeling_paper/",... |
| 13 | + "2021_MC_sim_IMU_simulation_model/",... |
| 14 | + "simulation_results/"); |
| 15 | +sensor_data_folder_name = "vn100"; |
| 16 | +simulation_folder_name = "stationary_wbp_ag_100s"; |
| 17 | + |
| 18 | +total_files = 200; |
| 19 | + |
| 20 | +% Many times the folder has both accelerometer and gyroscope simulation |
| 21 | +% data. |
| 22 | +if total_files == 200 |
| 23 | + N_acc_files = 100; |
| 24 | + N_gyro_files = 100; |
| 25 | +end |
| 26 | + |
| 27 | +%% File search using query |
| 28 | +sim_dir = fullfile(root_folder,... |
| 29 | + sensor_data_folder_name,... |
| 30 | + simulation_folder_name); |
| 31 | +filenames = sort_filenames_natural_order(sim_dir,".mat"); |
| 32 | + |
| 33 | +if ~ isempty(filenames) |
| 34 | + sprintf("Data is present - %d runs are logged. Proceeding to plot", ... |
| 35 | + length(filenames)); |
| 36 | +end |
| 37 | + |
| 38 | + |
| 39 | +if total_files <= 100 |
| 40 | + disp("Only single type of simulation is done. Processing and storing"); |
| 41 | + files_to_process = filenames(1:total_files); % accelerometer simulaend |
| 42 | +else |
| 43 | + files_to_process = filenames(1:N_acc_files); % accelerometer simula |
| 44 | +end |
| 45 | + |
| 46 | +%% Accelerometer |
| 47 | +monte_carlo_sim_struct = gen_MC_sim_struct_from_files(sim_dir,files_to_process); |
| 48 | +plot_mc_sim_runs(monte_carlo_sim_struct, strcat(simulation_folder_name, "accelerometer")); |
| 49 | +visualize_mc_sim_3d(monte_carlo_sim_struct); |
| 50 | + |
| 51 | +%% Gyroscope |
| 52 | +if length(filenames) > N_acc_files |
| 53 | + files_to_process = filenames(N_acc_files:end); % gyroscope simulation |
| 54 | + monte_carlo_sim_struct = gen_MC_sim_struct_from_files(sim_dir,files_to_process); |
| 55 | + h = plot_mc_sim_runs(monte_carlo_sim_struct,strcat(simulation_folder_name, "gyroscope")); |
| 56 | +end |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
0 commit comments